Re: [vim/vim] buffered listener cannot obtain the text of a change (PR #21071)
Mao-Yining (Vim Github Repository) <[email protected]>
| Newsgroups | gmane.editors.vim.devel |
|---|---|
| Message-ID | <vim/vim/pull/21071/[email protected]> |
mao-yining left a comment (vim/vim#21071)
LSP require a string instead of `list<string>`, so now we need:
```vim
var hasEol: bool = bnr->getbufvar('&eol')
var lcount: number = bnr->getbufinfo()[0].linecount - 1
var Join = (text: list<string>, end: number) =>
end < lcount || hasEol ? text->join("\n") .. "\n" : text->join("\n")
contentChanges = changes->mapnew((_, v) => ({
range: {
start: {line: v.lnum - 1, character: v.col - 1},
end: {line: v.end - 1, character: 0},
},
text: v.text->Join(v.end)
}))
```
Could you consider making it easier to handle newline characters? Or is there a better way to do this?
--
Reply to this email directly or view it on GitHub:
https://github.com/vim/vim/pull/21071#issuecomment-5369505758
You are receiving this because you are subscribed to this thread.
Message ID: <vim/vim/pull/21071/[email protected]>
--
--
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php
---
You received this message because you are subscribed to the Google Groups "vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
To view this discussion visit https://groups.google.com/d/msgid/vim_dev/vim/vim/pull/21071/c5369505758%40github.com.