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

Normalize Keymap Capitalization #599

Merged
merged 2 commits into from
Dec 16, 2024
Merged

Conversation

barrett-ruth
Copy link
Contributor

After debugg my issue here I found out that mapping keymaps with lowercase codes (i.e. <c-space>, not <C-space>) was broken.

The current keymapping logic simply overrides the default preset by overwriting exact matches - in this case, ignoring all my keybindings

(Neo)Vim supports arbitrary capitalization for keymaps (<Up>, <up>), etc. so I figured blink should too.

@Saghen Saghen merged commit 596a7ab into Saghen:main Dec 16, 2024
@Saghen
Copy link
Owner

Saghen commented Dec 16, 2024

Thanks!

@barrett-ruth
Copy link
Contributor Author

ty for the correction :)

@barrett-ruth barrett-ruth deleted the normalize-keymaps branch December 16, 2024 21:18
@milanglacier
Copy link
Contributor

milanglacier commented Dec 16, 2024

Hi,

I think we should not capitalize all the keys arbitrarily.

For example <A-a> and <A-A> are two different keys. <A-A> is actually alt+shift+a.

Besides, if the user binds the key to a two keys sequence, like <c-k>Y, this will be a breaking change.

In fact <C-space> is not a regular terminal supported key binding (but <A-space> is a regular supported keybinding). Some terminals like kitty support it. But we should not assume the users are using a terminal that would support this key. So I am not surprised if we see any unexpected behavior with this key.

Saghen added a commit that referenced this pull request Dec 16, 2024
@Saghen
Copy link
Owner

Saghen commented Dec 16, 2024

@milanglacier Can't believe I didn't think about that, sorry! Fixed on main by comparing the escaped keycodes

@milanglacier
Copy link
Contributor

@milanglacier Can't believe I didn't think about that, sorry! Fixed on main by comparing the escaped keycodes

No problem. We human make mistakes. Thanks for your great effort working on this project!

@barrett-ruth
Copy link
Contributor Author

SMH. Should've considered all possible keycodes. Thanks so much for the correction. In me finding quirky keymappings... I forgot about the even quirkier ones. Thanks @milanglacier and @Saghen !!!!

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.

3 participants