fix: Loading files into memory
This commit is contained in:
parent
9cbfaed5fe
commit
1b665fa1b3
@ -44,6 +44,12 @@ namespace hex::prv::undo {
|
||||
const std::vector<std::unique_ptr<Operation>> &getUndoneOperations() const {
|
||||
return this->m_redoStack;
|
||||
}
|
||||
|
||||
void reset() {
|
||||
this->m_undoStack.clear();
|
||||
this->m_redoStack.clear();
|
||||
}
|
||||
|
||||
private:
|
||||
[[nodiscard]] Operation* getLastOperation() const {
|
||||
return this->m_undoStack.back().get();
|
||||
|
@ -201,7 +201,7 @@ namespace hex::plugin::builtin {
|
||||
return {
|
||||
{ "hex.builtin.provider.file.menu.open_folder"_lang, [this] { fs::openFolderWithSelectionExternal(this->m_path); } },
|
||||
{ "hex.builtin.provider.file.menu.open_file"_lang, [this] { fs::openFileExternal(this->m_path); } },
|
||||
{ "hex.builtin.provider.file.menu.into_memory"_lang, [this] { this->convertToMemoryFile(); } }
|
||||
{ "hex.builtin.provider.file.menu.into_memory"_lang, [this] { this->convertToMemoryFile(); } }
|
||||
};
|
||||
}
|
||||
|
||||
@ -313,7 +313,11 @@ namespace hex::plugin::builtin {
|
||||
}
|
||||
|
||||
memoryProvider->markDirty(true);
|
||||
ImHexApi::Provider::remove(this, false);
|
||||
memoryProvider->getUndoStack().reset();
|
||||
|
||||
TaskManager::runWhenTasksFinished([this]{
|
||||
ImHexApi::Provider::remove(this, false);
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user