Allow to retry opening in interactive CLI

This commit is contained in:
Martchus 2017-12-17 23:38:45 +01:00
parent 529382e881
commit 1929bcf55b
1 changed files with 32 additions and 24 deletions

View File

@ -20,6 +20,7 @@
using namespace std;
using namespace std::placeholders;
using namespace ApplicationUtilities;
using namespace ConversionUtilities;
using namespace EscapeCodes;
using namespace IoUtilities;
@ -243,6 +244,7 @@ void InteractiveCli::openFile(const string &file, bool readOnly)
return;
}
m_file.setPath(file);
for (;;) {
try {
try {
m_file.open(readOnly);
@ -267,10 +269,16 @@ void InteractiveCli::openFile(const string &file, bool readOnly)
if (*e.what() != 0) {
m_o << e.what() << endl;
}
if (confirmPrompt("Retry opening?", Response::Yes)) {
m_file.close();
continue;
}
m_file.clear();
m_currentEntry = nullptr;
}
m_modified = false;
return;
}
}
void InteractiveCli::closeFile()