Skip to content

fix(mappings): Default offset encoding when handling <CR> press #201

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

Merged
merged 1 commit into from
Jan 14, 2022
Merged

fix(mappings): Default offset encoding when handling <CR> press #201

merged 1 commit into from
Jan 14, 2022

Conversation

levouh
Copy link
Contributor

@levouh levouh commented Jan 13, 2022

Per here there are a number of functions that now require specifying an offset_encoding. Some examples of other updates to things like nvim-cmp and null-ls.

Looking at all of those functions, this is the only one that I found that gets used in this plugin. As we do not have any attached clients, I do not see this being a huge issue (although I am also pretty naive in terms of the usage and impact) to follow the "norm" and use utf-16 as a default.

@levouh
Copy link
Contributor Author

levouh commented Jan 13, 2022

Moving to a draft to research & experiment a bit more.

@levouh levouh marked this pull request as draft January 13, 2022 16:09
@kristijanhusak
Copy link
Member

LGTM. I'm a bit confused why utf-16 instead of utf-8, but since Michael suggested it, I guess that's the right path.

@levouh levouh mentioned this pull request Jan 14, 2022
@levouh levouh marked this pull request as ready for review January 14, 2022 05:16
@kristijanhusak kristijanhusak merged commit 1acead1 into nvim-orgmode:master Jan 14, 2022
@kristijanhusak
Copy link
Member

Thanks!

@mjlbach
Copy link

mjlbach commented Jan 17, 2022

I think the correct fix for you all is using utf-8, utf-16 is only correct if you are applying text edits from a language server. utf-8 assumes the position is encoded with raw bytes, utf-16 assumes code points are encoded with one or two 16-bit code units. This function is very overfit to the protocol.

gzagatti pushed a commit to gzagatti/orgmode that referenced this pull request Oct 19, 2022
SlayerOfTheBad pushed a commit to SlayerOfTheBad/orgmode that referenced this pull request Aug 16, 2024
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