Skip to content

Commit cd1641c

Browse files
committed
lsp: insert solitary empty lines when applying text edits
Fixes fatih#3000
1 parent 6a1f510 commit cd1641c

File tree

2 files changed

+3
-8
lines changed

2 files changed

+3
-8
lines changed

autoload/go/lsp.vim

+1-1
Original file line numberDiff line numberDiff line change
@@ -1536,7 +1536,7 @@ function s:applyTextEdits(msg) abort
15361536
" TODO(bc): deal with folds
15371537

15381538
call s:deleteline(l:startline, l:endline)
1539-
for l:line in split(l:text, "\n")
1539+
for l:line in split(l:text, "\n", 1)
15401540
call append(l:startline-1, l:line)
15411541
let l:startline += 1
15421542
endfor
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,8 @@
11
package main
2-
3-
import (
4-
"fmt"
5-
)
6-
72
func Foo(log *logging.TestLogger) {
8-
log.Debug("vim-go")
3+
log.Debug("vim-go")
94
}
105

116
func main() {
12-
fmt.Println("vim-go")
7+
fmt.Println("vim-go")
138
}

0 commit comments

Comments
 (0)