diff options
author | 2020-10-05 16:51:17 -0400 | |
---|---|---|
committer | 2020-10-05 16:51:17 -0400 | |
commit | 9952db760ae205d25de900349ac0fc6ae33b7be9 (patch) | |
tree | 800392a9086c411501f1026f96c40d8b607c530b /test | |
parent | d88a65ae78190eb6a2a94938c93c87c2148c60fc (diff) | |
download | textadept-9952db760ae205d25de900349ac0fc6ae33b7be9.tar.gz textadept-9952db760ae205d25de900349ac0fc6ae33b7be9.zip |
Fixed advancing caret for incremental find when text is not found.
Diffstat (limited to 'test')
-rw-r--r-- | test/test.lua | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/test/test.lua b/test/test.lua index d89937a7..be2d432f 100644 --- a/test/test.lua +++ b/test/test.lua @@ -2310,6 +2310,23 @@ function test_ui_find_incremental_highlight() buffer:close(true) end +function test_ui_find_incremental_not_found() + buffer.new() + buffer:set_text('foobar') + ui.find.incremental = true + ui.find.find_entry_text = 'b' + if CURSES then events.emit(events.FIND_TEXT_CHANGED) end -- simulate + assert_equal(buffer.current_pos, 4) + ui.find.find_entry_text = 'bb' + if CURSES then events.emit(events.FIND_TEXT_CHANGED) end -- simulate + assert_equal(buffer.current_pos, 1) + events.emit(events.FIND, ui.find.find_entry_text, true) -- simulate Find Next + assert_equal(buffer.current_pos, 1) -- cursor did not advance + ui.find.find_entry_text = '' + ui.find.incremental = false + buffer:close(true) +end + function test_ui_find_find_in_files() ui.find.find_entry_text = 'foo' ui.find.match_case = true |