Feature request: GOTO middle



  • A staple feature of any text editor is the CTRL+G (goto line number) command. NPP performs this simple function adequately, but it could be better. In NPP, if you GOTO a line number that is above your current spot, the line number you want is positioned at the VERY TOP of the viewable window. Conversely if you GOTO a line number that is below your current spot, the line number is positioned at the VERY BOTTOM of the viewable window. Neither of these are optimal. The way that other text editors do this (and a very nice way indeed) is to position the GOTO line in the CENTER of the screen. I do most my coding in roughly the center of the screen, not top or bottom, so it would be very nice for goto to take me to the line number positioned at the center of my screen.

    How 'bout it?



  • Some editors have a feature where the cursor is always kept in the middle few lines of the screen. The editor always tries to keep a (customisable) number of lines above and below the cursor in view.

    That worked nicely on old non-windowed screens. Perhaps the windowed equivalent would have a dynamic value based on the number of lines on display. For Notepad++ it would be nice to be able to specify that the cursor should always be in the middle (customisable) 50% of the number of lines in the window, except when cursor is at the top or bottom of the file.

    An editor I used once always tried to keep the cursor in the middle line of the display. That was annoying because the displayed text was always moving up or down as the UP and DOWN keys were pressed. So I am not keen on forcing the line to the middle of the screen.

    Being able to keep the cursor out of the top and bottom few lines of the window would, I believe, satisfy your goal Nate and it would be a useful addition to Notepad++.



  • Just to clarify, I am not proposing that the cursor always be kept in the middle of the screen, dynamically moving the window contents up and down so the cursor stays in the middle. I would actually hate that and it would drive me crazy. What I am proposing is merely that after a GOTO line is entered, go to that line, and put the line in the vertical center of the screen. After that you can move the cursor up and down like normal and nothing needs to try to center itself again. This is precisely how Microsoft Visual Studio handles a GOTO, and it’s quite nice.



  • How about if that applied to FIND as well, ie the resulting location is placed mid screen?


Log in to reply