Author Topic: Double click on error in Output Tool Window takes to wrong line  (Read 697 times)

rowbearto

  • Senior Community Member
  • Posts: 1467
  • Hero Points: 111
Double click on error in Output Tool Window takes to wrong line
« on: October 06, 2018, 03:59:42 pm »
Look for out_win_wrong_line.tar.gz on support.

See the README file inside it to repro.

I'm using beta5 on Linux x64, Centos 7.2

Clark

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 4893
  • Hero Points: 398
Re: Double click on error in Output Tool Window takes to wrong line
« Reply #1 on: October 07, 2018, 05:14:43 am »
There's no great workaround for this. We could put in an option to never use old line numbers (then you get other issues that IMO are worse than your special whammy macro). Builds are asynchronous and SlickEdit can set the old line numbers at the wrong time if you're making edits BEFORE the build finishes (no way around that).

The idea with old line numbers is like this. Once you start traversing your error messages, you're likely to insert or delete lines. By navigating to old line numbers, SlickEdit can still go to the correct error line even if it moved. Your macro just illustrates a limitation to the algorithm.

rowbearto

  • Senior Community Member
  • Posts: 1467
  • Hero Points: 111
Re: Double click on error in Output Tool Window takes to wrong line
« Reply #2 on: October 07, 2018, 03:06:13 pm »
Thanks for looking at it and for the explanation Clark.

I think what could possibly work for me is that if you gave me a SlickC macro that I could call that makes it so that old line numbers stop getting used. However this is a one time thing, if I run another build that would trigger old line numbers to be used again until I call this macro. Perhaps something like this already exists? You would need some macro like this already when performing a 2nd build, telling it to stop using old line numbers from the 1st build.

What I'm doing here is very similar to a build and outputting the results to the "Output" tool window instead of the "Build" tool window. So it would be appropriate for me to call this macro before doing this build.

Clark

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 4893
  • Hero Points: 398
Re: Double click on error in Output Tool Window takes to wrong line
« Reply #3 on: October 07, 2018, 05:07:25 pm »
What you’re describing won’t work. If your macro were to disable old line number support, that would work BUT you can’t turn it back on. Old line numbers are set AFTER the build finishes. This is asynchronous.

rowbearto

  • Senior Community Member
  • Posts: 1467
  • Hero Points: 111
Re: Double click on error in Output Tool Window takes to wrong line
« Reply #4 on: October 07, 2018, 05:49:07 pm »
I think I may not have been clear. I am not asking for a macro that disables old line number support, I'm asking for resetting the old->new line number mapping table.

After a build in the process buffer (lets call this "PBuild"), I'm thinking that SlickEdit must be creating some kind of mapping table of old->new line numbers. Then when a user edits a file, it adjusts this mapping table.

Before any PBuild takes place, this mapping table probably doesn't exist, or is in some default state where "new line" = "old line" or "1-1" mode.

My request is to have a macro that allows me to clear this mapping table and put it back into 1-1 mode. This way when I initiate a build in the Output Window (lets call this "OBuild"), I can call this new macro to clear this mapping table.

Currently if I open SlickEdit, don't perform any PBuild, and do many iterations of Edit/OBuild, since there is no mapping table, double clicking in an Output Window error always takes me to the correct line. But after the first PBuild, this mapping table exists and I no longer go to the right line for subsequent OBuild error output. I'm requesting to have a way to put it back to the way it was before I did my first PBuild, where there the mapping table for that file is cleared and is in 1-1 mode.

An alternative solution could be to have a mode so that whenever I double-click on a line in the Output Window (not the process buffer), it always goes to the new line, but the Process buffer always goes to the old line.

rowbearto

  • Senior Community Member
  • Posts: 1467
  • Hero Points: 111
Re: Double click on error in Output Tool Window takes to wrong line
« Reply #5 on: October 07, 2018, 08:04:18 pm »
If I setup a new build configuration that just runs "echo hi", and I run a PBuild on it, then this seems to clear out the memory of all the old line numbers, and double-clicking in the output window after new OBuild will bring me to the correct line.

So performing a PBuild is clearing out the memory of all the old line numbers somehow - I'd like to have a macro that I can call to clear out the memory of all old line numbers without having to do a PBuild on a dummy build configuration.

Clark

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 4893
  • Hero Points: 398
Re: Double click on error in Output Tool Window takes to wrong line
« Reply #6 on: October 07, 2018, 09:24:55 pm »
I'm not seeing a way to clear them but you can call _SetAllOldLineNumbers again which just about does the same thing.

rowbearto

  • Senior Community Member
  • Posts: 1467
  • Hero Points: 111
Re: Double click on error in Output Tool Window takes to wrong line
« Reply #7 on: October 07, 2018, 10:21:14 pm »
Thanks Clark! _SetAllOldLineNumbers() appears to accomplish exactly what I need, plus if I modify the buffer it remembers the old line number for an errors (in the Output window) that were reported before.