mirror of
https://github.com/tpope/vim-surround.git
synced 2025-11-09 03:43:51 -05:00
Avoid "\r" as a cursor stand-in
This confuses Neovim's LSP. I'd be surprised if there are LSPs it *doesn't* confuse. References: https://github.com/neovim/neovim/issues/15532
This commit is contained in:
@@ -323,7 +323,7 @@ function! s:insert(...) " {{{1
|
|||||||
let cb_save = &clipboard
|
let cb_save = &clipboard
|
||||||
set clipboard-=unnamed clipboard-=unnamedplus
|
set clipboard-=unnamed clipboard-=unnamedplus
|
||||||
let reg_save = @@
|
let reg_save = @@
|
||||||
call setreg('"',"\r",'v')
|
call setreg('"',"\032",'v')
|
||||||
call s:wrapreg('"',char,"",linemode)
|
call s:wrapreg('"',char,"",linemode)
|
||||||
" If line mode is used and the surrounding consists solely of a suffix,
|
" If line mode is used and the surrounding consists solely of a suffix,
|
||||||
" remove the initial newline. This fits a use case of mine but is a
|
" remove the initial newline. This fits a use case of mine but is a
|
||||||
@@ -354,7 +354,7 @@ function! s:insert(...) " {{{1
|
|||||||
call s:reindent()
|
call s:reindent()
|
||||||
endif
|
endif
|
||||||
norm! `]
|
norm! `]
|
||||||
call search('\r','bW')
|
call search('\032','bW')
|
||||||
let @@ = reg_save
|
let @@ = reg_save
|
||||||
let &clipboard = cb_save
|
let &clipboard = cb_save
|
||||||
return "\<Del>"
|
return "\<Del>"
|
||||||
|
|||||||
Reference in New Issue
Block a user