diff options
author | Adam Stankiewicz <sheerun@sher.pl> | 2021-06-01 18:17:40 +0200 |
---|---|---|
committer | Adam Stankiewicz <sheerun@sher.pl> | 2021-06-01 18:17:40 +0200 |
commit | af0eaee01737d26314c9c3618153e99d1eb3e2f1 (patch) | |
tree | e45903bbc85886dcb6568c1f3c3f867b2649f2ca /autoload | |
parent | 730dcb02caab60a6ae5d8b4bdc16d290041061ec (diff) | |
download | vim-polyglot-af0eaee01737d26314c9c3618153e99d1eb3e2f1.tar.gz vim-polyglot-af0eaee01737d26314c9c3618153e99d1eb3e2f1.zip |
Update
Diffstat (limited to 'autoload')
-rw-r--r-- | autoload/LaTeXtoUnicode.vim | 54 | ||||
-rw-r--r-- | autoload/csv.vim | 12 | ||||
-rw-r--r-- | autoload/polyglot/init.vim | 2 | ||||
-rw-r--r-- | autoload/polyglot/sleuth.vim | 2 | ||||
-rw-r--r-- | autoload/terraform.vim | 3 |
5 files changed, 33 insertions, 40 deletions
diff --git a/autoload/LaTeXtoUnicode.vim b/autoload/LaTeXtoUnicode.vim index 2be1a492..86420cca 100644 --- a/autoload/LaTeXtoUnicode.vim +++ b/autoload/LaTeXtoUnicode.vim @@ -73,9 +73,6 @@ function! s:L2U_SetupGlobal() " Trigger for the previous mapping of <CR> let s:l2u_fallback_trigger_cr = "\u0091L2UFallbackCR" - " Trigger for autosub completion cleanup autocommand - let s:l2u_autosub_cleanup_trigger = "\u0091L2UAutosubCleanup" - endfunction " Each time the filetype changes, we may need to enable or @@ -371,16 +368,14 @@ function! s:L2U_SetFallbackMapping(s, k) " parsing of the <C-R>=... expression, so we need to special-case it. " Also, if the original mapping was intended to be recursive, this " will break it. - if mmdict["expr"] - if a:s != "<CR>" - let rhs = substitute(rhs, '\c' . a:s, "\<C-R>=LaTeXtoUnicode#PutLiteral('" . a:s . "')\<CR>", 'g') - else - let rhs = substitute(rhs, '\c' . a:s, "\<C-R>=LaTeXtoUnicode#PutLiteralCR()\<CR>", 'g') - endif - " Make the mapping silent even if it wasn't originally - if !mmdict["silent"] - let pre = pre . '<silent>' - endif + if a:s != "<CR>" + let rhs = substitute(rhs, '\c' . a:s, "\<C-R>=LaTeXtoUnicode#PutLiteral('" . a:s . "')\<CR>", 'g') + else + let rhs = substitute(rhs, '\c' . a:s, "\<C-R>=LaTeXtoUnicode#PutLiteralCR()\<CR>", 'g') + endif + " Make the mapping silent even if it wasn't originally + if !mmdict["silent"] + let pre = pre . '<silent>' endif endif exe cmd . pre . ' ' . a:k . ' ' . rhs @@ -631,7 +626,7 @@ function! LaTeXtoUnicode#AutoSub(...) let lnum = line('.') if col1 == 1 if a:0 > 1 - call feedkeys(a:2, 't') + call feedkeys(a:2, 'mi') endif let b:l2u_in_autosub = 0 return '' @@ -641,7 +636,7 @@ function! LaTeXtoUnicode#AutoSub(...) let col0 = match(l, '\\\%([_^]\?[A-Za-z]\+\%' . col1 . 'c\%([^A-Za-z]\|$\)\|[_^]\%([0-9()=+-]\)\%' . col1 .'c\%(.\|$\)\)') if col0 == -1 if a:0 > 1 - call feedkeys(a:2, 't') + call feedkeys(a:2, 'mi') endif let b:l2u_in_autosub = 0 return '' @@ -650,33 +645,22 @@ function! LaTeXtoUnicode#AutoSub(...) let unicode = get(g:l2u_symbols_dict, base, '') if empty(unicode) if a:0 > 1 - call feedkeys(a:2, 't') + call feedkeys(a:2, 'mi') endif let b:l2u_in_autosub = 0 return '' endif - " create a temporary mapping to reset b:l2u_in_autosub when done - " (when invoked, it removes itself) - exec 'imap <buffer> ' . s:l2u_autosub_cleanup_trigger . ' <Plug>L2UAutosubReset' - inoremap <buffer><expr> <Plug>L2UAutosubReset <SID>L2U_AutosubReset() - " perform the substitution, wrapping it in undo breakpoints so that " we can revert it as a whole - call feedkeys("\<C-G>u", 'n') - call feedkeys(repeat("\b", len(base) + bs) . unicode . vc . s:l2u_esc_sequence, 'nt') - call feedkeys("\<C-G>u", 'n') - " enqueue the reset mechanism - call feedkeys(s:l2u_autosub_cleanup_trigger) - return '' -endfunction - -function! s:L2U_AutosubReset() - " no longer doing substitution - let b:l2u_in_autosub = 0 - " remove the mapping that triggered this function - exec 'iunmap <buffer> ' . s:l2u_autosub_cleanup_trigger - iunmap <buffer> <Plug>L2UAutosubReset + " at the end, reset the l2u_in_autosub variable without leaving insert mode + " the 'i' mode is the only one that works correctly when executing macros + " the 'n' mode is to avoid user-defined mappings of \b, <C-G> and <C-\><C-O> + call feedkeys("\<C-G>u" . + \ repeat("\b", len(base) + bs) . unicode . vc . s:l2u_esc_sequence . + \ "\<C-G>u" . + \ "\<C-\>\<C-O>:let b:l2u_in_autosub = 0\<CR>", + \ 'ni') return '' endfunction diff --git a/autoload/csv.vim b/autoload/csv.vim index d268cd12..98feee75 100644 --- a/autoload/csv.vim +++ b/autoload/csv.vim @@ -1195,7 +1195,7 @@ endfun fu! csv#Sort(bang, line1, line2, colnr) range "{{{3 " :Sort command let wsv = winsaveview() - let flag = matchstr(a:colnr, '[nixo]') + let flag = matchstr(a:colnr, '[nixof]') call csv#CheckHeaderLine() let line1 = a:line1 let line2 = a:line2 @@ -2199,7 +2199,15 @@ fu! csv#CSVMappings() "{{{3 call csv#Map('nnoremap', 'W', ':<C-U>call csv#MoveCol(1, line("."))<CR>') call csv#Map('nnoremap', '<C-Right>', ':<C-U>call csv#MoveCol(1, line("."))<CR>') call csv#Map('nnoremap', 'L', ':<C-U>call csv#MoveCol(1, line("."))<CR>') - call csv#Map('nnoremap', 'E', ':<C-U>call csv#MoveCol(-1, line("."))<CR>') + try + if g:csv_bind_B == 1 + call csv#Map('nnoremap', 'B', ':<C-U>call csv#MoveCol(-1, line("."))<CR>') + else + call csv#Map('nnoremap', 'E', ':<C-U>call csv#MoveCol(-1, line("."))<CR>') + endif + catch + call csv#Map('nnoremap', 'E', ':<C-U>call csv#MoveCol(-1, line("."))<CR>') + endtry call csv#Map('nnoremap', '<C-Left>', ':<C-U>call csv#MoveCol(-1, line("."))<CR>') call csv#Map('nnoremap', 'H', ':<C-U>call csv#MoveCol(-1, line("."), 1)<CR>') call csv#Map('nnoremap', 'K', ':<C-U>call csv#MoveCol(0, line(".")-v:count1)<CR>') diff --git a/autoload/polyglot/init.vim b/autoload/polyglot/init.vim index 0cb4f401..62421e06 100644 --- a/autoload/polyglot/init.vim +++ b/autoload/polyglot/init.vim @@ -2245,7 +2245,7 @@ if !has_key(g:polyglot_is_disabled, 'jsonnet') endif if !has_key(g:polyglot_is_disabled, 'json') - au BufNewFile,BufRead *.JSON-tmLanguage,*.avsc,*.geojson,*.gltf,*.har,*.ice,*.json,*.jsonl,*.jsonp,*.mcmeta,*.template,*.tfstate,*.tfstate.backup,*.topojson,*.webapp,*.webmanifest,*.yy,*.yyp,{.,}arcconfig,{.,}htmlhintrc,{.,}tern-config,{.,}tern-project,{.,}watchmanconfig,Pipfile.lock,composer.lock,mcmod.info setf json + au BufNewFile,BufRead *.JSON-tmLanguage,*.avsc,*.geojson,*.gltf,*.har,*.ice,*.json,*.jsonl,*.jsonp,*.mcmeta,*.template,*.tfstate,*.tfstate.backup,*.topojson,*.webapp,*.webmanifest,*.yy,*.yyp,{.,}arcconfig,{.,}htmlhintrc,{.,}imgbotconfig,{.,}tern-config,{.,}tern-project,{.,}watchmanconfig,Pipfile.lock,composer.lock,mcmod.info setf json endif if !has_key(g:polyglot_is_disabled, 'json5') diff --git a/autoload/polyglot/sleuth.vim b/autoload/polyglot/sleuth.vim index 50b3321b..830a2318 100644 --- a/autoload/polyglot/sleuth.vim +++ b/autoload/polyglot/sleuth.vim @@ -263,7 +263,7 @@ let s:globs = { \ 'jovial': '*.jov,*.j73,*.jovial', \ 'jproperties': '*.properties,*.properties_??,*.properties_??_??,*.properties_??_??_*', \ 'jq': '*.jq,.jqrc,.jqrc*', - \ 'json': '*.json,*.avsc,*.geojson,*.gltf,*.har,*.ice,*.JSON-tmLanguage,*.jsonl,*.mcmeta,*.tfstate,*.tfstate.backup,*.topojson,*.webapp,*.webmanifest,*.yy,*.yyp,*.jsonp,*.template,.arcconfig,.htmlhintrc,.tern-config,.tern-project,.watchmanconfig,Pipfile.lock,composer.lock,mcmod.info', + \ 'json': '*.json,*.avsc,*.geojson,*.gltf,*.har,*.ice,*.JSON-tmLanguage,*.jsonl,*.mcmeta,*.tfstate,*.tfstate.backup,*.topojson,*.webapp,*.webmanifest,*.yy,*.yyp,*.jsonp,*.template,.arcconfig,.htmlhintrc,.imgbotconfig,.tern-config,.tern-project,.watchmanconfig,Pipfile.lock,composer.lock,mcmod.info', \ 'json5': '*.json5', \ 'jsonc': '*.cjson,*.jsonc,coc-settings.json,.eslintrc.json,.babelrc,.jshintrc,.jslintrc,.mocharc.json,coffeelint.json,tsconfig.json,jsconfig.json', \ 'jsonnet': '*.jsonnet,*.libsonnet', diff --git a/autoload/terraform.vim b/autoload/terraform.vim index a1d2a06a..324b978d 100644 --- a/autoload/terraform.vim +++ b/autoload/terraform.vim @@ -40,7 +40,7 @@ function! terraform#align() abort if exists(':Tabularize') && getline('.') =~# '^.*=' && (getline(line('.')-1) =~# p || getline(line('.')+1) =~# p) let column = strlen(substitute(getline('.')[0:col('.')],'[^=]','','g')) let position = strlen(matchstr(getline('.')[0:col('.')],'.*=\s*\zs.*')) - Tabularize/=/l1 + Tabularize/=.*/l1 normal! 0 call search(repeat('[^=]*=',column).'\s\{-\}'.repeat('.',position),'ce',line('.')) endif @@ -67,6 +67,7 @@ function! terraform#commands(ArgLead, CmdLine, CursorPos) abort \ 'show', \ 'state', \ 'taint', + \ 'test', \ 'untaint', \ 'version', \ 'workspace' |