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

call signature breaks undo #651

Closed
Kareeeeem opened this issue Jan 7, 2017 · 9 comments
Closed

call signature breaks undo #651

Kareeeeem opened this issue Jan 7, 2017 · 9 comments

Comments

@Kareeeeem
Copy link

Issue

When the call_signature option is on it breaks undo.
let g:jedi#show_call_signatures=0 solves it.

Steps to reproduce

Initial state of buffer

x = [1, 2, 3, 4]

blah = 5
  • insert the following in one go, and allow the call signature popup to appear
x = [1, 2, 3, 4]

for i in range(len(x)):
    if i == 2:
        break

blah = 5
  • undo with u.

The buffer now looks like this

x = [1, 2, 3, 4]
    if i == 2:
        break

blah = 5

The for statement is removed but anything after that line remains. No matter how many times I undo.

Versions

  • jedi-vim: 0.10.0
  • Vim / Neovim: VIM - Vi IMproved 8.0 (2016 Sep 12, compiled Dec 15 2016 03:33:53) Included patches: 1-134
  • Python: 3.5.2

Output of the "JediDebugInfo" command (in a Python buffer)

Using Python version: 3

  • sys.version: 3.5.2+ (default, Dec 13 2016, 14:16:35), [GCC 6.2.1 20161124]
  • site module: /usr/lib/python3.5/site.py
    Jedi path: /home/kareem/.vim/plugged/jedi-vim/jedi/jedi/init.py
    Jedi version: 0.10.0
    jedi-vim git version: 80378d8
    jedi git submodule status: 2ba78ab725f1e02dfef8bc50b0204cf656e8ee23 jedi (v0.9.0-547
    -g2ba78ab7)

Output of the "messages" Vim command

Messages maintainer: Bram Moolenaar <Bram@vim.org>
"git-tags" 43L, 1103C
3 fewer lines; before #29  13 seconds ago

Output of "scriptnames" Vim command

  1: /usr/share/vim/vimrc
  2: /usr/share/vim/vim80/debian.vim
  3: ~/.vimrc
  4: /usr/share/vim/vim80/filetype.vim
  5: /usr/share/vim/vim80/ftplugin.vim
  6: /usr/share/vim/vim80/indent.vim
  7: /usr/share/vim/vim80/syntax/syntax.vim
  8: /usr/share/vim/vim80/syntax/synload.vim
  9: /usr/share/vim/vim80/syntax/syncolor.vim
 10: ~/.vim/autoload/plug.vim
 11: /usr/share/vim/vim80/ftoff.vim
 12: ~/.vim/plugged/vim-javascript/ftdetect/javascript.vim
 13: ~/.vim/plugged/nofrils/colors/nofrils-dark.vim
 14: /usr/share/vim/vim80/scripts.vim
 15: ~/.vim/plugged/vim-commentary/plugin/commentary.vim
 16: ~/.vim/plugged/vim-surround/plugin/surround.vim
 17: ~/.vim/plugged/neomake/plugin/neomake.vim
 18: ~/.fzf/plugin/fzf.vim
 19: ~/.vim/plugged/fzf.vim/plugin/fzf.vim
 20: ~/.vim/plugged/editorconfig-vim/plugin/editorconfig.vim
 21: /usr/share/vim/vim80/plugin/getscriptPlugin.vim
 22: /usr/share/vim/vim80/plugin/gzip.vim
 23: /usr/share/vim/vim80/plugin/logiPat.vim
 24: /usr/share/vim/vim80/plugin/manpager.vim
 25: /usr/share/vim/vim80/plugin/matchparen.vim
 26: /usr/share/vim/vim80/plugin/netrwPlugin.vim
 27: /usr/share/vim/vim80/plugin/rrhelper.vim
 28: /usr/share/vim/vim80/plugin/spellfile.vim
 29: /usr/share/vim/vim80/plugin/tarPlugin.vim
 30: /usr/share/vim/vim80/plugin/tohtml.vim
 31: /usr/share/vim/vim80/plugin/vimballPlugin.vim
 32: /usr/share/vim/vim80/plugin/zipPlugin.vim
 33: /usr/share/vim/vim80/ftplugin/python.vim
 34: /usr/share/vim/vim80/indent/python.vim
 35: ~/.vim/plugged/python-docstring-comments/syntax/python.vim
 36: /usr/share/vim/vim80/syntax/python.vim
 37: ~/.vim/plugged/jedi-vim/plugin/jedi.vim
 38: ~/.vim/plugged/jedi-vim/after/syntax/python.vim
 39: ~/.vim/plugged/jedi-vim/autoload/jedi.vim
 40: ~/.vim/plugged/jedi-vim/ftplugin/python/jedi.vim
 41: ~/.vim/plugged/jedi-vim/after/ftplugin/python/jedi.vim
 42: ~/.vim/plugged/vim-python-pep8-indent/indent/python.vim
 43: ~/.vim/plugged/neomake/autoload/neomake/highlights.vim
 44: ~/.vim/plugged/neomake/autoload/neomake/utils.vim
 45: ~/.vim/plugged/neomake/autoload/neomake/signs.vim
 46: ~/.vim/plugged/neomake/autoload/neomake.vim
 47: ~/.vim/plugged/neomake/autoload/neomake/statusline.vim
@blueyed
Copy link
Collaborator

blueyed commented Jan 7, 2017

and allow the call signature popup to appear

Where? For range and len, or just in general somewhere?

@blueyed
Copy link
Collaborator

blueyed commented Jan 7, 2017

An easier test case / related issue appears to be that with the following file, A and Esc after the call signatures appear (i.e. going into insert mode, but not changing anythng), will consider the buffer to be changed/modified:

print(

I'll look into this shortly.

blueyed added a commit to blueyed/jedi-vim that referenced this issue Jan 7, 2017
This uses vim.current.buffer directly, with `:undojoin` before it.

Fixes davidhalter#651.

Note: it uses `silent!` with `undojoin` to work around E790 ("undojoin not
allowed after undo"), although `undo` was not used (AFAIK), but only the
cursor being moved.
@blueyed
Copy link
Collaborator

blueyed commented Jan 8, 2017

@Kareeeeem
Please test #652.
See https://help.github.com/articles/checking-out-pull-requests-locally/ for help on checking it out locally.

@Kareeeeem
Copy link
Author

re: first comment. Any call signature popup.

I'll test out #652 and get back to you.

@Kareeeeem
Copy link
Author

Kareeeeem commented Jan 8, 2017

I'm afraid I'm still encountering the same behavior using the latest commit on your pull request

I simply did

for i in range(x):
    break

allowing the signature popup to show and then undo (multiple times) and was left with the following. It only disappears when I undo all the way to an empty file (undoing much older changes before finally removing the break statement).

    break
Using Python version: 3                                                              
 - sys.version: 3.5.2+ (default, Dec 13 2016, 14:16:35), [GCC 6.2.1 20161124]
 - site module: /usr/lib/python3.5/site.py
Jedi path: /home/kareem/.vim/plugged/jedi-vim/jedi/jedi/__init__.py
Jedi version: 0.10.0
jedi-vim git version: 2e3bdd3
jedi git submodule status:  2ba78ab725f1e02dfef8bc50b0204cf656e8ee23 jedi (v0.9.0-547
-g2ba78ab7)

@blueyed
Copy link
Collaborator

blueyed commented Jan 8, 2017

Weird.
Can you try a minimal vimrc like the following?

set nocp
let &rtp .= ','.expand("$PWD").','.expand("$PWD").'/after'

let g:jedi#show_call_signatures=1

syn on

@blueyed
Copy link
Collaborator

blueyed commented Jan 8, 2017

I've seen the popup for range( in your example, but undo is OK for me, after exiting insert mode after the break.

@Kareeeeem
Copy link
Author

Kareeeeem commented Jan 8, 2017

Odd that it can't be reproduced. I have tried again with the minimal vimrc.

set nocp

call plug#begin('~/.vim/plugged')
Plug 'davidhalter/jedi-vim', {'for': 'python'}
call plug#end()

let g:jedi#show_call_signatures=1

syn on

the initial file

def blah():
    print "hello"

if __name__ == '__main__':
    blah()

insert the following allowing the popup to show

def blah():
    print "hello"

for i in range(5):
    break

if __name__ == '__main__':
    blah()

undo will never remove break. It did before (eventually) as I have persistent undo but not with this minimal vimrc.

this is the jedi debug info

Using Python version: 3

  • sys.version: 3.5.2+ (default, Dec 13 2016, 14:16:35), [GCC 6.2.1 20161124]
  • site module: /usr/lib/python3.5/site.py
    Jedi path: /home/kareem/.vim/plugged/jedi-vim/jedi/jedi/init.py
    Jedi version: 0.10.0
    jedi-vim git version: 2e3bdd3
    jedi git submodule status: 2ba78ab725f1e02dfef8bc50b0204cf656e8ee23 jedi (v0.9.0-547
    -g2ba78ab7)

blueyed added a commit to blueyed/jedi-vim that referenced this issue Jan 25, 2017
This uses vim.current.buffer directly, with `:undojoin` before it.

Fixes davidhalter#651.

Note: it uses `silent!` with `undojoin` to work around E790 ("undojoin not
allowed after undo"), although `undo` was not used (AFAIK), but only the
cursor being moved.
blueyed added a commit to blueyed/jedi-vim that referenced this issue Jan 31, 2017
This uses vim.current.buffer directly, with `:undojoin` before it.

Fixes davidhalter#651.

Note: it uses `silent!` with `undojoin` to work around E790 ("undojoin not
allowed after undo"), although `undo` was not used (AFAIK), but only the
cursor being moved.
blueyed added a commit to blueyed/jedi-vim that referenced this issue Jan 31, 2017
This uses vim.current.buffer directly, with `:undojoin` before it.

Fixes davidhalter#651.

Note: it uses `silent!` with `undojoin` to work around E790 ("undojoin not
allowed after undo"), although `undo` was not used (AFAIK), but only the
cursor being moved.
blueyed added a commit to blueyed/jedi-vim that referenced this issue Feb 11, 2017
This uses vim.current.buffer directly, with `:undojoin` before it.

Fixes davidhalter#651.

Note: it uses `silent!` with `undojoin` to work around E790 ("undojoin not
allowed after undo"), although `undo` was not used (AFAIK), but only the
cursor being moved.
blueyed added a commit to blueyed/jedi-vim that referenced this issue Mar 7, 2017
This uses vim.current.buffer directly, with `:undojoin` before it.

Fixes davidhalter#651.

Note: it uses `silent!` with `undojoin` to work around E790 ("undojoin not
allowed after undo"), although `undo` was not used (AFAIK), but only the
cursor being moved.
blueyed added a commit to blueyed/jedi-vim that referenced this issue May 12, 2017
This uses vim.current.buffer directly, with `:undojoin` before it.

Fixes davidhalter#651.

Note: it uses `silent!` with `undojoin` to work around E790 ("undojoin not
allowed after undo"), although `undo` was not used (AFAIK), but only the
cursor being moved.
blueyed added a commit to blueyed/jedi-vim that referenced this issue Jul 15, 2018
This uses vim.current.buffer directly, with `:undojoin` before it.

Fixes davidhalter#651.

Note: it uses `silent!` with `undojoin` to work around E790 ("undojoin not
allowed after undo"), although `undo` was not used (AFAIK), but only the
cursor being moved.
blueyed added a commit to blueyed/jedi-vim that referenced this issue Jul 15, 2018
This uses vim.current.buffer directly, with `:undojoin` before it.

Fixes davidhalter#651.

Note: it uses `silent!` with `undojoin` to work around E790 ("undojoin not
allowed after undo"), although `undo` was not used (AFAIK), but only the
cursor being moved.
blueyed added a commit to blueyed/jedi-vim that referenced this issue Jul 15, 2018
This uses vim.current.buffer directly, with `:undojoin` before it.

Fixes davidhalter#651.

Note: it uses `silent!` with `undojoin` to work around E790 ("undojoin not
allowed after undo"), although `undo` was not used (AFAIK), but only the
cursor being moved.
blueyed added a commit to blueyed/jedi-vim that referenced this issue Jul 24, 2018
This uses vim.current.buffer directly, with `:undojoin` before it.

Fixes davidhalter#651.

Note: it uses `silent!` with `undojoin` to work around E790 ("undojoin not
allowed after undo"), although `undo` was not used (AFAIK), but only the
cursor being moved.
blueyed added a commit to blueyed/jedi-vim that referenced this issue Jul 25, 2018
This uses vim.current.buffer directly, with `:undojoin` before it.

Fixes davidhalter#651.

Note: it uses `silent!` with `undojoin` to work around E790 ("undojoin not
allowed after undo"), although `undo` was not used (AFAIK), but only the
cursor being moved.
blueyed added a commit to blueyed/jedi-vim that referenced this issue Jul 28, 2018
This uses vim.current.buffer directly, with `:undojoin` before it.

Fixes davidhalter#651.

Note: it uses `silent!` with `undojoin` to work around E790 ("undojoin not
allowed after undo"), although `undo` was not used (AFAIK), but only the
cursor being moved.
blueyed added a commit to blueyed/jedi-vim that referenced this issue Aug 2, 2018
This uses vim.current.buffer directly, with `:undojoin` before it.

Fixes davidhalter#651.

Note: it uses `silent!` with `undojoin` to work around E790 ("undojoin not
allowed after undo"), although `undo` was not used (AFAIK), but only the
cursor being moved.
blueyed added a commit to blueyed/jedi-vim that referenced this issue Dec 26, 2018
This uses vim.current.buffer directly, with `:undojoin` before it.

Fixes davidhalter#651.

Note: it uses `silent!` with `undojoin` to work around E790 ("undojoin not
allowed after undo"), although `undo` was not used (AFAIK), but only the
cursor being moved.
blueyed added a commit to blueyed/jedi-vim that referenced this issue Feb 19, 2019
This uses vim.current.buffer directly, with `:undojoin` before it.

Fixes davidhalter#651.

Note: it uses `silent!` with `undojoin` to work around E790 ("undojoin not
allowed after undo"), although `undo` was not used (AFAIK), but only the
cursor being moved.
blueyed added a commit to blueyed/jedi-vim that referenced this issue Jul 20, 2019
This uses vim.current.buffer directly, with `:undojoin` before it.

Fixes davidhalter#651.

Note: it uses `silent!` with `undojoin` to work around E790 ("undojoin not
allowed after undo"), although `undo` was not used (AFAIK), but only the
cursor being moved.
blueyed added a commit to blueyed/jedi-vim that referenced this issue Aug 18, 2019
This uses vim.current.buffer directly, with `:undojoin` before it.

Fixes davidhalter#651.

Note: it uses `silent!` with `undojoin` to work around E790 ("undojoin not
allowed after undo"), although `undo` was not used (AFAIK), but only the
cursor being moved.
blueyed added a commit to blueyed/jedi-vim that referenced this issue Aug 18, 2019
This uses vim.current.buffer directly, with `:undojoin` before it.

Fixes davidhalter#651.

Note: it uses `silent!` with `undojoin` to work around E790 ("undojoin not
allowed after undo"), although `undo` was not used (AFAIK), but only the
cursor being moved.
blueyed added a commit to blueyed/jedi-vim that referenced this issue Oct 16, 2019
This uses vim.current.buffer directly, with `:undojoin` before it.

Fixes davidhalter#651.

Note: it uses `silent!` with `undojoin` to work around E790 ("undojoin not
allowed after undo"), although `undo` was not used (AFAIK), but only the
cursor being moved.
blueyed added a commit to blueyed/jedi-vim that referenced this issue Oct 21, 2019
This uses vim.current.buffer directly, with `:undojoin` before it.

Fixes davidhalter#651.

Note: it uses `silent!` with `undojoin` to work around E790 ("undojoin not
allowed after undo"), although `undo` was not used (AFAIK), but only the
cursor being moved.
blueyed added a commit to blueyed/jedi-vim that referenced this issue Dec 5, 2019
This uses vim.current.buffer directly, with `:undojoin` before it.

Fixes davidhalter#651.

Note: it uses `silent!` with `undojoin` to work around E790 ("undojoin not
allowed after undo"), although `undo` was not used (AFAIK), but only the
cursor being moved.
blueyed added a commit to blueyed/jedi-vim that referenced this issue Jan 14, 2020
This uses vim.current.buffer directly, with `:undojoin` before it.

Fixes davidhalter#651.

Note: it uses `silent!` with `undojoin` to work around E790 ("undojoin not
allowed after undo"), although `undo` was not used (AFAIK), but only the
cursor being moved.
blueyed added a commit to blueyed/jedi-vim that referenced this issue Feb 3, 2020
This uses vim.current.buffer directly, with `:undojoin` before it.

Fixes davidhalter#651.

Note: it uses `silent!` with `undojoin` to work around E790 ("undojoin not
allowed after undo"), although `undo` was not used (AFAIK), but only the
cursor being moved.
blueyed added a commit to blueyed/jedi-vim that referenced this issue Feb 27, 2020
This uses vim.current.buffer directly, with `:undojoin` before it.

Fixes davidhalter#651.

Note: it uses `silent!` with `undojoin` to work around E790 ("undojoin not
allowed after undo"), although `undo` was not used (AFAIK), but only the
cursor being moved.
blueyed added a commit to blueyed/jedi-vim that referenced this issue Jul 17, 2020
This uses vim.current.buffer directly, with `:undojoin` before it.

Fixes davidhalter#651.

Note: it uses `silent!` with `undojoin` to work around E790 ("undojoin not
allowed after undo"), although `undo` was not used (AFAIK), but only the
cursor being moved.
blueyed added a commit to blueyed/jedi-vim that referenced this issue Jul 17, 2020
This uses vim.current.buffer directly, with `:undojoin` before it.

Fixes davidhalter#651.

Note: it uses `silent!` with `undojoin` to work around E790 ("undojoin not
allowed after undo"), although `undo` was not used (AFAIK), but only the
cursor being moved.
@davidhalter
Copy link
Owner

Same issue as #493. We are trying to get rid of changing the buffer for this feature and are trying to use floating windows.

blueyed added a commit to blueyed/jedi-vim that referenced this issue Jan 2, 2021
This uses vim.current.buffer directly, with `:undojoin` before it.

Fixes davidhalter#651.

Note: it uses `silent!` with `undojoin` to work around E790 ("undojoin not
allowed after undo"), although `undo` was not used (AFAIK), but only the
cursor being moved.
blueyed added a commit to blueyed/jedi-vim that referenced this issue Jan 17, 2022
This uses vim.current.buffer directly, with `:undojoin` before it.

Fixes davidhalter#651.

Note: it uses `silent!` with `undojoin` to work around E790 ("undojoin not
allowed after undo"), although `undo` was not used (AFAIK), but only the
cursor being moved.
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