-
Notifications
You must be signed in to change notification settings - Fork 10
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
Does not survive session save and restore #56
Comments
Well, I didn't know |
@powerman Ok, same here, times are a bit busy to read through your code and send a PR in coming weeks. What about the minimal information that I ask? 1) full filename+path of current file, 2) way of knowing that current buffer is a vim-plugin-viewdoc's buffer? Don't you already have that information available at your disposal in the plugin somewhere? If you could provide that, then at least I will be able to make it going in my vimrc. Then maybe at a later point a clean PR could be sent. |
In last years there was about 1 commit/year with minor updates, so I don't have viewdoc code base at the top of my head now. AFAIR in most cases (doc sources) we don't have any source file, viewdoc run external tools and gather it output into vim buffer. As for detecting viewdoc buffers - there was some way. One probably depends on concrete viewdoc plugin: usually they define a custom vim-plugin-viewdoc/plugin/viewdoc.vim Lines 279 to 299 in 0a93615
|
@powerman The way I see... if there is no source file, then it would be hard to save state and restore it. At least for the sources like vim help, man pages, etc that do have a file, a function that returns file name would be ideal. A hacky way of checking if its a viewdoc buffer would be to look if a buffer local variable |
I use vim's sessions quite a lot, and this is one big disadvantage that I see in my testing of vim-plugin-viewdoc: The help file opened by it does not survive session save and restore. This disadvantage does not exist for vim help documentation opened using inbuilt
:help
command. User can detect the filetype upon restoring a session and make it behave exactly as if it was opened using:help
and not opened as a file with:e <path_to_file>
(which does not guarantee jumps to work for all references).There are multiple ways to go about creating a perception that vim-plugin-viewdoc's buffer survives across sessions.
At the very least, it would be good to know 2 things:
&filetype
correctly says "help". Trying to do a regex match on file name\[Doc[0-9]+\]
does not look the cleanest.I think this would be sufficient for users who care about making vim-plugin-viewdoc's buffers survive across sessions.
AND perhaps you could add full support by using
SessionLoadPost
auto command to iterate over buffers and convert them to respective vim-plugin-viewdoc buffers & give users a new global variable to enable/disable that functionality.The text was updated successfully, but these errors were encountered: