Make autoread more reliable

Sat, 25 Feb 2023 13:01:43 -0500

author
Meredith Howard <mhoward@roomag.org>
date
Sat, 25 Feb 2023 13:01:43 -0500
changeset 1050
6fb014427493
parent 1049
3f01468ffc32
child 1051
5c69bfa6dc3c

Make autoread more reliable

.config/nvim/lazy-lock.json file | annotate | diff | comparison | revisions
.config/nvim/plugin/vimrc/autocmds.vim file | annotate | diff | comparison | revisions
--- a/.config/nvim/lazy-lock.json
+++ b/.config/nvim/lazy-lock.json
@@ -10,7 +10,7 @@
   "editorconfig-vim": { "branch": "master", "commit": "1d54632f7fcad38df8e428f349bc58b15af4b206" },
   "fidget.nvim": { "branch": "main", "commit": "9dc6d15fdb877b2fb09ea0ba2dfde9beccb5965a" },
   "indent-blankline.nvim": { "branch": "master", "commit": "8299fe7703dfff4b1752aeed271c3b95281a952d" },
-  "lazy.nvim": { "branch": "main", "commit": "c778b7aa04c484e1536ba219e71f2fd0f05302aa" },
+  "lazy.nvim": { "branch": "main", "commit": "d13fe9353594bce58a5b9fc6d7166d183e0fc035" },
   "lualine.nvim": { "branch": "master", "commit": "0050b308552e45f7128f399886c86afefc3eb988" },
   "mason-lspconfig.nvim": { "branch": "main", "commit": "d2d55255a0295ba0a75ef2dd5535e4c89c46e773" },
   "mason.nvim": { "branch": "main", "commit": "47e9f6bc4c5bb3d6453949f07b8280c725ef7490" },
--- a/.config/nvim/plugin/vimrc/autocmds.vim
+++ b/.config/nvim/plugin/vimrc/autocmds.vim
@@ -3,7 +3,10 @@ augroup vimrc
 
   autocmd TermOpen * startinsert
 
-  autocmd WinLeave * if !pumvisible() | stopinsert | endif
+  autocmd WinLeave,FocusLost * if !pumvisible() | stopinsert | endif
+
+  " complement to autoread?
+  autocmd FocusGained * silent! checktime
 
   " complement to autowriteall
   autocmd FocusLost * silent! wa

mercurial