aboutsummaryrefslogtreecommitdiffhomepage
path: root/test
diff options
context:
space:
mode:
authorGravatar mitchell <70453897+orbitalquark@users.noreply.github.com>2021-04-30 18:40:06 -0400
committerGravatar mitchell <70453897+orbitalquark@users.noreply.github.com>2021-04-30 18:40:06 -0400
commit715901363a02634f5336c0d3f18cbd9a9c080b4a (patch)
tree315146ace595595cefe4e6b4eae01c475a21a85b /test
parenta775e9fb4188f2638111c15623ea9bd5c804b3e2 (diff)
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.)
Diffstat (limited to 'test')
-rw-r--r--test/test.lua5
1 files changed, 5 insertions, 0 deletions
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')