[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/eglot cacfd24 53/54: Fix #361: abide by LSP when report
From: |
João Távora |
Subject: |
[elpa] externals/eglot cacfd24 53/54: Fix #361: abide by LSP when reporting and moving to columns |
Date: |
Thu, 16 Apr 2020 05:31:54 -0400 (EDT) |
branch: externals/eglot
commit cacfd2410872d1b3895e8fef5a8068937f1f857d
Author: Felicián Németh <address@hidden>
Commit: João Távora <address@hidden>
Fix #361: abide by LSP when reporting and moving to columns
* eglot.el (eglot-current-column-function): Set to
eglot-lsp-abiding-column.
(eglot-move-to-column-function): Set to
eglot-move-to-lsp-abiding-column.
* NEWS.md: Log the change here as well.
Co-authored-by: João Távora <address@hidden>
---
NEWS.md | 9 +++++++++
eglot.el | 12 ++++++------
2 files changed, 15 insertions(+), 6 deletions(-)
diff --git a/NEWS.md b/NEWS.md
index 0b4cb9e..ef6b5f3 100644
--- a/NEWS.md
+++ b/NEWS.md
@@ -1,5 +1,13 @@
# 1.6 (upcoming)
+##### Column offset calculation is now LSP-conform ([#361][github#361])
+
+It seems the majority of servers now comply with the language server
+specification when it comes to handling non-ASCII texts. Therefore
+the default values of `eglot-move-to-column-function` and
+`eglot-current-column-function` have been changed. The documentations
+of these variables help to restore the old behavior.
+
##### Support workspace/configuration requests ([#326][github#326])
Also a new section "Per-project server configuration" in the README.md
@@ -205,3 +213,4 @@ and now said bunch of references-->
[github#316]: https://github.com/joaotavora/eglot/issues/316
[github#324]: https://github.com/joaotavora/eglot/issues/324
[github#326]: https://github.com/joaotavora/eglot/issues/326
+[github#361]: https://github.com/joaotavora/eglot/issues/361
diff --git a/eglot.el b/eglot.el
index 2a50611..5d363ed 100644
--- a/eglot.el
+++ b/eglot.el
@@ -1002,15 +1002,15 @@ CONNECT-ARGS are passed as additional arguments to
(defun eglot-current-column () (- (point) (point-at-bol)))
-(defvar eglot-current-column-function #'eglot-current-column
+(defvar eglot-current-column-function #'eglot-lsp-abiding-column
"Function to calculate the current column.
This is the inverse operation of
`eglot-move-to-column-function' (which see). It is a function of
no arguments returning a column number. For buffers managed by
fully LSP-compliant servers, this should be set to
-`eglot-lsp-abiding-column', and `eglot-current-column' (the default)
-for all others.")
+`eglot-lsp-abiding-column' (the default), and
+`eglot-current-column' for all others.")
(defun eglot-lsp-abiding-column ()
"Calculate current COLUMN as defined by the LSP spec."
@@ -1026,7 +1026,7 @@ for all others.")
:character (progn (when pos (goto-char pos))
(funcall eglot-current-column-function)))))
-(defvar eglot-move-to-column-function #'eglot-move-to-column
+(defvar eglot-move-to-column-function #'eglot-move-to-lsp-abiding-column
"Function to move to a column reported by the LSP server.
According to the standard, LSP column/character offsets are based
@@ -1036,8 +1036,8 @@ where X is a multi-byte character, it actually means `b',
not
`c'. However, many servers don't follow the spec this closely.
For buffers managed by fully LSP-compliant servers, this should
-be set to `eglot-move-to-lsp-abiding-column', and
-`eglot-move-to-column' (the default) for all others.")
+be set to `eglot-move-to-lsp-abiding-column' (the default), and
+`eglot-move-to-column' for all others.")
(defun eglot-move-to-column (column)
"Move to COLUMN without closely following the LSP spec."
- [elpa] externals/eglot 864a493 50/54: Close #323: add a simple github issue template, (continued)
- [elpa] externals/eglot 864a493 50/54: Close #323: add a simple github issue template, João Távora, 2020/04/16
- [elpa] externals/eglot 4496657 34/54: Close #393: use completing-read in eglot-code-actions, João Távora, 2020/04/16
- [elpa] externals/eglot 9c52f24 36/54: Fix #277: Send exit as a notification, João Távora, 2020/04/16
- [elpa] externals/eglot 9f10a27 42/54: Explain the animations in the README, João Távora, 2020/04/16
- [elpa] externals/eglot e02479a 54/54: * eglot.el (Version): Bump to 1.6, João Távora, 2020/04/16
- [elpa] externals/eglot 212a7f7 43/54: Per #315: call shutdown/exit methods with params:{}, not null, João Távora, 2020/04/16
- [elpa] externals/eglot 8d8c90d 45/54: Fix #182: add public hook eglot-managed-mode-hook, João Távora, 2020/04/16
- [elpa] externals/eglot 16dd4b8 47/54: Close #414: mention eglot-find-* in README, João Távora, 2020/04/16
- [elpa] externals/eglot 2209779 49/54: Fix #425: Ignore empty hover info, João Távora, 2020/04/16
- [elpa] externals/eglot 606e234 48/54: Close #415: mention soft dependencies in README, João Távora, 2020/04/16
- [elpa] externals/eglot cacfd24 53/54: Fix #361: abide by LSP when reporting and moving to columns,
João Távora <=