Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix #124: add ability to move to LSP-precise columns
Also close #125. Idea and much of design contributed by Michał Krzywkowski <k.michal@zoho.com> This introduces the variable eglot-move-to-column-function. According to the standard, LSP column/character offsets are based on a count of UTF-16 code units, not actual visual columns. So when LSP says position 3 of a line containing just \"aXbc\", where X is a multi-byte character, it actually means `b', not `c'. This is what the function `eglot-move-to-lsp-abiding-column' does. However, many servers don't follow the spec this closely, and thus this variable should be set to `move-to-column' in buffers managed by those servers. * eglot.el (eglot-move-to-column-function): New variable. (eglot-move-to-lsp-abiding-column): New function. (eglot--lsp-position-to-point): Use eglot-move-to-column-function. #124: joaotavora/eglot#124 #125: joaotavora/eglot#125
- Loading branch information