]> git.madduck.net Git - etc/vim.git/blob - autoload/vital/_lsp/VS/LSP/Text.vim

madduck's git repository

Every one of the projects in this repository is available at the canonical URL git://git.madduck.net/madduck/pub/<projectpath> — see each project's metadata for the exact URL.

All patches and comments are welcome. Please squash your changes to logical commits before using git-format-patch and git-send-email to patches@git.madduck.net. If you'd read over the Git project's submission guidelines and adhered to them, I'd be especially grateful.

SSH access, as well as push access can be individually arranged.

If you use my repositories frequently, consider adding the following snippet to ~/.gitconfig and using the third clone URL listed for each project:

[url "git://git.madduck.net/madduck/"]
  insteadOf = madduck:

Squashed '.vim/bundle/vim-lsp/' content from commit 04428c92
[etc/vim.git] / autoload / vital / _lsp / VS / LSP / Text.vim
1 " ___vital___
2 " NOTE: lines between '" ___vital___' is generated by :Vitalize.
3 " Do not modify the code nor insert new lines before '" ___vital___'
4 function! s:_SID() abort
5   return matchstr(expand('<sfile>'), '<SNR>\zs\d\+\ze__SID$')
6 endfunction
7 execute join(['function! vital#_lsp#VS#LSP#Text#import() abort', printf("return map({'normalize_eol': '', 'split_by_eol': ''}, \"vital#_lsp#function('<SNR>%s_' . v:key)\")", s:_SID()), 'endfunction'], "\n")
8 delfunction s:_SID
9 " ___vital___
10 "
11 " normalize_eol
12 "
13 function! s:normalize_eol(text) abort
14   return substitute(a:text, "\r\n\\|\r", "\n", 'g')
15 endfunction
16
17 "
18 " split_by_eol
19 "
20 function! s:split_by_eol(text) abort
21   return split(a:text, "\r\n\\|\r\\|\n", v:true)
22 endfunction
23