mirror of
https://github.com/textmate/textmate.git
synced 2026-01-22 05:07:54 -05:00
Ensure document stays open in refresh helper
The refresh helper uses the document’s undo manager in its destructor. Normally the document would stay open throughout the duration of the scope in which the refresh helper is used, but it might be possible to close the current document from a nested event loop, as spawned e.g. by showing a tool tip, in which case, the document will be closed when we reach the destructor.
This commit is contained in:
@@ -119,6 +119,8 @@ struct refresh_helper_t
|
||||
{
|
||||
if(++_self.refreshNestCount == 1)
|
||||
{
|
||||
_document->open();
|
||||
|
||||
_revision = document->buffer().revision();
|
||||
_selection = editor->ranges();
|
||||
_document->undo_manager().begin_undo_group(_editor->ranges());
|
||||
@@ -194,6 +196,8 @@ struct refresh_helper_t
|
||||
[_self updateChoiceMenu:nil];
|
||||
}
|
||||
}
|
||||
|
||||
_document->close();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user