diff options
author | 2020-08-23 17:42:33 -0400 | |
---|---|---|
committer | 2020-08-23 17:42:33 -0400 | |
commit | e326775782bc8b9b0e004d5134d602b26ffeb3a5 (patch) | |
tree | 54a56d3fb978a39ea4932cb86362ebe4589e1a11 /test | |
parent | a4ca21792b915781b69b3ece14a7a5f67595693c (diff) | |
download | textadept-e326775782bc8b9b0e004d5134d602b26ffeb3a5.tar.gz textadept-e326775782bc8b9b0e004d5134d602b26ffeb3a5.zip |
Fixed bug where jumping to a find in files result of length 1 highlights wrong.
Diffstat (limited to 'test')
-rw-r--r-- | test/test.lua | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/test/test.lua b/test/test.lua index 7e7894af..001124e4 100644 --- a/test/test.lua +++ b/test/test.lua @@ -2276,7 +2276,7 @@ function test_ui_find_find_in_files() assert(count > 0, 'no files found') local s = buffer:indicator_end(ui.find.INDIC_FIND, 0) while true do - local e = buffer:indicator_end(ui.find.INDIC_FIND, s + 1) + local e = buffer:indicator_end(ui.find.INDIC_FIND, s) if e == s then break end -- no more results assert_equal(buffer:text_range(s, e), 'foo') s = buffer:indicator_end(ui.find.INDIC_FIND, e + 1) @@ -2347,10 +2347,21 @@ function test_ui_find_find_in_files_interactive() buffer:close() ui.goto_view(1) view:unsplit() - buffer:close() ui.find.find_in_files_filters[_HOME] = filter end +function test_ui_find_in_files_single_char() + ui.find.find_entry_text = 'z' + ui.find.find_in_files(_HOME .. '/test') + ui.find.goto_file_found(true) + assert_equal(buffer:get_sel_text(), 'z') + ui.find.find_entry_text = '' + buffer:close() + ui.goto_view(1) + view:unsplit() + buffer:close() +end + function test_ui_find_replace() buffer.new() buffer:set_text('foofoo') |