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

use guru's -modified flag #944

Merged
merged 4 commits into from
Aug 2, 2016
Merged

Conversation

bhcleek
Copy link
Collaborator

@bhcleek bhcleek commented Jul 16, 2016

Pass the -modified flag and the buffer contents to guru on stdin when
the buffer has been modified instead of having to manage a temp file
manually.

Pass the -modified flag and the buffer contents to guru on stdin when
the buffer has been modified instead of having to manage a temp file
manually.
@fatih
Copy link
Owner

fatih commented Jul 17, 2016

Just tested locally, but get this error when I jump when my file is modified:

image 2016-07-16 at 8 42 26 pm

@bhcleek
Copy link
Collaborator Author

bhcleek commented Jul 17, 2016

I see the same behavior on the latest release, too, though; it wasn't introduced in this PR. The problem is due to

exec 'edit '.filename
. I think that drop should be used instead of edit, but I'm not sure. I started to fix it, but then noticed #928, which fixes the problem. However, #928 has a different problem that I'll describe there.

@bhcleek
Copy link
Collaborator Author

bhcleek commented Jul 26, 2016

@fatih In light of your discovery that :drop is only available when compiled with a GUI (#928), I went ahead and resolved jumping to a definition when the buffer is modified by using :split when no other option has been specified.

@fatih
Copy link
Owner

fatih commented Jul 31, 2016

If you try to jump to the same file we get this error:
image

@bhcleek
Copy link
Collaborator Author

bhcleek commented Jul 31, 2016

I duplicated what you were seeing and thought it was a separable task, so I reverted bc000e0. All the problems you see with modified buffers also exist on master, but there's other problems on master with modified buffers that the guru changes here address, so I ended up fixing the problems associated with jumping to a definitions from a modified buffer, regardless of whether the definition is in the same buffer or a different buffer.

PTAL

if bufloaded(filename) == 0
tab split
let l:fname = fnamemodify(expand("%"), ':p:gs?\\?/?')
if filename != l:fname
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can early return here, but I'll do that with a follow up commit. Thanks

@fatih fatih merged commit 445e5bf into fatih:master Aug 2, 2016
@fatih
Copy link
Owner

fatih commented Aug 2, 2016

Thanks @bhcleek, great addition 👍

@bhcleek bhcleek deleted the feature-guru-modified branch August 2, 2016 20:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants