Skip to content

Unify vi-mode visual state with lem buffer marks #1817

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

tomaneo
Copy link
Contributor

@tomaneo tomaneo commented May 16, 2025

Modified the visual states in vi mode to use lem buffer mark as starting point and initiator of visual mode regions. To support synchronisation some small additions to core lem implementation was needed, mainly hooks for enabling and disabling the buffer mark.

This allows activating visual mode from any of the "mark-xxx" commands available on emacs mode side, including mouse operations.

Vi states are now buffer specific, not global. This fixes several small glitches and annoyances when switching between windows and buffers

Closes #1590

@tomaneo tomaneo closed this May 18, 2025
@tomaneo tomaneo reopened this May 19, 2025
@tomaneo tomaneo force-pushed the mark-visual branch 3 times, most recently from 7b61ff8 to 47bdcda Compare May 24, 2025 12:17
tomaneo added 2 commits May 30, 2025 22:16
Use buffer mark instead of internal veriable to
handle visual mode start point tracking.

Any core function which sets buffer mark can thus
enable visual mode which means that also selecting
area with mouse is compatible with vi mode.

Make vi states to be buffer specific, not global.
This fixes several minor glitches and annoyances when
switching between windows and buffers
@tomaneo
Copy link
Contributor Author

tomaneo commented May 30, 2025

Rebased to current main

@cadrgtsecond
Copy link

I would also like to see this merged in, since it would help in porting other modal text editing styles, like Kakoune

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.

Feature: sync the mark region between vi-visual-mode and the mark region selected by mouse-clicking.
2 participants