diff options
author | pommicket <pommicket@gmail.com> | 2023-08-13 12:05:54 -0300 |
---|---|---|
committer | pommicket <pommicket@gmail.com> | 2023-08-13 12:05:54 -0300 |
commit | 598d72c0674bb059c0f38f03c4851bcc61e5852d (patch) | |
tree | ae01311a6bdf872120b9787d44746ab9cd95db14 /buffer.c | |
parent | dbf441cdc74245c5a5f567ae0165146cd74c3b92 (diff) |
various little changes, remove calls to change_directory
Diffstat (limited to 'buffer.c')
-rw-r--r-- | buffer.c | 7 |
1 files changed, 5 insertions, 2 deletions
@@ -229,6 +229,8 @@ u32 buffer_last_line_on_screen(TextBuffer *buffer) { void buffer_set_undo_enabled(TextBuffer *buffer, bool enabled) { buffer->store_undo_events = enabled; + if (!enabled) + buffer_clear_undo_redo(buffer); } Rect buffer_rect(TextBuffer *buffer) { @@ -2234,10 +2236,11 @@ bool buffer_change_number_at_pos(TextBuffer *buffer, BufferPos *ppos, i64 by) { return ret; } -void buffer_change_number_at_cursor(TextBuffer *buffer, i64 by) { +bool buffer_change_number_at_cursor(TextBuffer *buffer, i64 by) { buffer_start_edit_chain(buffer); - buffer_change_number_at_pos(buffer, &buffer->cursor_pos, by); + bool ret = buffer_change_number_at_pos(buffer, &buffer->cursor_pos, by); buffer_end_edit_chain(buffer); + return ret; } // decrease the number of lines in the buffer. |