mirror of
https://github.com/textmate/textmate.git
synced 2026-04-28 03:00:34 -04:00
Allow forcing an undo group to be closed
This commit is contained in:
@@ -25,12 +25,13 @@ namespace ng
|
||||
}
|
||||
}
|
||||
|
||||
void undo_manager_t::end_undo_group (ranges_t const& ranges)
|
||||
void undo_manager_t::end_undo_group (ranges_t const& ranges, bool force)
|
||||
{
|
||||
if(--_nesting_count == 0 && _changes)
|
||||
if((--_nesting_count == 0 || force) && _changes)
|
||||
{
|
||||
_records[_index-1].post_selection = ranges;
|
||||
_records[_index-1].post_revision = _buffer.bump_revision();
|
||||
_changes = 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@ namespace ng
|
||||
bool can_redo () const;
|
||||
|
||||
void begin_undo_group (ranges_t const& ranges);
|
||||
void end_undo_group (ranges_t const& ranges);
|
||||
void end_undo_group (ranges_t const& ranges, bool force = false);
|
||||
|
||||
ranges_t undo ();
|
||||
ranges_t redo ();
|
||||
|
||||
Reference in New Issue
Block a user