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 mappings #28

Merged
merged 1 commit into from
Sep 7, 2020
Merged

Normalize mappings #28

merged 1 commit into from
Sep 7, 2020

Conversation

runiq
Copy link
Contributor

@runiq runiq commented Sep 4, 2020

Modes now use lowercase keys, mappings use the internal representation via nvim_replace_termcodes().

@tjdevries
Copy link
Member

So I thought about this... but doesn't this make it impossible to map J?

(I do need to fix it for the "" vs. "" business though)

@tjdevries
Copy link
Member

I was thinking maybe we should use this: nvim_replace_termcodes({str}, {from_part}, {do_lt}, {special}) ?

@tjdevries
Copy link
Member

since that might change <CR> and <cr> to the same item.

@runiq
Copy link
Contributor Author

runiq commented Sep 4, 2020

Oh that's what that is for! Sure, will do tomorrow. Gotta tuck the young'un in now I'm afraid

@runiq runiq closed this Sep 4, 2020
@runiq runiq reopened this Sep 4, 2020
@runiq runiq marked this pull request as draft September 6, 2020 14:57
Modes now use lowercase keys, mappings use the internal representation
via `nvim_replace_termcodes()`.
@runiq runiq marked this pull request as ready for review September 6, 2020 15:12
@runiq
Copy link
Contributor Author

runiq commented Sep 6, 2020

So the applied_mappings table uses the internal representation now since those are normalized, but telescope_map still gets the original, non-normalized mapping. The reason for this is that nvim_buf_set_keymap() unconditionally appears to run its input through nvim_replace_termcodes(), and running that twice isn't necessarily idempotent (the <up>/<down> mappings break, for example).

@tjdevries tjdevries merged commit 675e240 into nvim-telescope:master Sep 7, 2020
@tjdevries
Copy link
Member

ty ty

This pull request was closed.
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.

2 participants