Opened 6 years ago

Closed 6 years ago

#10762 closed bug (duplicate)

Files opened in StyleEdit cannot search text

Reported by: HAL Owned by: korli
Priority: normal Milestone: R1
Component: Applications/StyledEdit Version: R1/Development
Keywords: text unsearchable Cc:
Blocked By: #11463 Blocking:
Platform: All


Trying to search for any word or string in file with StyleEdit does not work. There is one exception: /boot/system/var/log/syslog.old can be searched but not syslog. Moving syslog.old to any other folder can still be searched. No other text file in any other folder is searchable.. Steps to reproduce:

  1. Navigate to /boot/system/var/log/ and open syslog.old
  2. Click Edit, Find
  3. Search for any word or string known to be in the file.

Result: it can be found and gets hilghted. Repeat 1 to 3 for any other file in any directory. Result: word or string cannot be found. I was testing in hrev47110.

Change History (10)

comment:1 by humdinger, 6 years ago

Can't reproduce. Maybe your cursor is positioned below the last hit and you don't have "wrap-around" activated?

comment:2 by HAL, 6 years ago

Today I could reproduce it for a while but then after a few minutes could not. It did not seeem like a intermittant bug when I reported it. It seems to be consistantly reproduceable for a while then StyleEdit search starts working consistantly. When I open StyleEdit with the file which I double click on. StyleEdit opens a single window but if I open StyleEdit first then the file from File, Open, two windows are opened. One blank underneath the window containing test. I thought it might be reproduceable only openning StyleEdit by double clicking the file with only a single window and wraparound not ticked and this seemed to reproduce the bug but after a while it made no difference. No difference openning as a single window and/or wraparound ticked or not. I made sure the cursor was not showing after any word.

comment:3 by HAL, 6 years ago

Maybe the bug fixes itself from first trying to reproduce by:

  1. Openning the file, double clicking in a single window

result: wont find any text. 2: Openning StyleEdit then File, Open for any text file. Result: search works.

  1. Close both StyleEdit windows then double click on a text file to open just one StyleEdit window as in 1.

Result: Text can be searched the action of 2 has fixed text searching for 1.

I am not certain this is true. I will try another Haiku session.

comment:4 by HAL, 6 years ago

No, it doen't work that way completely as in my last comment. I tried a new session, leaving my computer shut down for 1.5 minutes.

  1. I clicked on Haiku/system/lvar/log/syslog which opened in StyleEdit single window. At first no text could be searched.
  2. I closed StyleEdit then clicked Haiku/system/lvar/log/syslog.old. Text was searchable.

3, I then tried as in 1 again and text was now searchable in syslog. It was also searchable in other files in the home folder. So yes; if the first file is unsearchable but another is searchable later, the later one gains searchability for the first, no matter what way they are openned. Not certain if this is 100% true either. Maybe something else fixes searchability for all files after a while.

comment:5 by humdinger, 6 years ago

Still can't reproduce...

Things to consider: when opening a prestine text file (i.e. one that was never opened in StyledEdit) like a fresh syslog, StyledEdit sets the cursor at the end of the file. Therefore, searching without wrap-around won't find anything.
It could be argued that setting the cursor to the top of the file would be better for that reason.

If you're unsure where the cursor position is in your file before starting your search, press a key to jump the view to the cursor.

You may want to remove the be:caret_position attribute of the text file or play with its value if you keep experimenting (either from Terminal or DiskProbe). I tried entering a value bigger than the file to see how StyledEdit reacts. It correctly sets the cursor to the end of the file. So that can't be your issue either...

in reply to:  5 comment:6 by siarzhuk, 6 years ago

Replying to humdinger:

Still can't reproduce...

try with read-only file.

BTW, syslog is a bit specific - node monitoring for example has also problems with it.

comment:7 by HAL, 6 years ago

Very strange; now every file I search will find text even with wraparound off, searching the file like this straight after openning. This includes syslog. I searched different text files. Files I wrote and some readme files. They are all searchable now in this haiku session.

comment:8 by HAL, 6 years ago

I just struck some debug text files that could only be searched at first by turning on wraparound. After that I closed them and did the search again without wraparound and the words were still searchable.

comment:9 by HAL, 6 years ago

When a file has not been openned before by StyleEdit, at first the curser is at the end of text. After it is openned a second time there is no curser position as far as I can see. That is why wraparound has to be turned on first time. Closing and reopenning same file, text can be searched with wraparound turned off. That does not explain why when I started this haiku session and searched syslog without wraparound, text was searchable, this time. Unless a raw file sometimes can open without the curser positioned anywhere.

Last edited 6 years ago by HAL (previous) (diff)

comment:10 by diver, 6 years ago

Blocked By: 11463 added
Resolution: duplicate
Status: newclosed
Note: See TracTickets for help on using tickets.