lsp-ui icon indicating copy to clipboard operation
lsp-ui copied to clipboard

Minor fix(?) for `lsp-ui-imenu--visit` and `lsp-ui-imenu--view`

Open emacksnotes opened this issue 6 years ago • 3 comments

In lsp-ui-imenu--visit and lsp-ui-imenu--view, replace

(goto-char marker)

with

(goto-char (overlay-start marker))

Without the above changes I get the following error

funcall-interactively: Wrong type argument: integer-or-marker-p, #<overlay from 16721 to 16752 in xdisp.c>

emacksnotes avatar Apr 21 '19 06:04 emacksnotes

@emacksnotes Agree, I got the same problem, your code line fixes it.

It's over a year, maybe post a PR?

UPDATE: I was wrong, the fix-code works only for some simple file such as a source not managed by ccls/lsp, for projects(compile_commands.json), it doesn't work.

Without the fix, In lsp-ui-imenu--visit and lsp-ui-imenu--view works without problem.

c02y avatar Sep 11 '20 08:09 c02y

@emacksnotes @c02y Feel free to open a PR! There will be people reviewing it! 😄

jcs090218 avatar Sep 11 '20 09:09 jcs090218

@jcs090218 I added an update, this fix will break those two functions.

But for a simple source file, lsp-ui-imenu--visit and lsp-ui-imenu--view functions should work too. It still needs update, just not simple (goto-char (overlay-start marker))

c02y avatar Sep 11 '20 09:09 c02y