Allow to retry opening in interactive CLI
This commit is contained in:
parent
529382e881
commit
1929bcf55b
|
@ -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()
|
||||
|
|
Loading…
Reference in New Issue