]> git.eshelyaron.com Git - emacs.git/commit
Robustify previous fix of onchange breakage
authorJoão Távora <joaotavora@gmail.com>
Tue, 15 Dec 2020 12:24:13 +0000 (12:24 +0000)
committerJoão Távora <joaotavora@gmail.com>
Tue, 15 Dec 2020 12:35:00 +0000 (12:35 +0000)
commit73b1707c411b57f217b21da9ac68cf063b4e963e
treeca9132acfbbd88bd0730b3754a13e65c3070fce3
parente609841f6f987698e41e362b397c0130fa4103e5
Robustify previous fix of onchange breakage

From the in-code comments:

;; githubhttps://github.com/joaotavora/eglot/issues/259 and githubhttps://github.com/joaotavora/eglot/issues/367: With `capitalize-word' or somesuch,
;; `before-change-functions' always records the whole word's `b-beg'
;; and `b-end'.  Similarly, when coalescing two lines into one,
;; `fill-paragraph' they mark the end of the first line up to the end
;; of the second line.  In both situations, args received here
;; contradict that information: `beg' and `end' will differ by 1 and
;; will likely only encompass the letter that was capitalized or, in
;; the sentence-joining situation, the replacement of the newline with
;; a space.  That's we keep markers _and_ positions so we're able to
;; detect and correct this.  We ignore `beg', `len' and
;; `pre-change-len' and send "fuller" information about the region
;; from the markers.  I've also experimented with doing this
;; unconditionally but it seems to break when newlines are added.

* eglot.el (eglot--after-change): Robustify fix.

GitHub-reference: fix https://github.com/joaotavora/eglot/issues/367
lisp/progmodes/eglot.el