fix: Deal with some edge cases
This commit is contained in:
parent
ca3df73d3a
commit
9189537120
2 changed files with 6 additions and 3 deletions
|
@ -3,7 +3,10 @@ global !p
|
||||||
# def math():
|
# def math():
|
||||||
# return vim.eval('vimtex#syntax#in_mathzone()') == '1'
|
# return vim.eval('vimtex#syntax#in_mathzone()') == '1'
|
||||||
def itemize_like():
|
def itemize_like():
|
||||||
return get_env() in ["itemize", "enumerate"]
|
try:
|
||||||
|
return get_env() in ["itemize", "enumerate"]
|
||||||
|
except:
|
||||||
|
return False
|
||||||
def get_env():
|
def get_env():
|
||||||
return vim.eval('vimtex#env#get_inner()["name"]')
|
return vim.eval('vimtex#env#get_inner()["name"]')
|
||||||
|
|
||||||
|
@ -20,7 +23,7 @@ snippet "\\item\s*\S+.*" "create next item" rb
|
||||||
endsnippet
|
endsnippet
|
||||||
|
|
||||||
context itemize_like()
|
context itemize_like()
|
||||||
pre_expand "del snip.buffer[snip.line]; snip.cursor.set(snip.line, len(snip.buffer[snip.line+1])+1)"
|
pre_expand "del snip.buffer[snip.line]; snip.cursor.set(snip.line, len(snip.buffer[snip.line]))"
|
||||||
snippet "\\item\s*$" "exit itemize_like envs" rb
|
snippet "\\item\s*$" "exit itemize_like envs" rb
|
||||||
$0
|
$0
|
||||||
endsnippet
|
endsnippet
|
||||||
|
|
|
@ -58,7 +58,7 @@ let g:loaded_node_provider=0
|
||||||
let g:loaded_ruby_provider=0
|
let g:loaded_ruby_provider=0
|
||||||
|
|
||||||
" Change the leader and localleader
|
" Change the leader and localleader
|
||||||
let mapleader = ","
|
let mapleader=","
|
||||||
let maplocalleader=';'
|
let maplocalleader=';'
|
||||||
|
|
||||||
" Use ,dd for deleting without putting into buffer
|
" Use ,dd for deleting without putting into buffer
|
||||||
|
|
Loading…
Reference in a new issue