Skip to content

Commit

Permalink
fix next.js like file name pattern
Browse files Browse the repository at this point in the history
  • Loading branch information
hrsh7th committed Nov 12, 2023
1 parent 9d27211 commit 453236c
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 2 deletions.
4 changes: 2 additions & 2 deletions autoload/vital/__vital__/VS/LSP/TextEdit.vim
Original file line number Diff line number Diff line change
Expand Up @@ -163,10 +163,10 @@ endfunction
"
function! s:_switch(path) abort
let l:curr = bufnr('%')
let l:next = bufnr(a:path)
let l:next = filereadable(fnameescape(a:path)) ? bufnr(fnameescape(a:path)) : bufnr(a:path)
if l:next >= 0
if l:curr != l:next
execute printf('noautocmd keepalt keepjumps %sbuffer!', bufnr(a:path))
execute printf('noautocmd keepalt keepjumps %sbuffer!', l:next)
endif
else
execute printf('noautocmd keepalt keepjumps edit! %s', fnameescape(a:path))
Expand Down
20 changes: 20 additions & 0 deletions autoload/vital/__vital__/VS/LSP/TextEdit.vimspec
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,26 @@ Describe vital#__vital__#VS#LSP#TextEdit

Describe #apply

Describe bufname
It should applied TextEdit to strange name buffer
call bufload(bufadd('foo/[id]/var'))
call s:TextEdit.apply('foo/[id]/var', [{
\ 'range': {
\ 'start': {
\ 'line': 0,
\ 'character': 0,
\ },
\ 'end': {
\ 'line': 0,
\ 'character': 0,
\ },
\ },
\ 'newText': 'abcde'
\ }])
call s:expect(getbufline('%', 1, '$')).to_equal(['abcde'])
End
End

Describe cursor

It should fix cursor position (singleline -> singleline)
Expand Down

0 comments on commit 453236c

Please sign in to comment.