martinrotter / textosaurus

Cross-platform text editor based on Qt and Scintilla.
GNU General Public License v3.0
284 stars 44 forks source link

Searching not working. Always returns 0 results. #57

Closed lenrok258 closed 5 years ago

lenrok258 commented 5 years ago

Searching not working. Always returns 0 results.

How to reproduce the bug?

  1. Open any text file
  2. Open file modal (crtl+f)
  3. Search for any text present on the page

What is the expected result?

Result should be found.

What actually happened?

'Cannot find the text "foobar"' is displayed.

Other information (logs, see Wiki)

What is interesting occurrence cannot be find if clicking on "Find Next" button but clicking on "Count" returns value > 0.

Problem happens in each "Match mode".

OS: Ubuntu: 4.15.0-38-generic #41~16.04.1-Ubuntu SMP Wed Oct 10 20:16:04 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux Textosaurus version: 0.9.10 No logs are created after clicking on "Find Next" button.

martinrotter commented 5 years ago

This is weird! Can you post sample file which triggers the bug? Or does it happen with every file?

lenrok258 commented 5 years ago

It happens for every file.

Please see the attached gif.

ezgif com-video-to-gif

martinrotter commented 5 years ago

Yes, does "Find Previous" or "Find All" work in same scenario? I believe that it cannot find anything because you actually placed text cursor to the end of file, you placed it after last "foobar", thus "Find Next" cannot find anything, because it starts its search from the position of your cursor. If you place your text cursor otherwise (for example somewhere on first line) does it help?

It does not "wrap around" search so far, do you think "wrap around" should be added?

lenrok258 commented 5 years ago

You are right! I would say it is a bit misleading as in most editors if the cursor is at the end of the file it starts searching from beginning. Do you consider adding such option?

Nevertheless thank you for being superb responsive and sorry for wasting your time.

martinrotter commented 5 years ago

I feel like adding "Wrap search around" could make sense. Can you create separate ticket for it?

lenrok258 commented 5 years ago

Sure, done: https://github.com/martinrotter/textosaurus/issues/60