Remove unnecessary option (#457)

This commit is contained in:
Karl Yngve Lervåg 2016-05-31 18:18:49 +02:00
parent 234982e904
commit 2d816d7559
2 changed files with 20 additions and 38 deletions

View File

@ -5,19 +5,6 @@
" "
function! vimtex#env#init_options() " {{{1 function! vimtex#env#init_options() " {{{1
call vimtex#util#set_default('g:vimtex_env_complete_list', [
\ 'itemize',
\ 'enumerate',
\ 'description',
\ 'center',
\ 'figure',
\ 'table',
\ 'equation',
\ 'multline',
\ 'align',
\ 'split',
\ '\[',
\ ])
endfunction endfunction
" }}}1 " }}}1
@ -151,14 +138,18 @@ endfunction
" }}}1 " }}}1
function! s:input_complete(lead, cmdline, pos) " {{{1 function! s:input_complete(lead, cmdline, pos) " {{{1
" Always include displaymath
let l:cands = ['\[']
try try
let l:cands = uniq(sort( let l:cands += uniq(sort(
\ g:vimtex_env_complete_list \ map(filter(vimtex#parser#tex(b:vimtex.tex, { 'detailed' : 0 }),
\ + map(filter(vimtex#parser#tex(b:vimtex.tex, { 'detailed' : 0 }), \ 'v:val =~# ''\\begin'''),
\ 'v:val =~# ''\\begin'''), \ 'matchstr(v:val, ''\\begin{\zs\k*\ze\*\?}'')')))
\ 'matchstr(v:val, ''\\begin{\zs\k*\ze\*\?}'')')))
" Never include document
call remove(l:cands, index(l:cands, 'document'))
catch catch
let l:cands = g:vimtex_env_complete_list
endtry endtry
return filter(l:cands, 'v:val =~# ''^' . a:lead . '''') return filter(l:cands, 'v:val =~# ''^' . a:lead . '''')

View File

@ -370,25 +370,6 @@ Options~
Default value: 0 Default value: 0
*g:vimtex_env_complete_list*
Define a list of environments that will be completed when changing the
surrounding environments (see |<plug>(vimtex-env-change)|).
Default value: >
let g:vimtex_env_complete_list = [
\ 'itemize',
\ 'enumerate',
\ 'description',
\ 'center',
\ 'figure',
\ 'table',
\ 'equation',
\ 'multline',
\ 'align',
\ 'split',
\ '\[',
\ ]
<
*g:vimtex_delim_toggle_mod_list* *g:vimtex_delim_toggle_mod_list*
Define list of delimiter modifiers to toggle through with Define list of delimiter modifiers to toggle through with
|<plug>(vimtex-delim-toggle-modifier)|. |<plug>(vimtex-delim-toggle-modifier)|.
@ -2009,6 +1990,16 @@ The following changelog only logs particularly important changes, such as
changes that break backwards compatibility. See the git log for the detailed changes that break backwards compatibility. See the git log for the detailed
changelog. changelog.
2016-05-31: A lot of things have updated~
I know that people would like to see a simple list of changes. Unfortunately,
I am bad at keeping this changelog updated. All details are available in the
git log, though. The reason I added this entry is to note that I have removed
an option:
*g:vimtex_env_complete_list* --- It is no longer necessary. Completion
candidates are instead parsed from the
project.
2016-02-06: Large refactoring of delimiter parsing~ 2016-02-06: Large refactoring of delimiter parsing~
I've refactored a lot of the code in order to make the parsing of delimiters I've refactored a lot of the code in order to make the parsing of delimiters
and features that rely on delimiter detection and similar more consistent. and features that rely on delimiter detection and similar more consistent.