-
-
Notifications
You must be signed in to change notification settings - Fork 6.3k
[RDY] Add curdir as a default viewoption (vim-patch:8.0.128) #7447
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
👍 There's already a "curdir" option so "lcd" or "lcurdir" makes sense. |
@justinmk, now that I think about it would "localcurdir" make more sense since "curdir" is the accepted nomenclature for "cd"? |
It isn't really. It's more a question of following the local pattern of the other flag names for this specific option. More generally across all options and the codebase there's no consistent nomenclature. "localcurdir" is fine too. |
So far the patch seems to work. I'm open for comments on naming, fixes, etc. |
Awesome, thanks a lot! |
I concur with @blueyed: looks like an awesome improvement. Might be worth submitting upstream too. |
This is really nice. |
Needs a test. Could use You can run the test locally like this:
|
src/nvim/ex_docmd.c
Outdated
if (wp->w_localdir != NULL) { | ||
|
||
/* Do not save if the current flag is view options and and the local | ||
* directory option not set set |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
typos
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed.
end | ||
end | ||
lfs.rmdir(view_dir) | ||
lfs.rmdir(local_dir) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
helpers.rmdir()
should be more robust / avoids the need for lines 26-31.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed
2a1a2c7
to
70248a0
Compare
after_each(function() | ||
-- Remove any views created in the view directory | ||
rmdir(view_dir) | ||
lfs.rmdir(local_dir) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Forgot to remove the lfs
? :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, either function would be fine. However it might actually be best to keep lfs in there since we are assuming the local_dir
to be empty and lfs would error if it was not.
local_dir
is only used for the ":lcd" option.
I have marked the PR as ready. Notably, QuickBuild seems to have a single different (seemingly unrelated) test failure on different architectures every time I rebase (or --amend & --force). The changeset a39c8b7 on master where I rebased on to also was merged in with a different test failure from Quickbuild on a different architecture. |
Bram merged it upstream, but named it Can you adapt to match upstream, remove the vim_diff.txt change, and include |
I'll change the code and option to match the patch Bram merged upstream. (ref: vim/vim#2316) @jamessan Does |
Anywhere in the commit message is fine. |
vim-patch:8.0.128 The option enables the current local directory set by ":lcd" to be saved to views which is the current default behaviour. The option can be removed to disable this behaviour.
70248a0
to
dc77539
Compare
Thanks for updating. Patch number was @EricR86 @blueyed do we want the default to not include "curdir"? I suspect it won't break anything important. #7435 (comment) sounds like the current default behavior is rarely desired. |
Merged. Thanks @EricR86 ! |
The flag enables the current local directory set by ":lcd" to be saved to views which is the current default behaviour. The option can be removed to disable this behaviour. closes #7435 vim-patch:8.0.1289
FEATURES: a6de144 'viewoptions': add "curdir" flag neovim#7447 b6a603f node.js remote-plugin support neovim#7458 f5d4da0 :checkhealth : validate 'runtimepath' neovim#7526 FIXES: e6beb60 :terminal : fix crash on resize neovim#7547 f19e5d6 work around gnome-terminal memory leak neovim#7573 07931ed 'guicursor': use DECSCUSR for xterm-likes neovim#7576 f185c73 'os_open: UV_EINVAL on NULL filename' neovim#7561 e8af34d win: provider: Detect(): return *.cmd path neovim#7577 eacd788 :checkhealth : fix check for npm and yarn neovim#7569 a43a573 health.vim: normalize slashes for script path neovim#7525 69e3308 cmake: install runtime/rgb.txt d0b05e3 runtime: syntax error in `runtime/syntax/tex.vim` neovim#7518 55d8967 tutor: some fixes neovim#7510 CHANGES: 9837a9c remove legacy alias to `v:count` neovim#7407 c5f001a runtime: revert netrw update neovim#7557 67e4529 defaults: scrollback=10000 neovim#7556 881f9e4 process_close(): uv_unref() detached processes neovim#7539
I would vote for yes - but am not sure if it is worth to be incompatible with Vim there. |
I have an obvious bias in terms of having the default viewoptions not including "curdir". As @blueyed has mentioned, if someone is explicitly changing their viewoptions the "curdir" option will often be omitted anyway. |
* 'master' of https://github.com/neovim/neovim: (148 commits) vim-patch:8.0.0283 version bump NVIM v0.2.2 tui: setrgbf/setrgbb: emit semicolons for VTE 'viewoptions': add "curdir" flag neovim#7447 win: provider: Detect(): return *.cmd path (neovim#7577) os_nodetype: rework os_open, os_stat: UV_EINVAL on NULL filename tui: 'guicursor': use DECSCUSR for xterm-likes (neovim#7576) lint neovim#7562 :checkhealth: fix check for npm and yarn (neovim#7569) doc: Fix pathshorten() example (neovim#7571) health.vim: define highlights as `default` (neovim#7560) runtime: revert netrw update (neovim#7557) defaults: scrollback=10000 (neovim#7556) doc: test/README.md: migrate wiki info (neovim#7552) vim-patch:8.0.0227 (neovim#7548) test/unit/path_spec: expect correct buffer size (neovim#7514) health.vim: normalize slashes for script path (neovim#7525) :terminal : fix crash on resize (neovim#7547) ...
The option enables the current local directory set by ":lcd" to be saved
to views which is the current default behaviour. The option can be
removed to disable this behaviour.
This addresses Issue #7435
This fix also addresses issues in other plugins:
vim-stay - Issue 10
fzf - Issue 1085