vlime / vlime

A Common Lisp dev environment for Vim (and Neovim)
MIT License
441 stars 32 forks source link

Weird highlight behavior inside the REPL buffer #74

Closed iamFIREcracker closed 1 year ago

iamFIREcracker commented 1 year ago

I am not exactly sure what's going on, but with hlsearch toggled on, Vim will highlight matches in the REPL only when found in the output of an evaluation, but not in its return value. Let me show you with an example.

Create a scratch, buffer with the following content:

(defun echo-n-ret (x)
  (format t "~A~&" x)
  x)

Load it, and then evaluate (echo-n-ret); finally, search for 123.

This is how my REPL buffer is going to look like after all these steps (I added extra *s around the parts of the buffer that Vim had highlighted because of the search operation):

SWANK version 2.27, pid 33773, remote 127.0.0.1:7002
====================================================
--
ECHO-N-RET
--
*123*
123

For whatever reason, Vim is finding a match only in the output of the evaluation but not in its return value; if the ASCII art above was not clear enough, here is a screenshot of my session.

Screenshot 2022-12-06 at 6 56 47 PM

Does anyone have any idea of what could be going on here? I genuinely have no clue how to further debug this.

phmarek commented 1 year ago

That's matchaddpos, which takes precedence.

See vlime#ui#repl#InspectCurREPLPresentation which calls vlime#ui#MatchAddCoords further along.