summaryrefslogtreecommitdiffstats
path: root/lua/Snippets/luasniphelperslatex.lua
blob: 29599b38b1d4a81bbdd3bc0916a63ee1c2b12fd1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
tex = {}

tex.in_mathzone = function()
	return vim.fn['vimtex#syntax#in_mathzone']() == 1
end

tex.in_comment = function()
	return vim.fn['vimtex#syntax#in_comment']() == 1
end

tex.in_env = function(name)
	local is_inside = vim.fn['vimtex#env#is_inside'](name)
	return (is_inside[1] > 0 and is_inside[2] > 0)
end

tex.in_enumerate = function()
	return tex.in_env('enumerate')
end

tex.in_figure = function()
	return tex.in_env('figure')
end

return tex