From 45fd12cf1c40365c26c060dde4f89b0dea145c68 Mon Sep 17 00:00:00 2001 From: Natsu Kagami Date: Tue, 9 Nov 2021 16:41:42 -0500 Subject: [PATCH] Partially fix double insert bugs in places outside of align* This is kinda unfortunate, as `\end{align*}` insertion is done by texlab themselves **without** any option to turn it off. --- home/kakoune/latex.kak | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/home/kakoune/latex.kak b/home/kakoune/latex.kak index fa261fe..9d26277 100644 --- a/home/kakoune/latex.kak +++ b/home/kakoune/latex.kak @@ -8,20 +8,23 @@ provide-module latex-kak %{ # Create a simple begin block, put the cursors in and remove multi-cursor on exit. define-command -hidden create-begin-block %{ - execute-keys -with-hooks "i\begin{b0}\end{b0}" - execute-keys -with-hooks "b0c" + execute-keys "i\begin{b0}\end{b0}" + execute-keys "b0" + execute-keys -with-hooks "c" hook -once buffer ModeChange .*:normal %{ - execute-keys -with-hooks -with-maps "gl" + execute-keys -with-maps "gl" } } # Create a begin block with the given parameter as block name. define-command -params 1 create-begin-block-with %{ execute-keys "i\begin{b0}\end{b0}" - execute-keys -with-hooks "b0c%arg{1}gl" + execute-keys "b0c%arg{1}" + execute-keys "ok" + execute-keys -with-maps "gl" } # Create a \param{} block and put the cursor in the middle. define-command -params 2 -hidden create-delims %{ - execute-keys -with-hooks "i%arg{1}hZa%arg{2}zli" + execute-keys "i%arg{1}hZa%arg{2}zli" } define-command -params 1 create-block-with %{ create-delims "\%arg{1}{" "}"