Skip to content

core_editor: model the cursor as a range#1095

Open
kronberger-droid wants to merge 1 commit into
nushell:mainfrom
kronberger-droid:selection-primitives
Open

core_editor: model the cursor as a range#1095
kronberger-droid wants to merge 1 commit into
nushell:mainfrom
kronberger-droid:selection-primitives

Conversation

@kronberger-droid
Copy link
Copy Markdown
Collaborator

Promote the helix range type to a crate-internal Cursor (anchor + head, gap-indexed) in core_editor, move selection_anchor from Editor into LineBuffer, and route get_selection/select_all through it. Behavior unchanged.

Promote the helix range type to a crate-internal `Cursor` (anchor + head,
gap-indexed) in core_editor, move `selection_anchor` from `Editor` into
`LineBuffer`, and route `get_selection`/`select_all` through it. Behavior
unchanged.
@kronberger-droid
Copy link
Copy Markdown
Collaborator Author

@sim590 @matystroia
Hey all,
as we saw in the discussions we had about your fixes in Vi mode: it is really hard and hacky to implement some of your fixes in our current architecture.
Your PRs address all real problems and are very helpful by themselves, but I think we could make them easier to implement.
That's why I am working on better primitives and abstractions in the editor.

Since you are aware of the limitations and know the current behavior of Vi mode best, it would be amazing for you to follow my PRs coming in and check if they preserve behavior, or fix issues, depending on whats told in the PR body.

I myself cant even wrap my head around simple Vi movements sometimes, since I never worked with it, so you would be a great help.

This one is essentially a refactor and should preserve behavior (also the flaws we already have in Vi mode).

Thanks in advance!

@kronberger-droid kronberger-droid marked this pull request as ready for review June 4, 2026 20:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant