Skip to content
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

Prevent changing directory when restoring view. #11

Closed
sergei-dyshel opened this issue Jul 29, 2015 · 5 comments
Closed

Prevent changing directory when restoring view. #11

sergei-dyshel opened this issue Jul 29, 2015 · 5 comments
Assignees
Milestone

Comments

@sergei-dyshel
Copy link

According to my observations and Vim's help mkview always adds lcd ... command to created file. This can lead to unexpected current directory changes when same file is opened in different "sessions" (projects etc.)
A possible workaround would be to remove lcd line from the generated script.

@kopischke
Copy link
Collaborator

Ah, yes, the lcd issue. Actually, it’s a known quirk of :mkview I documented in the plugin help’s FAQTroubleshooting section. The maddening thing about it is that it is both inconsistent (according to the Vim help, it should only store actually set local working directories, but that seems to be wishful thinking: I’ve noticed it often, but, crucially, not always, switches when there is no need to) and hard to fix (due to the train wreck Vim’s working directory API is).

I’ll ponder approaches to fixing this (again – it’s been sitting in the private Trello for this plugin for quite some time now), but I can’t promise anything ATM.

@kopischke kopischke self-assigned this Jul 29, 2015
@kopischke
Copy link
Collaborator

Until I get around to this, you might be interested in the workaround I suggested in #10 .

@sergei-dyshel
Copy link
Author

Thanks! This is much better than the workaround that I've been using - save cwd on Vim start and cd to it on each file opening.

kopischke added a commit that referenced this issue Dec 19, 2015
Best we can do until Vim gets a sane working directory API (e.g. the
getcwd() patch lands). Closes #11.
@kopischke kopischke added this to the Release 1.4.0 milestone Apr 3, 2016
kopischke added a commit that referenced this issue Apr 3, 2016
Best we can do until Vim gets a sane working directory API (e.g. the
getcwd() patch lands). Closes #11.
kopischke added a commit that referenced this issue Apr 16, 2016
Best we can do until Vim gets a sane working directory API (e.g. the
getcwd() patch lands). Closes #11.
@blueyed
Copy link

blueyed commented Apr 24, 2016

JFI: Neovim has tab local directories now additionally: neovim/neovim@5ebffaa

@kopischke
Copy link
Collaborator

Thanks, but I was aware of that, having been part of the discussion that led to the feature ;). Unluckily, neither that feature nor Vim’s recent getcwd() patch affect my previous arguments much. I have been pondering a different approach for a while now, and might integrate it into the 1.5 release. Speaking of which, did you have an opportunity to look at #13?

kopischke added a commit that referenced this issue Jun 10, 2018
Expose a [wg]:viewignore setting that allows to ignore one, or both, of
arglist munging and local working directory changes hardwired into view
session files.

Closes #11 and obviates 8433f83.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants