Author Topic: old line numbers and removing search result lines  (Read 1830 times)

rowbearto

  • Senior Community Member
  • Posts: 2335
  • Hero Points: 132
old line numbers and removing search result lines
« on: December 07, 2019, 07:05:20 PM »
I do a search for some lines of code I want to remove, say all lines with "XXX". I'm using List all occurrences in bigfind.

After I delete the first line with "XXX", when I double click the next search result I'm not going to the line that has the "2nd" XXX. I think SlickEdit used to be able to preserve the old line numbers so you could edit the file but still go to old search results? It seems maybe broken now.

I'm using 24.0.0.8, Linux x64, hotfix 5 (the fixed hotfix 5)

Clark

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 6823
  • Hero Points: 526
Re: old line numbers and removing search result lines
« Reply #1 on: December 08, 2019, 12:02:45 AM »
Right now, SlickEdit only uses old line number support for builds. Given the implementation, using it for both wouldn’t work if you use the other feature.

LBCEi

  • Senior Community Member
  • Posts: 261
  • Hero Points: 21
Re: old line numbers and removing search result lines
« Reply #2 on: December 08, 2019, 02:35:03 AM »
I'm not sure how SE (the search results window, specifically) would be able to know that you had edited the buffer and deleted a line.  Unless you do another search, the search results are going to remain the same (based on the contents of the buffer at the time that you did the search).  I don't recall SE ever being so smart as to re-do a search after a buffer edit. 

Clark

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 6823
  • Hero Points: 526
Re: old line numbers and removing search result lines
« Reply #3 on: December 08, 2019, 02:54:47 AM »
I was incorrect. SlickEdit does appear to use old line numbers for some search operations.

I just tried a simple "List all occurrences" from the big find "Find" tab. It worked for me. I had 3 lines with hits. Went to the first line. Deleted this line containing the first occurrence and the next line. Double clicked on the second occurrence and it went to the correct line. "find-next" worked for me too (used old line number).

rowbearto may be doing a different search or using different options than I tried. There are a million code paths here.

rowbearto

  • Senior Community Member
  • Posts: 2335
  • Hero Points: 132
Re: old line numbers and removing search result lines
« Reply #4 on: December 08, 2019, 04:05:36 PM »
I'm afraid I made this problem myself and it is not a bug in SlickEdit.

I have a macro that is calling _SetAllOldLineNumbers() whenever I save a file. After each line deletion, I instinctively click Ctrl+S to save. But this was causing _SetAllOldLineNumbers() to be called, trashing my previous old line numbers.

I had forgotten I was calling _SetAllOldLineNumbers() on each save.

Clark

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 6823
  • Hero Points: 526
Re: old line numbers and removing search result lines
« Reply #5 on: December 08, 2019, 04:50:31 PM »
I've searched for many bugs in SlickEdit that were my own user error too ;D