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

When Remapping Delete Operator, Pressing the New Mapping Twice Deletes 2 Lines #1183

Closed
VehementHam opened this issue Apr 26, 2024 · 2 comments

Comments

@VehementHam
Copy link

VehementHam commented Apr 26, 2024

Problem

After remapping the delete operator (i.e. to k), when pressing the newly mapped key twice, it deletes 2 lines. The action should only delete one line. Pressing the default delete operator d twice only deletes one line, of course when the binding for d has not been changed.

Steps to reproduce

Use this config:

-- ...

vis.events.subscribe(vis.events.INIT, function()
	-- Your global configuration options
	-- key mappings
	vis:map(vis.modes.NORMAL, "d", "<Left>")
	vis:map(vis.modes.NORMAL, "h", "<Down>")
	vis:map(vis.modes.NORMAL, "t", "<Up>")
	vis:map(vis.modes.NORMAL, "n", "<Right>")
	vis:map(vis.modes.NORMAL, "l", "<vis-motion-search-repeat>")
	vis:map(vis.modes.NORMAL, "L", "<vis-motion-search-repeat-backward>")
	vis:map(vis.modes.NORMAL, "k", "<vis-operator-delete>")
end)

vis.events.subscribe(vis.events.WIN_OPEN, function(win) -- luacheck: no unused args
	-- Your per window configuration options e.g.
	vis:command('set theme base16-tomorrow-night')
	vis:command('set number')
	vis:command('set cursorline')
end)

-- ...

vis version (vis -v)

vis 0.8 +curses +lua +acl

Terminal name/version

foot version: 1.17.2 +pgo +ime +graphemes -assertions

$TERM environment variable

xterm-256color

@VehementHam
Copy link
Author

VehementHam commented Apr 26, 2024

My theory is that when k is pressed twice, it acts as up on press 2. Basically k was never remapped for delete mode.

@VehementHam
Copy link
Author

VehementHam commented Apr 26, 2024

I see the issue. I never remaped for OPERATOR-PENDING.

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

No branches or pull requests

1 participant