]> gitweb.fluxo.info Git - rhatto/dotfiles/vim.git/commitdiff
Fix: rename nerdtree_workarounds plugin to session_workarounds
authorSilvio Rhatto <rhatto@riseup.net>
Sun, 28 Jul 2024 14:40:22 +0000 (11:40 -0300)
committerSilvio Rhatto <rhatto@riseup.net>
Sun, 28 Jul 2024 14:40:22 +0000 (11:40 -0300)
vim.dot.link/plugin/session_workarounds.vim [moved from vim.dot.link/plugin/nerdtree_workarounds.vim with 82% similarity]

similarity index 82%
rename from vim.dot.link/plugin/nerdtree_workarounds.vim
rename to vim.dot.link/plugin/session_workarounds.vim
index 60e4a1c5c4888376c4211f340e57d323454ac975..be51942b2692240fdd0d97889689650be91dfe06 100644 (file)
@@ -1,4 +1,4 @@
-" nedtree_workaroungs.vim - NERDTree and session restoration workarounds
+" session_workarounds.vim - Session restoration workarounds
 "
 " Author: Silvio Rhatto <rhatto@riseup.net>
 "
@@ -7,8 +7,8 @@
 "
 " Useful after restoring sessions between screen size changes (such
 " as when you share sessions between different computers).
-function FixNERDTreeWidth()
-  " Make sure NERDTree is focuses
+function FixWindowWidths()
+  " Make sure NERDTree is focused
   execute ":NERDTreeFocus"
 
   " Set a fixed width
@@ -18,11 +18,11 @@ function FixNERDTreeWidth()
   wincmd l
 endfunction
 
-" In case you want to invoke FixNERDTreeWidth explicitly
-command! -bang FixNERDTreeWidth :call FixNERDTreeWidth()
+" In case you want to invoke FixWindowWidths explicitly
+command! -bang FixWindowWidths :call FixWindowWidths()
 
-" Fix NERDTree width on all tabs
-function FixAllNERDTreeWidths()
+" Fix window widths on all tabs
+function FixAllWindowWidths()
   " Make sure to run this only once
   if exists("did_fixed_nerdtree_widths")
     return
@@ -31,7 +31,7 @@ function FixAllNERDTreeWidths()
   " Save the last active window
   let l:current_win = win_getid()
 
-  tabdo :call FixNERDTreeWidth()
+  tabdo :call FixWindowWidths()
 
   " Restore the active window
   call win_gotoid(l:current_win)
@@ -75,9 +75,10 @@ function FixWindowHeights()
     endif
 endfunction
 
+" Restore all window sizes
 function RestoreWindowSizes()
   call FixWindowHeights()
-  call FixAllNERDTreeWidths()
+  call FixAllWindowWidths()
 endfunction
 
 " Fix all window sizes
@@ -88,5 +89,5 @@ augroup workaround
 
   " This seems to fire only once, but even when there's no session to be
   " restored.
-  "autocmd workaround VimEnter * call FixAllNERDTreeWidths()
+  "autocmd workaround VimEnter * call FixAllWindowWidths()
 augroup END