Skip to content

Commit

Permalink
fix: use InsertLeave instead of TextChangedI for save (#88)
Browse files Browse the repository at this point in the history
  • Loading branch information
argshook authored Jan 4, 2024
1 parent f2d9d75 commit 555c487
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lua/gp/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1356,8 +1356,8 @@ M.prep_md = function(buf)
vim.api.nvim_command("setlocal noswapfile")
-- better text wrapping
vim.api.nvim_command("setlocal wrap linebreak")
-- auto save on TextChanged, TextChangedI
vim.api.nvim_command("autocmd TextChanged,TextChangedI <buffer=" .. buf .. "> silent! write")
-- auto save on TextChanged, InsertLeave
vim.api.nvim_command("autocmd TextChanged,InsertLeave <buffer=" .. buf .. "> silent! write")

-- register shortcuts local to this buffer
buf = buf or vim.api.nvim_get_current_buf()
Expand Down

0 comments on commit 555c487

Please sign in to comment.