Skip to content

Commit

Permalink
fix: error in toggle_math
Browse files Browse the repository at this point in the history
refer: #2488
  • Loading branch information
lervag committed Sep 16, 2022
1 parent 4e35274 commit 5589bdb
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions autoload/vimtex/env.vim
Original file line number Diff line number Diff line change
Expand Up @@ -297,8 +297,10 @@ function! vimtex#env#toggle_math() abort " {{{1
let [l:open, l:close] = vimtex#env#get_surrounding('math')
if empty(l:open) | return | endif

call vimtex#env#change(l:open, l:close,
\ get(g:vimtex_env_toggle_math_map, l:open.match, '$'))
let l:current = get(l:open, 'name', l:open.match)
let l:target = get(g:vimtex_env_toggle_math_map, l:current, '$')

call vimtex#env#change(l:open, l:close, l:target)
endfunction

" }}}1
Expand Down

0 comments on commit 5589bdb

Please sign in to comment.