diff options
author | Christian Clason <c.clason@uni-graz.at> | 2022-08-20 10:04:55 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-08-20 10:04:55 +0200 |
commit | 1cc4706e94489498b12c4844c1b3a2e9aa5cc921 (patch) | |
tree | a2517116d23cceed4ccb41c38c40573b3a7a6c85 /runtime/ftplugin | |
parent | bffaf1e27e49c3dbbc0b59d023a0fd9243e254aa (diff) | |
download | rneovim-1cc4706e94489498b12c4844c1b3a2e9aa5cc921.tar.gz rneovim-1cc4706e94489498b12c4844c1b3a2e9aa5cc921.tar.bz2 rneovim-1cc4706e94489498b12c4844c1b3a2e9aa5cc921.zip |
vim-patch:e80086446cc2 (#19848)
* vim-patch:e80086446cc2
Update runtime files
https://github.com/vim/vim/commit/e80086446cc20856ed8359bc8dc87c4d430da4c8
Co-authored-by: Sean Dewar <seandewar@users.noreply.github.com>
Diffstat (limited to 'runtime/ftplugin')
-rw-r--r-- | runtime/ftplugin/j.vim | 66 |
1 files changed, 34 insertions, 32 deletions
diff --git a/runtime/ftplugin/j.vim b/runtime/ftplugin/j.vim index 3cd0cb8e2b..ae235abba8 100644 --- a/runtime/ftplugin/j.vim +++ b/runtime/ftplugin/j.vim @@ -2,7 +2,7 @@ " Language: J " Maintainer: David Bürgin <dbuergin@gluet.ch> " URL: https://gitlab.com/glts/vim-j -" Last Change: 2015-10-27 +" Last Change: 2022-08-06 if exists('b:did_ftplugin') finish @@ -29,41 +29,43 @@ let b:undo_ftplugin = 'setlocal suffixesadd< includeexpr< include< path< matchpa " Section movement with ]] ][ [[ []. The start/end patterns below are amended " inside the function in order to avoid matching on the current cursor line. -let s:sectionstart = '\%(\s*Note\|.\{-}\<\%([0-4]\|13\|noun\|adverb\|conjunction\|verb\|monad\|dyad\)\s\+\%(:\s*0\|def\s\+0\|define\)\)\>.*' -let s:sectionend = '\s*)\s*' +if !exists('no_plugin_maps') && !exists('no_j_maps') + let s:sectionstart = '\%(\s*Note\|.\{-}\<\%([0-4]\|13\|noun\|adverb\|conjunction\|verb\|monad\|dyad\)\s\+\%(:\s*0\|def\s\+0\|define\)\)\>.*' + let s:sectionend = '\s*)\s*' -function! s:SearchSection(end, backwards, visualmode) abort - if a:visualmode !=# '' - normal! gv - endif - let l:flags = a:backwards ? 'bsW' : 'sW' - if a:end - call search('^' . s:sectionend . (a:backwards ? '\n\_.\{-}\%#' : '$'), l:flags) - else - call search('^' . s:sectionstart . (a:backwards ? '\n\_.\{-}\%#' : '$'), l:flags) - endif -endfunction + function! s:SearchSection(end, backwards, visualmode) abort + if a:visualmode !=# '' + normal! gv + endif + let l:flags = a:backwards ? 'bsW' : 'sW' + if a:end + call search('^' . s:sectionend . (a:backwards ? '\n\_.\{-}\%#' : '$'), l:flags) + else + call search('^' . s:sectionstart . (a:backwards ? '\n\_.\{-}\%#' : '$'), l:flags) + endif + endfunction -noremap <buffer> <silent> ]] :<C-U>call <SID>SearchSection(0, 0, '')<CR> -xnoremap <buffer> <silent> ]] :<C-U>call <SID>SearchSection(0, 0, visualmode())<CR> -sunmap <buffer> ]] -noremap <buffer> <silent> ][ :<C-U>call <SID>SearchSection(1, 0, '')<CR> -xnoremap <buffer> <silent> ][ :<C-U>call <SID>SearchSection(1, 0, visualmode())<CR> -sunmap <buffer> ][ -noremap <buffer> <silent> [[ :<C-U>call <SID>SearchSection(0, 1, '')<CR> -xnoremap <buffer> <silent> [[ :<C-U>call <SID>SearchSection(0, 1, visualmode())<CR> -sunmap <buffer> [[ -noremap <buffer> <silent> [] :<C-U>call <SID>SearchSection(1, 1, '')<CR> -xnoremap <buffer> <silent> [] :<C-U>call <SID>SearchSection(1, 1, visualmode())<CR> -sunmap <buffer> [] + noremap <buffer> <silent> ]] :<C-U>call <SID>SearchSection(0, 0, '')<CR> + xnoremap <buffer> <silent> ]] :<C-U>call <SID>SearchSection(0, 0, visualmode())<CR> + sunmap <buffer> ]] + noremap <buffer> <silent> ][ :<C-U>call <SID>SearchSection(1, 0, '')<CR> + xnoremap <buffer> <silent> ][ :<C-U>call <SID>SearchSection(1, 0, visualmode())<CR> + sunmap <buffer> ][ + noremap <buffer> <silent> [[ :<C-U>call <SID>SearchSection(0, 1, '')<CR> + xnoremap <buffer> <silent> [[ :<C-U>call <SID>SearchSection(0, 1, visualmode())<CR> + sunmap <buffer> [[ + noremap <buffer> <silent> [] :<C-U>call <SID>SearchSection(1, 1, '')<CR> + xnoremap <buffer> <silent> [] :<C-U>call <SID>SearchSection(1, 1, visualmode())<CR> + sunmap <buffer> [] -let b:undo_ftplugin .= ' | silent! execute "unmap <buffer> ]]"' - \ . ' | silent! execute "unmap <buffer> ]["' - \ . ' | silent! execute "unmap <buffer> [["' - \ . ' | silent! execute "unmap <buffer> []"' + let b:undo_ftplugin .= ' | silent! execute "unmap <buffer> ]]"' + \ . ' | silent! execute "unmap <buffer> ]["' + \ . ' | silent! execute "unmap <buffer> [["' + \ . ' | silent! execute "unmap <buffer> []"' +endif -" Browse dialog filter on Windows (see ":help browsefilter") -if has('gui_win32') && !exists('b:browsefilter') +" Browse dialog filter on Windows and GTK (see ":help browsefilter") +if (has('gui_win32') || has('gui_gtk')) && !exists('b:browsefilter') let b:browsefilter = "J Script Files (*.ijs)\t*.ijs\n" \ . "All Files (*.*)\t*.*\n" let b:undo_ftplugin .= ' | unlet! b:browsefilter' |