From 715901363a02634f5336c0d3f18cbd9a9c080b4a Mon Sep 17 00:00:00 2001 From: mitchell <70453897+orbitalquark@users.noreply.github.com> Date: Fri, 30 Apr 2021 18:40:06 -0400 Subject: Replaced `events.FILE_{BEFORE,AFTER}_RELOAD` with `events.BUFFER_{BEFORE,AFTER}_REPLACE_TEXT`. This allows more features to save/restore state when buffer contents are replaced (e.g. file reload, filter through, etc.) --- test/test.lua | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'test') diff --git a/test/test.lua b/test/test.lua index ebb7344b..09caf59e 100644 --- a/test/test.lua +++ b/test/test.lua @@ -351,6 +351,8 @@ function test_file_io_reload_file() assert(buffer:get_text() ~= text, 'buffer text is unchanged') buffer:reload() assert_equal(buffer:get_text(), text) + ui.update() + if CURSES then events.emit(events.UPDATE_UI, buffer.UPDATE_SELECTION) end assert_equal(buffer.current_pos, pos) buffer:close() end @@ -1237,6 +1239,8 @@ function test_bookmarks_reload() assert(has_bookmark(2), 'line not bookmarked') assert(has_bookmark(4), 'line not bookmarked') buffer:reload() + ui.update() + if CURSES then events.emit(events.UPDATE_UI, buffer.UPDATE_SELECTION) end assert(has_bookmark(2), 'bookmark not restored') assert(has_bookmark(4), 'bookmark not restored') buffer:close(true) @@ -3047,6 +3051,7 @@ function test_menu_menu_functions() textadept.menu.menubar[_L['Edit']][_L['Delete Word']][2]() assert_equal(buffer:get_text(), '') buffer:set_text('(foo)') + buffer:home() textadept.menu.menubar[_L['Edit']][_L['Match Brace']][2]() assert_equal(buffer.char_at[buffer.current_pos], string.byte(')')) buffer:set_text('foo f') -- cgit v1.2.3