diff --git a/autoload/go/lsp.vim b/autoload/go/lsp.vim index 8e940118ee..24380722db 100644 --- a/autoload/go/lsp.vim +++ b/autoload/go/lsp.vim @@ -2048,7 +2048,11 @@ function! s:lineinfile(fname, line) abort if l:bufnr == -1 || len(l:bufinfo) == 0 || l:bufinfo[0].loaded == 0 let l:filecontents = readfile(a:fname, '', a:line) else - let l:filecontents = getbufline(a:fname, a:line) + if exists('*getbufoneline') + let l:filecontents = [getbufoneline(a:fname, a:line)] + else + let l:filecontents = getbufline(a:fname, a:line) + endif endif if len(l:filecontents) == 0