Author Topic: 27.0.2.0: push-tag target is hardly visible  (Read 459 times)

os2bird

  • Senior Community Member
  • Posts: 110
  • Hero Points: 12
27.0.2.0: push-tag target is hardly visible
« on: May 16, 2023, 08:10:23 PM »
The push-tag command (mapped to "Ctrl-." here) is one of my favorites, ever since Visual SlickEdit version 4.  However, it's currently driving me nuts with 27.0.2.0 because it always scrolls the buffer so that cursor is 4 lines above the bottom of the screen when displaying the target function, which hides most of the good stuff that I want to see.  This even happens when I've centered the target function and jumps to it again, it hides all but first four lines of the function.  Working on a monitor in portrait mode, there is plenty of vertical space (104 lines).  Not sure if this is a new thing or if it always was this way and I just noticed, but both 27.0.x versions I've been using recently have the issue.

I'm also seeing something similar with search & replace, though it doesn't always scroll the buffer if the next hit is close by, so not quite as annoying.  Still a source of annoyance and RSI.

Any settings that I've messed up here? Or is this a bug where someone took the wrong end of the screen as reference when trying to center the target function?

-bird

Dan

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 2893
  • Hero Points: 153
Re: 27.0.2.0: push-tag target is hardly visible
« Reply #1 on: May 16, 2023, 08:17:26 PM »
What happens if you close your existing editor, and then run the editor with a clean configuration?

Code: [Select]
vs +new -sc <pathForNewConfig>
And then open your workspace, so that you have access to the tags?  Does this make any difference?

os2bird

  • Senior Community Member
  • Posts: 110
  • Hero Points: 12
Re: 27.0.2.0: push-tag target is hardly visible
« Reply #2 on: May 17, 2023, 12:08:47 AM »
Thanks for the quick reply, Dan!

The scenario here is still producible. The code in question is some ancient php stuff. The problem doesn't happen for the entire file, only after a really large and hairy function with lots of "<<<EOD" string sequences in it, some of which are a screen full or more (SQL).  Can't share the code unfortunately.

Hmm. After removing all the "<<<EOD...multiline-string...EOD;" bits from the big function, push-tag for the following function seems to work fine. It's centered on the screen (small function).  When I add back some 3 EOD blocks with ~20 lines of between them, push-tag for the following function isn't vertically centered any longer, it has walked down the screen.  It is definitely related to number of lines between the opening "<<<EOD" and the closing "EOD;", but it doesn't immediately seem to be a 1:1 relationship.

I thought I'd seen this in C/C++ code as well, but I cannot recall any specific scenario now other than the search of replace of javadoc/doxygen strings often displaying the a hit a few lines above the bottom of the screen, hiding the actual function signature from me.  I'll get back to you if I find something push-tag related in C/C++ code.

-bird

Dennis

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 3913
  • Hero Points: 513
Re: 27.0.2.0: push-tag target is hardly visible
« Reply #3 on: May 22, 2023, 02:01:50 PM »
When push-tag jumps to a symbol, it calls center-region() to scroll in order to center the entire symbol/function on the current page.  If we are calculating the start/end of this particular function incorrectly because of the embedded code, then that could be causing the problem.

How about if you obfuscate the source file?  Could you post it or send it into support then?  SlickEdit has a command:  obfuscate-current-file (run it from the SlickEdit command line).  You'll need to make sure that the obfuscation does not break the embedded regions.
« Last Edit: May 22, 2023, 02:08:50 PM by Dennis »

os2bird

  • Senior Community Member
  • Posts: 110
  • Hero Points: 12
Re: 27.0.2.0: push-tag target is hardly visible
« Reply #4 on: May 22, 2023, 09:28:33 PM »
Attached is a reproduction file with a function containing a large SQL query using heredoc strings and some dummy functions around it to illustrate the problem.  (The 'f ...' commands in the comment at the top of the file is for the slickedit command line.)

Dennis

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 3913
  • Hero Points: 513
Re: 27.0.2.0: push-tag target is hardly visible
« Reply #5 on: May 22, 2023, 11:27:25 PM »
Good example.  The behavior for case (5) is normal, because the whole function does not fit, we just center on the start line.  I'll look into the other cases.

Dennis

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 3913
  • Hero Points: 513
Re: 27.0.2.0: push-tag target is hardly visible
« Reply #6 on: May 22, 2023, 11:35:48 PM »
Found the bug, but it is not hot-fixable.  This will, however, be fixed in the next release.

And, I stand corrected on case (5), this issue was also on account of the same bug (line counting was way off because of here document).
« Last Edit: May 22, 2023, 11:38:08 PM by Dennis »

os2bird

  • Senior Community Member
  • Posts: 110
  • Hero Points: 12
Re: 27.0.2.0: push-tag target is hardly visible
« Reply #7 on: May 23, 2023, 08:11:35 AM »
Great news. Looking forward to the next binary update. Thanks.