diff options
author | mitchell <70453897+667e-11@users.noreply.github.com> | 2020-08-27 19:54:49 -0400 |
---|---|---|
committer | mitchell <70453897+667e-11@users.noreply.github.com> | 2020-08-27 19:54:49 -0400 |
commit | 6921a21d30a4b9f35fa1b8d06242deebab49dad0 (patch) | |
tree | 78a09021298a4ae21fbb2e6cb492efababe4f372 /test | |
parent | 39a2cab4bfe90e17a4ca0970acb758b0238b12de (diff) |
Fixed restoring find & replace pane's replace text outside of "Find in Files".
Diffstat (limited to 'test')
-rw-r--r-- | test/test.lua | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/test/test.lua b/test/test.lua index 001124e4..c4693ea3 100644 --- a/test/test.lua +++ b/test/test.lua @@ -1019,14 +1019,12 @@ function test_ui_buffer_switch_save_restore_properties() buffer:goto_pos(10) view:fold_line( buffer:line_from_position(buffer.current_pos), view.FOLDACTION_CONTRACT) - view.view_eol = true view.margin_width_n[1] = 0 -- hide line numbers view:goto_buffer(-1) assert(view.margin_width_n[1] > 0, 'line numbers are still hidden') view:goto_buffer(1) assert_equal(buffer.current_pos, 10) assert_equal(view.fold_expanded[buffer:line_from_position(buffer.current_pos)], false) - assert_equal(view.view_eol, true) assert_equal(view.margin_width_n[1], 0) buffer:close() end @@ -2389,6 +2387,20 @@ function test_ui_find_replace() buffer:close(true) end +function test_ui_find_replace_text_save_restore() + if CURSES then return end -- there are focus issues in curses + ui.find.focus() + ui.find.find_entry_text = 'foo' + ui.find.replace_entry_text = 'bar' + ui.find.find_next() + ui.find.focus() -- simulate activating "Find" + assert_equal(ui.find.replace_entry_text, 'bar') + ui.find.focus{in_files = true} -- simulate activating "Find in Files" + assert(ui.find.replace_entry_text ~= 'bar', 'filter entry text not set') + ui.find.focus{in_files = false} -- simulate activating "Find" + assert_equal(ui.find.replace_entry_text, 'bar') +end + function test_ui_find_replace_all() buffer.new() local text = table.concat({ |