Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Option for cursor beyond EOL (non wrapping cursor) #14297

Open
1 task done
0x7CFE opened this issue Jul 12, 2024 · 3 comments
Open
1 task done

Option for cursor beyond EOL (non wrapping cursor) #14297

0x7CFE opened this issue Jul 12, 2024 · 3 comments
Labels
editor Feedback for code editing, formatting, editor iterations, etc feature [core label] keybinds Keyboard shortcuts, mapping, binding, keymaps, etc mouse Mouse interactions, states, actions, etc

Comments

@0x7CFE
Copy link

0x7CFE commented Jul 12, 2024

Check for existing issues

  • Completed

Describe the feature

I'd like to have an editor option that allows moving the cursor caret beyond the line end in a non-wrapping manner.

This behavior was the standard for early editors like DOS TurboC/Pascal, Delphi/CBuilder and even KDevelop/Katepart, but then KDE ditched that option for no good reason.

Being a programmer for ~30 years I am so used to this behavior that the modern wrapping cursor makes me sick. Please consider an option to bring this behavior back 🙏

If applicable, add mockups / screenshots to help present your vision of the feature

Something like this with the exception that when a newline is inserted, cursor should inherit previous line's indentation:

Kazam_screencast_00007.mp4
@0x7CFE 0x7CFE added admin read feature [core label] labels Jul 12, 2024
@notpeter
Copy link
Member

notpeter commented Jul 12, 2024

Are there other editors that support this and if so what is this mode/setting called?

Brainstorming:

  • Is it just for navigation? If you start typing with a cursor beyond EOL does it jump back to the EOL or does it insert spaces (tabs?) between EOL and your cursor?
  • Column indicator in the status bar: needs to show your current cursor position which is a column outside the backing buffer.
  • ctrl-e or end -- Would this jump you back to the end of the line if you're beyond the EOL?
  • Can you click your cursor anywhere with the mouse too?
  • How do selections work? What happens if you press shift-left while out beyond the EOL. Can you select the empty area?

@notpeter notpeter added mouse Mouse interactions, states, actions, etc editor Feedback for code editing, formatting, editor iterations, etc keybinds Keyboard shortcuts, mapping, binding, keymaps, etc and removed triage labels Jul 12, 2024
@0x7CFE
Copy link
Author

0x7CFE commented Jul 13, 2024

Are there other editors that support this and if so what is this mode/setting called?

Absolutely. This was the default for old-ish editors in DOS. For a long time it was one of the most noticeable difference between a code editor and a text editor. Delphi still does that to this day. It's called "non-wrapping cursor" (at least that how it was called in KDE) or "cursor beyond EOL", "virtual spaces", etc.

Some relevant discussions regarding the issue:

Long time ago (circa KDE 3.3) it was supported in Katepart, so Kate and KDevelop used that too.

Is it just for navigation? If you start typing with a cursor beyond EOL does it jump back to the EOL or does it insert spaces (tabs?) between EOL and your cursor?

IIRC it act as if there are (virtual) spaces in between. You can navigate between actual EOL and virtual one using End key much like this happens with Home and first non-whitespace character.

Can you click your cursor anywhere with the mouse too?

Yes, you can. Check this video where the guy used his mouse to move the cursor beyond EOL.

How do selections work? What happens if you press shift-left while out beyond the EOL. Can you select the empty area?

I believe virtual spaces remain virtual unless user types something, so they would not be selected.

@BrutPitt
Copy link

BrutPitt commented Dec 6, 2024

"Virtual Space" (or "caret/cursor after end of line") finally is about to be implemented also in VS-Code (and only thanks to a great job and independent pull initiative of @x17jiri) after several years of (un-heared) requests to VSCode team:
microsoft/vscode#228680
microsoft/vscode#13960

*About this, there is already a full and perfectly working "unofficial" fork release: x17-Code

Anyway it is also implemented in VisualStudio (not Code) IDE editor (from ever) and in all JetBrains IDE editors (from the beginning), not (yet) in Fleet.
Below the JetBrains option setting:
Screenshot at 2024-12-06 23-52-37

Personally I consider it an essential option.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
editor Feedback for code editing, formatting, editor iterations, etc feature [core label] keybinds Keyboard shortcuts, mapping, binding, keymaps, etc mouse Mouse interactions, states, actions, etc
Projects
None yet
Development

No branches or pull requests

3 participants