aboutsummaryrefslogtreecommitdiffstats
path: root/bundle/insert-layout/plugin
diff options
context:
space:
mode:
authorTeddy Wing2023-03-19 04:14:08 +0100
committerTeddy Wing2023-03-19 19:52:34 +0100
commitebf7b2e4677ac4e8cad77fc4a7efa0fc9cf39ada (patch)
treefc030d7b39860fc5840fa945f08608ec47ab1dbb /bundle/insert-layout/plugin
parentb26b4c48f6bface96ef0d365d6ed7e89f2ef199c (diff)
downloaddotvim-ebf7b2e4677ac4e8cad77fc4a7efa0fc9cf39ada.tar.bz2
insert-layout: Don't remove autocmds in `InsertLayoutOn`
I assumed that I should be removing existing autocmds before adding new ones. If you ran the `:InsertLayout` command more than once, I didn't want old autocmds to stick around. The line was commented out because it fails on the first call to `:InsertLayout`, since at that point the `insert_layout` augroup doesn't exist. On closer inspection, however, it turns out that the old autocmds are not retained when running `:InsertLayout` subsequent times. Rather, the newly-defined ones are overwriting the old ones. So we don't need to worry about removing the old autocmds before adding new ones.
Diffstat (limited to 'bundle/insert-layout/plugin')
-rw-r--r--bundle/insert-layout/plugin/insert_layout.vim2
1 files changed, 0 insertions, 2 deletions
diff --git a/bundle/insert-layout/plugin/insert_layout.vim b/bundle/insert-layout/plugin/insert_layout.vim
index 2600da1..f5b93d3 100644
--- a/bundle/insert-layout/plugin/insert_layout.vim
+++ b/bundle/insert-layout/plugin/insert_layout.vim
@@ -55,8 +55,6 @@ def InsertLayoutOff(): void
enddef
def InsertLayoutOn(layout: string): void
- # InsertLayoutOff()
-
# autocmd insert_layout InsertEnter <buffer> OnInsertEnter(layout)
# autocmd insert_layout InsertLeave <buffer> OnInsertLeave()
autocmd_add([