Skip to content

Commit

Permalink
Merge pull request #170 from obcat/vim9-support
Browse files Browse the repository at this point in the history
Add initial support for Vim9 script
  • Loading branch information
tyru authored Sep 16, 2021
2 parents 2c0cd18 + 8705f18 commit 8978f97
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 4 additions & 1 deletion after/ftplugin/vim/caw.vim
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
" vim:foldmethod=marker:fen:
scriptencoding utf-8

let b:caw_oneline_comment = '"'
function! s:is_vim9line(lnum) abort
return search('\C\m^\s*vim9s\%[cript]\>', 'bnWz') >= 1
endfunction
let b:caw_oneline_comment = { lnum -> s:is_vim9line(lnum) ? '#' : '"' }
function! s:linecont_sp(lnum) abort
return getline(a:lnum) =~# '^\s*\\' ? '' : ' '
endfunction
Expand Down
2 changes: 1 addition & 1 deletion test/comments/oneline.vim
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ endfunction

function! s:suite.can_load_vim_ftplugin() abort
setlocal filetype=vim
call s:assert.equals(b:caw_oneline_comment, '"')
call s:assert.is_function(b:caw_oneline_comment)
endfunction

function! s:suite.get_comments() abort
Expand Down

0 comments on commit 8978f97

Please sign in to comment.