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

On session restore, text scrolls out of screen at top (also: NERD trees don't persist correctly) #40

Open
xolox opened this issue May 4, 2013 · 3 comments

Comments

@xolox
Copy link
Owner

xolox commented May 4, 2013

In issue #19 @diego898 reports the following two unrelated problems:

Things seem to be working although there is two slightly strange things:

  • The current directory on NERDTree is not saved with the session. It always starts on ~/myname/Desktop, the directory I make gvim start out of by the shortcut I use. Vim's cwd changes quickly however, due to things in my vimrc that makes its current directory match that of the open file.
  • Upon startup, both nerdtree and the file that is shown (correctly coming over from my last session which is good) are both shown at their very very bottom. In other words, a file with lines 1-30, starts with line 30 at the very top of my screen with vim showing me ~ for 70 lines? NERDTree also starts "too high" as it were. A quick gg fixes it, just found it a little strange.

Since these are new problems I'm closing #19 and using this new issue to keep track of them instead.

@xolox
Copy link
Owner Author

xolox commented May 4, 2013

The current directory on NERDTree is not saved with the session. It always starts on ~/myname/Desktop, the directory I make gvim start out of by the shortcut I use. Vim's cwd changes quickly however, due to things in my vimrc that makes its current directory match that of the open file.

This sounds like a bug, in which case it should be fixed. I'll take a look at the code to see if I can find anything amiss.

Upon startup, both nerdtree and the file that is shown (correctly coming over from my last session which is good) are both shown at their very very bottom. In other words, a file with lines 1-30, starts with line 30 at the very top of my screen with vim showing me ~ for 70 lines? NERDTree also starts "too high" as it were. A quick gg fixes it, just found it a little strange.

I've seen this problem before, on multiple platforms and multiple versions of Vim, but never got to the bottom of it. I'd like to get this fixed but currently wouldn't know how to fix it.

@diego898
Copy link

diego898 commented May 6, 2013

let me know if there is anything I can do!

@xolox
Copy link
Owner Author

xolox commented May 12, 2013

let me know if there is anything I can do!

It would help if you can provide the following information:

  • A session script (hint: :ViewSession) which exhibits the problem when you load it;
  • The tab page number where the NERDTree window with the wrong directory is located;
  • The pathname of the directory you expected to open;
  • The pathname of the directory that was actually opened.

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

2 participants