Skip to content

Commit 7bd5eaa

Browse files
committed
chore: minor adjustments
1 parent 3f96414 commit 7bd5eaa

3 files changed

Lines changed: 19 additions & 21 deletions

File tree

autoload/vimtex/compiler/texpresso.vim

Lines changed: 13 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -63,16 +63,13 @@ endfunction
6363

6464
function! s:compiler_stop(super, ...) abort dict " {{{1
6565
call call(a:super, a:000, self)
66-
if has('nvim')
67-
if has_key(self, 'nvim_detach')
68-
call self.nvim_detach()
69-
unlet self.nvim_detach
70-
endif
71-
else
72-
if has_key(self, 'listener_id')
73-
call listener_remove(self.listener_id)
74-
unlet self.listener_id
75-
endif
66+
67+
if has('nvim') && has_key(self, 'nvim_detach')
68+
call self.nvim_detach()
69+
unlet self.nvim_detach
70+
elseif has_key(self, 'listener_id')
71+
call listener_remove(self.listener_id)
72+
unlet self.listener_id
7673
endif
7774

7875
autocmd! vimtex_compiler_texpresso * <buffer>
@@ -90,7 +87,7 @@ function! s:compiler.texpresso_theme() abort dict " {{{1
9087
let l:normal_id = synIDtrans(hlID('Normal'))
9188
let l:fg = synIDattr(l:normal_id, 'fg#')
9289
let l:bg = synIDattr(l:normal_id, 'bg#')
93-
90+
9491
if l:fg ==# '' || l:bg ==# ''
9592
return
9693
endif
@@ -139,8 +136,10 @@ function! s:compiler.texpresso_send(...) abort dict " {{{1
139136
" chansend/ch_sendraw can fail transiently before TeXpresso has finished
140137
" opening its stdin pipe. Propagating the exception causes Neovim to close
141138
" the channel, which delivers EOF to TeXpresso and terminates it.
142-
call vimtex#log#info('TeXpresso: dropped message (process still starting): '
143-
\ . v:exception)
139+
call vimtex#log#info(
140+
\ 'TeXpresso: dropped message (process still starting): '
141+
\ . v:exception
142+
\)
144143
endtry
145144
endfunction
146145
" }}}1
@@ -168,8 +167,6 @@ function! s:texpresso_process_message_line(json) abort " {{{1
168167
return
169168
endif
170169

171-
" echom l:msg
172-
173170
if l:msg[0] ==# 'synctex'
174171
let l:path = l:msg[1]
175172
let l:lnum = l:msg[2]
@@ -191,7 +188,7 @@ function! s:texpresso_process_message_line(json) abort " {{{1
191188
endif
192189
elseif l:msg[0] ==# 'flush'
193190
else
194-
" TODO: handle other types of messages
191+
" Here we can handle other types of messages
195192
endif
196193
endfunction
197194

doc/vimtex.txt

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5623,10 +5623,11 @@ COMPILER *vimtex-compiler*
56235623
VimTeX provides an interface to the following LaTeX compilers/compiler
56245624
backends:
56255625

5626-
* |vimtex-compiler-latexmk| http://users.phys.psu.edu/~collins/software/latexmk-jcc
5627-
* |vimtex-compiler-latexrun| https://github.com/aclements/latexrun
5628-
* |vimtex-compiler-tectonic| https://tectonic-typesetting.github.io/
5629-
* |vimtex-compiler-arara| https://github.com/cereda/arara
5626+
* |vimtex-compiler-latexmk| http://users.phys.psu.edu/~collins/software/latexmk-jcc
5627+
* |vimtex-compiler-latexrun| https://github.com/aclements/latexrun
5628+
* |vimtex-compiler-tectonic| https://tectonic-typesetting.github.io/
5629+
* |vimtex-compiler-arara| https://github.com/cereda/arara
5630+
* |vimtex-compiler-texpresso| https://aur.archlinux.org/packages/texpresso-git
56305631
* |vimtex-compiler-generic|
56315632

56325633
The interface is implemented in a general way, which makes it relatively easy

lua/vimtex/compiler/texpresso.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ function M.attach()
2323
"\n"
2424
) .. "\n"
2525
end
26-
local msg = vim.json.encode({ "change-lines", path, first, count, lines })
26+
local msg = vim.json.encode { "change-lines", path, first, count, lines }
2727
vim.api.nvim_chan_send(compiler.job, msg .. "\n")
2828
end,
2929
})

0 commit comments

Comments
 (0)