autoload/lsp/outline.vim | 2 +- autoload/lsp/symbol.vim | 4 ++-- autoload/lsp/textedit.vim | 2 +- test/clangd_tests.vim | 4 ++-- diff --git a/autoload/lsp/outline.vim b/autoload/lsp/outline.vim index 7a337b3c5f6ddb25b09d77624fe404caf858294e..4665131904ae47223d679cc7a11f327c03db5e02 100644 --- a/autoload/lsp/outline.vim +++ b/autoload/lsp/outline.vim @@ -194,7 +194,7 @@ endif # Highlight the selected symbol var col: number = - bnr->getbufline(symbolTable[mid].outlineLine)[0]->match('\S') + 1 + bnr->getbufoneline(symbolTable[mid].outlineLine)->match('\S') + 1 prop_add(symbolTable[mid].outlineLine, col, {bufnr: bnr, type: 'LspOutlineHighlight', length: symbolTable[mid].name->len()}) diff --git a/autoload/lsp/symbol.vim b/autoload/lsp/symbol.vim index 597160656cf0893c7695a1180327dcb288a9fd7a..38725e1cd569dfff4bf7d064943b9bdd68a52ad3 100644 --- a/autoload/lsp/symbol.vim +++ b/autoload/lsp/symbol.vim @@ -349,8 +349,8 @@ if !bnr->bufloaded() bnr->bufload() endif - var text: string = bnr->getbufline(range.start.line + 1)[0] var lnum = range.start.line + 1 + var text: string = bnr->getbufoneline(lnum) menuItems->add($'{lnum}: {text}') endfor @@ -392,7 +392,7 @@ endif if !bnr->bufloaded() bnr->bufload() endif - var text: string = bnr->getbufline(range.start.line + 1)[0]->trim("\t ", 1) + var text: string = bnr->getbufoneline(range.start.line + 1)->trim("\t ", 1) qflist->add({filename: fname, lnum: range.start.line + 1, col: util.GetLineByteFromPos(bnr, range.start) + 1, diff --git a/autoload/lsp/textedit.vim b/autoload/lsp/textedit.vim index 7a30137ae398c9f279fe82499bd3d4123d545c83..02859dec25712ab1d507df2c812697ebcb163347 100644 --- a/autoload/lsp/textedit.vim +++ b/autoload/lsp/textedit.vim @@ -173,7 +173,7 @@ # extra empty line at the end. Delete the empty line after appending the # lines. var dellastline: bool = false if start_line == 0 && bnr->getbufinfo()[0].linecount == 1 && - bnr->getbufline(1)[0] == '' + bnr->getbufoneline(1) == '' dellastline = true endif diff --git a/test/clangd_tests.vim b/test/clangd_tests.vim index 2d58fc70195cb0047c4c8d94719e614eb9f14f87..7c29d3a2c233a9a2155738ed42396715c3d528fb 100644 --- a/test/clangd_tests.vim +++ b/test/clangd_tests.vim @@ -464,14 +464,14 @@ :LspDiagHere assert_equal([1, 5], [line('.'), col('.')]) var ids = popup_list() assert_equal(1, ids->len()) - assert_match('Incompatible pointer to integer', getbufline(ids[0]->winbufnr(), 1, '$')[0]) + assert_match('Incompatible pointer to integer', getbufoneline(ids[0]->winbufnr(), 1, '$')) popup_clear() cursor(1, 6) :LspDiagHere assert_equal([1, 9], [line('.'), col('.')]) ids = popup_list() assert_equal(1, ids->len()) - assert_match('Initializer element is not', getbufline(ids[0]->winbufnr(), 1, '$')[0]) + assert_match('Initializer element is not', getbufoneline(ids[0]->winbufnr(), 1, '$')) popup_clear() # Line without diagnostics