This repository was archived by the owner on Aug 24, 2020. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +11
-7
lines changed Expand file tree Collapse file tree 2 files changed +11
-7
lines changed Original file line number Diff line number Diff line change @@ -189,9 +189,10 @@ function! s:register_events() abort
189
189
if exists (' ##TextChangedP' )
190
190
autocmd TextChangedP * call s: on_text_document_did_change ()
191
191
endif
192
- autocmd CursorMoved * call s: on_cursor_moved ()
192
+ if g: lsp_diagnostics_echo_cursor || g: lsp_highlight_references_enabled
193
+ autocmd CursorMoved * call s: on_cursor_moved ()
194
+ endif
193
195
autocmd BufWinEnter ,BufWinLeave ,InsertEnter * call lsp#ui#vim#references#clean_references ()
194
- autocmd CursorMoved * if g: lsp_highlight_references_enabled | call lsp#ui#vim#references#highlight (v: false ) | endif
195
196
augroup END
196
197
call s: on_text_document_did_open ()
197
198
endfunction
@@ -239,7 +240,14 @@ endfunction
239
240
function ! s: on_cursor_moved () abort
240
241
let l: buf = bufnr (' %' )
241
242
if getbufvar (l: buf , ' &buftype' ) == # ' terminal' | return | endif
242
- call lsp#ui#vim#diagnostics#echo#cursor_moved ()
243
+
244
+ if g: lsp_diagnostics_echo_cursor
245
+ call lsp#ui#vim#diagnostics#echo#cursor_moved ()
246
+ endif
247
+
248
+ if g: lsp_highlight_references_enabled
249
+ call lsp#ui#vim#references#highlight (v: false )
250
+ endif
243
251
endfunction
244
252
245
253
function ! s: call_did_save (buf , server_name, result, cb ) abort
Original file line number Diff line number Diff line change 1
1
function ! lsp#ui#vim#diagnostics#echo#cursor_moved () abort
2
- if ! g: lsp_diagnostics_echo_cursor
3
- return
4
- endif
5
-
6
2
if mode () isnot # ' n'
7
3
" dont' show echo only in normal mode
8
4
return
You can’t perform that action at this time.
0 commit comments