Recent

Author Topic: Who uses "caret past EOL"?  (Read 3264 times)

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 9792
  • Debugger - SynEdit - and more
    • wiki
Who uses "caret past EOL"?
« on: June 02, 2023, 02:55:58 pm »
If you do, do you use it within the range of the "longest line" only?

That is, currently caret-past-eol additionally allows you to scroll up to over 1000 columns, even if you don't have any line that long. Do you use that scroll range?

eljo

  • Sr. Member
  • ****
  • Posts: 468
Re: Who uses "caret past EOL"?
« Reply #1 on: June 02, 2023, 03:02:22 pm »
No, usually the width of my screen is enough add an error margin of lets say 100 columns and you are safe with me.

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 9792
  • Debugger - SynEdit - and more
    • wiki
Re: Who uses "caret past EOL"?
« Reply #2 on: June 02, 2023, 03:26:39 pm »
No, usually the width of my screen is enough add an error margin of lets say 100 columns and you are safe with me.
In future, the "cursor right" key will not be restricted anymore (like in other editors / notepad++ with "virtual space"). The scroll bar will extend, if the key is hold or repeatedly pressed.

But, if you want to use the mouse to place the caret (and maybe the scroll vertically on the scrollbar or with an tilt-able wheel) then you need some already available scroll range.
- You may want to stay within the range of the longest line, eg all other text will be placed below/above the content of the longest line
- You may just want to scroll "a bit" beyond that (100 chars is probably the amount that fits into the visible part of your editor?)
- You may want to go really far?


Git main branch already has options to chose from...

eljo

  • Sr. Member
  • ****
  • Posts: 468
Re: Who uses "caret past EOL"?
« Reply #3 on: June 02, 2023, 04:30:25 pm »
No, usually the width of my screen is enough add an error margin of lets say 100 columns and you are safe with me.
In future, the "cursor right" key will not be restricted anymore (like in other editors / notepad++ with "virtual space"). The scroll bar will extend, if the key is hold or repeatedly pressed.

But, if you want to use the mouse to place the caret (and maybe the scroll vertically on the scrollbar or with an tilt-able wheel) then you need some already available scroll range.
- You may want to stay within the range of the longest line, eg all other text will be placed below/above the content of the longest line
- You may just want to scroll "a bit" beyond that (100 chars is probably the amount that fits into the visible part of your editor?)
- You may want to go really far?


Git main branch already has options to chose from...
the visible part of my window is around 184 chars, or at least that's what the editor reports when I place the cursor there, and I have the visible right margin set to 120 chars.
I do not need to mouse click on anything really farthest than 180 to 200 chars as my code is wrapped on the 120 chars limit and only the comments at the end of the line occupy space beyond that but I find my self clicking on the extremes to add those comments instead of moving around with the arrow keys most of the time.

440bx

  • Hero Member
  • *****
  • Posts: 3944
Re: Who uses "caret past EOL"?
« Reply #4 on: June 02, 2023, 05:32:56 pm »
I very commonly use the caret past EOL. 

That said it is rare that I need to put the caret on column 1000 or even past 512. 

To me personally, what is truly important is being able to scroll vertically from the current caret column position and have the caret _remain_ in that column regardless of where the line ends.

I find editors like notepad where the cursor jumps from one end of line to another to be utterly useless and extremely aggravating to boot.
(FPC v3.0.4 and Lazarus 1.8.2) or (FPC v3.2.2 and Lazarus v3.2) on Windows 7 SP1 64bit.

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 9792
  • Debugger - SynEdit - and more
    • wiki
Re: Who uses "caret past EOL"?
« Reply #5 on: June 02, 2023, 05:57:23 pm »
To me personally, what is truly important is being able to scroll vertically from the current caret column position and have the caret _remain_ in that column regardless of where the line ends.
That will - in any case - remain a given for "caret past eol".

The existing mode remains (either as default or option) with one minor change: 1024 wont be a hard cut off anymore.

1) In addition to what currently exists, if the cursor key is used to go right, it will not stop anymore at 1024 but got on.
However (in 1024 mode)
- the scrollbar will by default only cover 1024 (or the longest line, whichever is greater).
- only if the caret is actually moved further out, then will the scrollbar increase its range (in the same way as it  would if you typed at the end of the longest line > 1024)

2) There will be an option (or new default) that the extra range of the scrollbar will be less than 1024 (longest line + one page). But the caret will still be able to move out, and increase the scrollbar.
2a) Option to have no added scrollbar, until the caret moves out (yet the scrollbar covers the longest line)


You can already try all that with the main branch.

Question is about what is the best default. => I.e. how many people would be annoyed if (in order to get/keep 1024) the need to change an option after upgrading to 2.4.


https://gitlab.com/freepascal.org/lazarus/lazarus/-/issues/40282

440bx

  • Hero Member
  • *****
  • Posts: 3944
Re: Who uses "caret past EOL"?
« Reply #6 on: June 02, 2023, 06:30:11 pm »
Now, after checking the github link, I understand the problem.

1) In addition to what currently exists, if the cursor key is used to go right, it will not stop anymore at 1024 but got on.
However (in 1024 mode)
- the scrollbar will by default only cover 1024 (or the longest line, whichever is greater).
- only if the caret is actually moved further out, then will the scrollbar increase its range (in the same way as it  would if you typed at the end of the longest line > 1024)
I like this solution.  I think it's very intuitive and easy to understand.
(FPC v3.0.4 and Lazarus 1.8.2) or (FPC v3.2.2 and Lazarus v3.2) on Windows 7 SP1 64bit.

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 9792
  • Debugger - SynEdit - and more
    • wiki
Re: Who uses "caret past EOL"?
« Reply #7 on: June 02, 2023, 06:34:39 pm »
Now, after checking the github link, I understand the problem.

1) In addition to what currently exists, if the cursor key is used to go right, it will not stop anymore at 1024 but got on.
However (in 1024 mode)
- the scrollbar will by default only cover 1024 (or the longest line, whichever is greater).
- only if the caret is actually moved further out, then will the scrollbar increase its range (in the same way as it  would if you typed at the end of the longest line > 1024)
I like this solution.  I think it's very intuitive and easy to understand.

But the question is, should the default scrollbar be
- Max(1024, LongestLine)
- LongestLine + WindowWidthInChars

(either default includes: extendable by cursor-right)

Do you often need to use the mouse to place the caret into the 1024 space (further than the one-page would allow).

440bx

  • Hero Member
  • *****
  • Posts: 3944
Re: Who uses "caret past EOL"?
« Reply #8 on: June 02, 2023, 07:03:26 pm »
But the question is, should the default scrollbar be
- Max(1024, LongestLine)
- LongestLine + WindowWidthInChars

(either default includes: extendable by cursor-right)

Do you often need to use the mouse to place the caret into the 1024 space (further than the one-page would allow).
I'd go for Max(1024, LongestLine) just because it's simpler and less likely to require updating (it is rare - at least for me - to need more than 1024 columns.)

As far as using the mouse, it is quite rare for me to use the mouse when editing and cannot think of a case where I would use it to put the caret past some column.  Personally, to navigate code I find the cursor keys along with page up/down and home/end to be much more efficient than the mouse.

On a related but somewhat different note, something I think would be "nice to have" is an indication of how long the longest line is, e.g, 23/96 where 23 is the current column number  where the caret is (already displayed along with the line number) followed by 96 (presuming the longest line in that file is 96 characters long.)  Since this feature would require scanning the entire file, which could occasionally be slow, it might be appropriate to have it menu-selectable per file.  It might be nice too to have the line extent used for the current horizontal scroll range, e.g, 23/96/1024 where 23 and 96 are as previously mentioned and 1024 (or whatever applies) is the number of characters used to set the horizontal scrollbar extent. When the longest line is greater than 1024 then it would show something along the lines of 23/1510/1560 where 1560 would be a horizontal extent chosen to be slightly wider than the widest line (50 characters in this example.)
(FPC v3.0.4 and Lazarus 1.8.2) or (FPC v3.2.2 and Lazarus v3.2) on Windows 7 SP1 64bit.

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 9792
  • Debugger - SynEdit - and more
    • wiki
Re: Who uses "caret past EOL"?
« Reply #9 on: June 02, 2023, 07:28:12 pm »
If you don't use the mouse, you don't need the 1024. Since - in future - the keyboard can move the caret to MaxInt.

The longest line is in any case already looked up. Since the scrollbar depends on it.
And if - in future - you use "longest line + page" for the scrollbar (or even without the "plus page") then the scrollbar gives you an indication of the longest line.



But if you insisted on 1024, would it be an issue, if you had to make a config change in 2.4? (just once)



The 1024, you only need, if you scroll horizontally without moving the caret. => That is usually by mouse. Not sure it may be it can be mapped to keyboard, in which case the limit applies to that to (but only if caret does not move)
« Last Edit: June 02, 2023, 07:30:37 pm by Martin_fr »

440bx

  • Hero Member
  • *****
  • Posts: 3944
Re: Who uses "caret past EOL"?
« Reply #10 on: June 02, 2023, 07:58:58 pm »
But if you insisted on 1024, would it be an issue, if you had to make a config change in 2.4? (just once)
No, it wouldn't be. Just for the record, I don't insist on 1024.  From what you stated, I am under the impression that the editor already determines the longest line and, if that is the case then the horizontal extent can simply be based on that and nothing else.

The 1024, you only need, if you scroll horizontally without moving the caret. => That is usually by mouse. Not sure it may be it can be mapped to keyboard, in which case the limit applies to that to (but only if caret does not move)
It's not really mapped to the keyboard but the extent and horizontal page size determine the size of the tracking thumb which is _visually_ useful when using either the keyboard or the mouse.  The size of the tracking thumb is what I was thinking about when going along with 1024 but, if Lazarus already knows the longest line in all cases then it could use a extent value derived from it instead., e.g, MaxLineWidth + SomeMargin.
(FPC v3.0.4 and Lazarus 1.8.2) or (FPC v3.2.2 and Lazarus v3.2) on Windows 7 SP1 64bit.

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 9792
  • Debugger - SynEdit - and more
    • wiki
Re: Who uses "caret past EOL"?
« Reply #11 on: June 02, 2023, 08:16:40 pm »
if Lazarus already knows the longest line in all cases then it could use a extent value derived from it instead., e.g, MaxLineWidth + SomeMargin.
That is the idea.

I do think that no one will miss the old behaviour, or the number of those will be so low they can be ask to adjust their config. But I have made changes in the past, with that exact same presumption, only to stand corrected. Hence I posted.

440bx

  • Hero Member
  • *****
  • Posts: 3944
Re: Who uses "caret past EOL"?
« Reply #12 on: June 02, 2023, 08:44:20 pm »
That is the idea.

I do think that no one will miss the old behaviour, or the number of those will be so low they can be ask to adjust their config. But I have made changes in the past, with that exact same presumption, only to stand corrected. Hence I posted.
I think it is a perfectly reasonable idea that works well.  OTOH, so far only two users have given you feedback, hopefully more will follow.
(FPC v3.0.4 and Lazarus 1.8.2) or (FPC v3.2.2 and Lazarus v3.2) on Windows 7 SP1 64bit.

Bart

  • Hero Member
  • *****
  • Posts: 5275
    • Bart en Mariska's Webstek
Re: Who uses "caret past EOL"?
« Reply #13 on: June 02, 2023, 10:26:04 pm »
If you do, do you use it within the range of the "longest line" only?

That is, currently caret-past-eol additionally allows you to scroll up to over 1000 columns, even if you don't have any line that long. Do you use that scroll range?

I do use this option.
And I don't really care the horizontal scrollbar allows me to scroll 1000 columns.
It never bothered me.

Bart

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 9792
  • Debugger - SynEdit - and more
    • wiki
Re: Who uses "caret past EOL"?
« Reply #14 on: June 02, 2023, 11:07:13 pm »
If you do, do you use it within the range of the "longest line" only?

That is, currently caret-past-eol additionally allows you to scroll up to over 1000 columns, even if you don't have any line that long. Do you use that scroll range?

I do use this option.
And I don't really care the horizontal scrollbar allows me to scroll 1000 columns.
It never bothered me.

Bart

Question is the other way round, would it bother you if the default was for it to only be around 100 extra? (with the option to switch back to the large one)

 

TinyPortal © 2005-2018