Enhance "Go to line" functionality



  • Hi,
    Is that possible to enhance “Go to line” function (Ctrl-G) with history handling feature (history list with selection and repeat) like in “Search” function (CTRL-F)?
    It will be very usefull.

    Thanks!



  • @Marek-Stankowski

    Can you describe why such a thing would be “very useful”? I’m having trouble seeing it.

    Since I’m not picking up what you’re laying down…to me the Bookmark feature is useful for what I think you might be getting at.

    As a bonus, bookmarks stay with the lines they were originally set at as other lines are inserted/deleted. Wouldn’t insertion/deletion mess with your idea of a history for the Goto line feature?



  • Thanks for your answer, sorry for trouble with seeing. So in truth „very usefull” was maybe a little too expressive and override meaning. Simple „usefull” will be enough to see :).
    In my praktice:

    • „Go to line” I use freqently in debbuging process, when can’t predict if and how many times must go to specified place in code. It does not have to be precise, may show place around last „jump to the line”, but then history will help jumping between various places in code.
    • „Bookmarks” I use to mark main places, that assume to be used in the future. Bookmarks are is of course „very usefull”, but in other work process.

    PS. By the way for me „Bookmarks” may work better too - when each bookmark will have its own number (one number for one mark) and then you could go to specified bookmark by special keystroke (ie Alt-3 or other with number key). As I remember old editors (like Brief or other) had functionality like this.



  • @Marek-Stankowski

    when each bookmark will have its own number

    I think there is a plugin that has this functionality. “Bookmark manager” or something like that. Away from my PC right now so can’t check out the exact name. On my Mac Mini at the moment and loving everything about that, except no Notepad++. :(



  • @Alan Kilborn

    Yes, it’s Bookmark Manager, the older version 0.1.0.86 works fine.
    However it’s not maintained, not compatible with Plugin Admin.
    It can be installed with Plugin Manager, but at first the manager have to be installed, as I know the new versions don’t contain it.
    And then the NppBookmarkManager.dll have to copied to “C:\Program Files (x86)\Notepad++\plugins\NppBookmarkManager” folder, the images to the “C:\Program Files (x86)\Notepad++\plugins\images” folder, according to the new procedure.

    Furthermore the images folder and the NppBookmarkManager.dll exist in the C:\Users\USERNAME\AppData\Roaming\Notepad++\plugins folder too - I don’t know whether they are used or not.

    In summary, I think a similar bookmark manager should be integrated in Notepad++ .



  • @Laszlo-Botka

    Well, sometimes some hurdles must be overcome. :)

    Functionality that exists in a plugin, even an old one, is rarely ever integrated natively.



  • @Alan-Kilborn said:

    @Laszlo-Botka

    Well, sometimes some hurdles must be overcome. :)

    But not with pleasure.

    Functionality that exists in a plugin, even an old one, is rarely ever integrated natively.

    Well, i know two of these “rare” editors, but I don’t like to use two editors alternately. Of course, sometimes you have to.



  • Thank you both men once again for your help and discusion about Bookmarks and Manager.
    But it was not reply to my qustion about „go to line” history and you didn’t answer to my sugestion.
    What do you expect? Wasn’t my description clear enough?



  • @Marek-Stankowski said:

    But it was not reply to my qustion about „go to line” history

    Well, I for one didn’t really understand your description; sorry maybe a language barrier. If you care to try again (maybe some really concrete examples help?), we are certainly here to listen. :)

    It does not have to be precise

    This worries me. Implementers don’t like to do things that are intentionally not precise. It creates a technical support nightmare as a flood of “this feature isn’t working right!” bug reports.



  • @Marek-Stankowski

    I’ve been thinking several times about a jump (with mouse click or bookmark) history that can be walked through if needed.

    The “Location Navigate” plugin is a bit like this, and in some cases it has been very useful for me, It would be worth trying it.



  • Thank you. I installed and tried this plugin. Even it looks good (ommiting display mistakes), this is not solution for my described process. It remembers all movements (or near to all depend on config), too much and too hard for manage.
    I assume to use it in other tasks.



  • @Alan-Kilborn
    Let’s try once again…

    1. I’m looking for simply (!) solution – which enhance “goto line function” with history. Maybe you know any plugin, where someone already done it? Or maybe it is as simple and needed by many users to make it in npp app?
    2. „Go to line” I use frequently in debugging process, when can’t predict if and how many times must go to specified place in code. History will help jumping to various places (lines) in code, indicated in debugger.
    3. „Bookmarks” is useful, but not in above process. I use it to mark main places, which I assume to use in the future.
    4. Don’t worry about precision. I wrote about „not necessary precision” only to answer to your note about messing in “goto line history” by line insertion and deletion. In described way of work it is generally not problem for me to hit few lines closer or further.

    I hope, now that is clear for you (?)
    If you do not understand something or find language mistakes, point, please, sentence or word, which make you trouble. Then I’ll try to correct or maybe decide to abandon discussion to not waste your and my time.



  • @Marek-Stankowski

    So still struggling to see the usefulness with the aforementioned insert/delete lines problem, but I could get over that, say for readonly files where that is not possible…

    Now I’m struggling with is, if you see a history list of line numbers, is it really memory jogging what is at which line number, and why you might want to go there?

    Sadly I don’t have your usage need, but I am trying to understand…

    So, getting over all that, I started thinking about how this might work. Suppose you say “show me the history” and then something like this pops up:

    Imgur

    Thus, what was previously added to the history was, in order, line 40, line 3, 60, 22 and 35.

    So say you wanted to go to line 3…you could jump your caret into the text and put a g (for goto) after the 3, like so:

    Imgur

    And then when you press OK, you would be jumped to the start of line 3.

    Is something like that a reasonable way to use this feature? (I’m trying to stay within the parameters of what it is possible to script).

    But really, I’m trying to get it. :)



  • @Alan-Kilborn
    Than you for trying :)
    So, I see it by adding three features (two from Search window) to the GoToLine applet:

    1. When you open GoToLine applet previous wrote value is selected,
    2. When you write line number in GotoLine window previous wrote suitable number from history is suggested (this is new, not necessary, not from Search, but could be adopted in Search window with its benefit),
    3. When you press arrow on the right side of edit bar you get GoToLine history list (it would be good complete numbers with file name in brackets, but only to inform, not to go to other file) with select possibility.

    “Search” applet with selected features to export to GoToLine applet:
    Imgur
    Actual “GoToLine” applet to modify:
    Imgur

    I described “full” version, but simpler may be without p. 2) and file names in p. 3).
    :)



  • @Marek-Stankowski

    You seem to know what you want. Why don’t you write a plugin?



  • @Alan-Kilborn
    Thanks, maybe I’ll try, if I find any time for it.

    Regards.



  • Obviously this requirements come from our browser experience.
    Browser made us used to split interactions into normal (like page down) and jumps (mostly hyperlinks) and it maintains history for jumps that allow us to perform back.

    So the basic analogy is to split Notepad++ caret movements and file switching transitions into normal and jumps and keep history of jumps in order to implement back. We would still argue if GoTo line is normal or jump.

    One major difference is that browsing is read-only. It is easy to go back to a page that does not change. It doesn’t work as well if the jumps history refers to text I just heavily modified. Nevertheless code developers spend so much time browsing lots of code in order to make very few modifications that even less then perfect solution could still be useful.


Log in to reply