diff options
Diffstat (limited to 'lua/Snippets/luasniphelperslatex.lua')
| -rw-r--r-- | lua/Snippets/luasniphelperslatex.lua | 34 |
1 files changed, 14 insertions, 20 deletions
diff --git a/lua/Snippets/luasniphelperslatex.lua b/lua/Snippets/luasniphelperslatex.lua index a31e714..e0571cf 100644 --- a/lua/Snippets/luasniphelperslatex.lua +++ b/lua/Snippets/luasniphelperslatex.lua @@ -1,26 +1,20 @@ -local M = {} +tex = {} -M.in_mathzone = function() - return vim.fn['vimtex#syntax#in_mathzone']() == 1 +tex.in_mathzone = function() + return vim.fn['vimtex#syntax#in_mathzone']() == 1 end -M.in_text = function() - return not tex_utils.in_mathzone() -end -M.in_comment = function() - return vim.fn['vimtex#syntax#in_comment']() == 1 -end -M.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 -M.in_equation = function() - return tex_utils.in_env('equation') + +tex.in_comment = function() + return vim.fn['vimtex#syntax#in_comment']() == 1 end -M.in_itemize = function() - return tex_utils.in_env('itemize') + +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 -M.in_tikz = function() - return tex_utils.in_env('tikzpicture') + +tex.in_enumerate = function() + return tex.in_env('enumerate') end -return M +return tex |
