[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/elpa 22aa27c 01/71: Close #397: Simplify a bit of code
From: |
João Távora |
Subject: |
[elpa] externals/elpa 22aa27c 01/71: Close #397: Simplify a bit of code |
Date: |
Wed, 16 Dec 2020 11:42:12 -0500 (EST) |
branch: externals/elpa
commit 22aa27cd08ee7b671a0ee45af15a0865c08f4116
Author: theothornhill <theodorthornhill@icloud.com>
Commit: João Távora <joaotavora@gmail.com>
Close #397: Simplify a bit of code
Co-authored-by: João Távora <joaotavora@gmail.com>
* eglot.el (eglot-move-to-lsp-abiding-column): use
already existing function to refer to lsp-abiding-column
---
eglot.el | 11 +++++------
1 file changed, 5 insertions(+), 6 deletions(-)
diff --git a/eglot.el b/eglot.el
index eafe22e..58980a1 100644
--- a/eglot.el
+++ b/eglot.el
@@ -1012,9 +1012,10 @@ fully LSP-compliant servers, this should be set to
`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."
- (/ (- (length (encode-coding-region (line-beginning-position)
+(defun eglot-lsp-abiding-column (&optional lbp)
+ "Calculate current COLUMN as defined by the LSP spec.
+LBP defaults to `line-beginning-position'."
+ (/ (- (length (encode-coding-region (or lbp (line-beginning-position))
(point) 'utf-16 t))
2)
2))
@@ -1057,9 +1058,7 @@ be set to `eglot-move-to-lsp-abiding-column' (the
default), and
(narrow-to-region lbp (line-end-position))
(move-to-column column)
for diff = (- column
- (/ (- (length (encode-coding-region lbp (point) 'utf-16 t))
- 2)
- 2))
+ (eglot-lsp-abiding-column lbp))
until (zerop diff)
do (condition-case eob-err
(forward-char (/ (if (> diff 0) (1+ diff) (1- diff)) 2))
- [elpa] branch externals/elpa created (now 4edd478), João Távora, 2020/12/16
- [elpa] externals/elpa 8b94cf4 02/71: Per #397: Add new eglot-lsp-abiding-column test, João Távora, 2020/12/16
- [elpa] externals/elpa 1056ef5 03/71: Close #413: update dependencies and copyright years, João Távora, 2020/12/16
- [elpa] externals/elpa d99a447 12/71: Close #439: Hide eldoc-message on empty hover info, João Távora, 2020/12/16
- [elpa] externals/elpa af32ebf 06/71: Close #444: use text-mode for plaintext markup, João Távora, 2020/12/16
- [elpa] externals/elpa ef6c483 13/71: Fix #452: also check types when destructuring LSP objects, João Távora, 2020/12/16
- [elpa] externals/elpa 487cde5 18/71: Close #443: kind of honour eldoc-echo-area-use-multiline-p, João Távora, 2020/12/16
- [elpa] externals/elpa 22aa27c 01/71: Close #397: Simplify a bit of code,
João Távora <=
- [elpa] externals/elpa 8900a35 04/71: Prevent "Cant guess python-indent-offset..." messages in tests, João Távora, 2020/12/16
- [elpa] externals/elpa dd48f4a 08/71: * eglot.el (eglot-put-doc-in-help-buffer): Tiny docstring fix., João Távora, 2020/12/16
- [elpa] externals/elpa e5cf30e 09/71: Close #435: create match xrefs when possible, João Távora, 2020/12/16
- [elpa] externals/elpa ad3f049 24/71: Close #417: minimally document relation with project.el, João Távora, 2020/12/16
- [elpa] externals/elpa 2f75da2 28/71: Fix #460: fix "free variable" warning, João Távora, 2020/12/16
- [elpa] externals/elpa 0f57efb 26/71: Simplify bug-reporting instructions, João Távora, 2020/12/16
- [elpa] externals/elpa 91a7cba 33/71: Fix #474, #478: prompt for executable if supplied name does not exist, João Távora, 2020/12/16
- [elpa] externals/elpa 9efe207 05/71: Make curl invocation fail more explicitly in .travis.yml, João Távora, 2020/12/16
- [elpa] externals/elpa 73bc752 11/71: Close #441: shield tests from some user customizations, João Távora, 2020/12/16
- [elpa] externals/elpa b6519a5 16/71: Per #446: Add tests for eglot-server-programs, João Távora, 2020/12/16