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

neovim stacktrace when there is no history #44

Open
dsummersl opened this issue Dec 15, 2016 · 11 comments
Open

neovim stacktrace when there is no history #44

dsummersl opened this issue Dec 15, 2016 · 11 comments
Labels

Comments

@dsummersl
Copy link
Collaborator

"__Mundo__" [New File]
Error detected while processing function mundo#MundoToggle[1]..<SNR>290_MundoToggle[11]..<SNR>290_MundoOpen[31]..<SNR>290_MundoPython[2]..provider#python3#Call:
line   18:
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/Users/danesummers/environment/vim/bundle/gundo.vim/autoload/mundo.py", line 107, in MundoRenderGraph
    nodesData
  File "/Users/danesummers/environment/vim/bundle/gundo.vim/autoload/mundo/graphlog.py", line 218, in generate
    util._undo_to(current)
  File "/Users/danesummers/environment/vim/bundle/gundo.vim/autoload/mundo/util.py", line 34, in _undo_to
    vim().command('silent undo %d' % int(n))
  File "/usr/local/lib/python3.5/site-packages/neovim/api/nvim.py", line 218, in command
    return self.request('nvim_command', string, **kwargs)
  File "/usr/local/lib/python3.5/site-packages/neovim/api/nvim.py", line 131, in request
    res = self._session.request(name, *args, **kwargs)
  File "/usr/local/lib/python3.5/site-packages/neovim/msgpack_rpc/session.py", line 98, in request
    raise self.error_wrapper(err)
neovim.api.nvim.NvimError: b'Vim(undo):E830: Undo number 1 not found'
Error detected while processing function mundo#MundoToggle[1]..<SNR>290_MundoToggle[11]..<SNR>290_MundoOpen[31]..<SNR>290_MundoPython:
line    2:
E171: Missing :endif
Error detected while processing function mundo#MundoToggle[1]..<SNR>290_MundoToggle:
line   11:
E171: Missing :endif
@simnalamburt
Copy link
Owner

simnalamburt commented Dec 15, 2016

Oops it's a big problem. I didn't know this since I do not use neovim.

Since all vim plugin should work fine also in neovim, probably it's a bug of neovim. Maybe we can do both report this problem to the neovim and workaround this bug in vim-mundo.

@wsdjeg
Copy link
Contributor

wsdjeg commented Dec 15, 2016

@dsummersl I use neovim, and it works well for me , what is your reproduce step?

@dsummersl
Copy link
Collaborator Author

Struggling to figure out how to reproduce. It has happened to me a few times in the past (I presume, I've seen similar stack traces but I didn't copy the traces the last times, so I can't be 100% sure). What I know thus far:

  • It happens for files with no history.
  • Normally a file with no history would have 1 undo. :echo undotree() there should normally only have 1 undo entry with a level of 0. The stack trace here shows that mundo is attempting to go to level 1.

@wsdjeg
Copy link
Contributor

wsdjeg commented Dec 15, 2016

I just create a new file by echo "" > test/test.txt, then use nvim open such file, and echo undotree(), open moundo. here is the pic.
2016-12-15-19 52 12

@dsummersl
Copy link
Collaborator Author

Yeah, I've tried that too...and using it on a read only file too. I'm not sure how to trigger it. Again, this doesn't happen 'normally' - but there is a stack trace - so its happened! :)

I think it has happened with file I edit under version control. If I work on branch A for a file, and then switch to branch B(so that whatever undotree() state that was valid for the file on branch A gets thrown away by vim, b/c the file has changed - I guess this is only true for files that are different on the two branches)

@dsummersl
Copy link
Collaborator Author

I'll try to make it happen today.

@vimeitor
Copy link

I can reproduce it fairly consistently. An example:

Open a file
Delete a char
Save
Undo
Save
Run "set undoreload=0 | edit"
Delete a char
Save
Undo
Save
Run "set undoreload=0 | edit"
Run mundo

set undoreload=0 | edit basically discards the undo history for the current file. Let me know if you can reproduce the problem :)

@dsummersl
Copy link
Collaborator Author

thanks @vimeitor I'll give that a shot

@vimeitor
Copy link

I forgot to say that this is not something that is exclusive of neovim, as I can reproduce it in vim8, as well.

@dsummersl
Copy link
Collaborator Author

@vimeitor I've merged in a fix that I believe corrects the issue; do let me know if you run into more problems.

@vimeitor
Copy link

I'm afraid I can still reproduce the issue with the same steps as before. Do not worry about it; there's no rush into fixing this (at least from my side). I might take a look at it in a few days if I get some time, although I have very little experience with vimscript besides the small functions that I have here and there on my vimrc.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants