On 2021-08-01, Gabriel Dupras wrote: > it became apparent that they would be more useful if they were > window-local > instead. > > Can you explain why?
In short, the choice of 'virtualedit' setting depends on the editing task more than on the file type or buffer contents. Sometimes, when I'm viewing diffs in relatively narrow vertically-split windows, the differences are near the ends of lines, so I scroll the windows to see those differences. Without virtualedit=all, moving the cursor up or down to a shorter line can cause the windows to scroll back to the left, which is really annoying. So I created a set of autocommands to fix that problem by setting virtualedit=all whenever 'diff' is set. When 'virtualedit' was global, that would set it in all my windows, whether they were viewing a diff or not. When I proposed making 'virtualedit' global-local, it wasn't clear to either Bram or me whether it would be better to make it buffer-local or window-local. I was more familiar with buffer-local settings, so I went that route. I changed my autocommands to set virtualedit=all only in those buffers involved in a diff. However, after using it a lot recently with Fugitive, I discovered some cases where I had a buffer open both in a regular window and in a window where it was being diffed against another version of the file. The automatic virtualedit=all setting was also being applied to the same buffer in the regular window, which is not what I wanted. So there I had an example of a case where window-local was better, and I couldn't think of a case where buffer-local would be better, so I changed it from buffer-local to window-local. Regards, Gary -- -- You received this message from the "vim_dev" maillist. Do not top-post! Type your reply below the text you are replying to. For more information, visit http://www.vim.org/maillist.php --- You received this message because you are subscribed to the Google Groups "vim_dev" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/vim_dev/20210801215113.GC16854%40phoenix.
