Keep line with cursor vertically centered

Started by S.H.Bouwhuis, April 19, 2017, 11:29:54 PM

Previous topic - Next topic

S.H.Bouwhuis

Is it already possible, or could it be added that you can set when the text scrolls up or down depending on the position of the cursor? Currently the text scrolls only when your cursor is at the top or bottom line.
So, let's say I set it to 10 lines, then whenever I get closer than 10 lines from the top or bottom, the text would scroll.

I specifically would like to set the option to a high value, so that the line with the cursor in it will stay in the center of the window.

Also, for programming I like a 2 to 1 split. So, the line with the cursor is always at 2/3 of the screen. (I can look ahead 1/3 screen, and look back 2/3 screen).

PS
If possible, also in HEX mode.

alex

Hi Sander,

you can configure cursor offsets to window edges using following XML flags:
http://wiki.hippoedit.com/options/xml/view-offset
but only in absolute numbers (in lines). You can not set it to the percentage of the screen lines.

It is not possible yet in Hex mode, but I will note it and would have in the first version. Probably reusing offsets from the text editor.

BR, Alex.
HippoEDIT team
[url="http://www.hippoedit.com/"]http://www.hippoedit.com/[/url]

S.H.Bouwhuis

#2
Aha, that's great!

Are the offsets uint8? Or bigger?
For safety I've set them like this:

<Source_Editor>
  <TopYOffset>255</TopYOffset>
  <BottomYOffset>255</BottomYOffset>
  <LeftXOffset>10</LeftXOffset>
  <RightXOffset>10</RightXOffset>
<Source_Editor>


Edit 1:
Hmmm... I must be doing something wrong, because strange things are happening.
Aren't you checking the bounds? My cursor goes off screen.

Edit 2:
Yes, it seems you're not checking the bounds. When the TopYOffset en BottomYOffset overlap you have to do the smart thing and center the cursor. Now you seem to let TopYOffset take precedence when scrolling down.

alex

Hi Sander,

HE is a software for professionals - ones who will respect the screen line count :)
The offset is in lines, not in pixels ;) I doubt that you have 500 lines visible on the screen.

But, yes you are right. Bounds should be checked. I will fix it in next build.
From another side, as you suggest, this is a way to detect mode to use normalization of the offsets, in case of screen size overflow - this will allow coming to proportional split of the cursor position: so, if you set Top 1000 and bottom to 500 it would mean the cursor will be always on 2/3 of the screen and it will scroll up or down as you go up/down one line.

As temporary workaround use lower numbers ;)

BR, Alex.
HippoEDIT team
[url="http://www.hippoedit.com/"]http://www.hippoedit.com/[/url]

S.H.Bouwhuis

Ha ha ha, being a software engineer myself I understand what you are saying.
I just want to help improve HippoEdit to become one of the best editors out there. Good for you, and good for the users.