diff options
Diffstat (limited to 'ide-rename-symbol.c')
-rw-r--r-- | ide-rename-symbol.c | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/ide-rename-symbol.c b/ide-rename-symbol.c index 97c16a5..0ff69e8 100644 --- a/ide-rename-symbol.c +++ b/ide-rename-symbol.c @@ -207,18 +207,17 @@ void rename_symbol_process_lsp_response(Ted *ted, const LSPResponse *response) { } } done: - - // end all edit chains in all buffers - // they're almost definitely all created by us - for (u16 i = 0; i < TED_MAX_BUFFERS; ++i) { - if (ted->buffers_used[i]) { - TextBuffer *buffer = &ted->buffers[i]; - buffer_end_edit_chain(buffer); + + { + // end all edit chains in all buffers + // they're almost definitely all created by us + arr_foreach_ptr(ted->buffers, TextBufferPtr, pbuffer) { + buffer_end_edit_chain(*pbuffer); } + + ted_save_all(ted); } - ted_save_all(ted); - cleanup: rename_symbol_clear(ted); if (menu_is_open(ted, MENU_RENAME_SYMBOL)) |