Skip to content

Commit

Permalink
feat(context): add open in split action
Browse files Browse the repository at this point in the history
refer: #3073
  • Loading branch information
lervag committed Mar 2, 2025
1 parent 7826ac7 commit d7c696d
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions autoload/vimtex/context/glossaries.vim
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ let s:actions = {
\ 'menu': [
\ {'name': 'Go to entry',
\ 'func': 'goto'},
\ {'name': 'Go to entry in split',
\ 'func': 'goto_split'},
\ {'name': 'Show entry',
\ 'func': 'show'},
\ ],
Expand Down Expand Up @@ -103,6 +105,15 @@ function! s:actions.goto() abort dict " {{{1
normal! zv
endfunction

" }}}1
function! s:actions.goto_split() abort dict " {{{1
execute 'split' self.entry.source_file
filetype detect

call vimtex#pos#set_cursor(self.entry.source_lnum, 0)
normal! zv
endfunction

" }}}1

function! s:get_entry(key) abort " {{{1
Expand Down

0 comments on commit d7c696d

Please sign in to comment.