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

g:jedi#popup_select_first=0 selecting last #516

Closed
MikeDacre opened this issue Jan 6, 2016 · 4 comments
Closed

g:jedi#popup_select_first=0 selecting last #516

MikeDacre opened this issue Jan 6, 2016 · 4 comments
Labels

Comments

@MikeDacre
Copy link

I know bugs with g:jedi#popup_select_first have been reported in the past, but I am experiencing a different issue.

let g:jedi#popup_select_first=1 works as expected, but let g:jedi#popup_select_first=0 selects the last item, even if all other plugins are disabled.

See this image:

image

In my vimrc I also have the following completeopt set:

autocmd FileType python setlocal completeopt=menuone,longest,preview

In my vimrc I also have the following completeopt set:

autocmd FileType python setlocal completeopt=menuone,longest,preview

My jedi-vim settings:

let g:jedi#auto_initialization    = 1
if has( 'python3' )
  let g:jedi#force_py_version     = 3
endif
let g:jedi#popup_on_dot           = 1
let g:jedi#auto_vim_configuration = 1
let g:jedi#popup_select_first     = 0
noremap <leader>gg :call jedi#goto_assignments()<cr>
noremap <leader>gd :call jedi#goto_definitions()<cr>
noremap <leader>rn :call jedi#rename()<cr>

Output of :version:

VIM - Vi IMproved 7.4 (2013 Aug 10, compiled Dec 29 2015 00:04:27)
Included patches: 1-944
Compiled by Arch Linux
Huge version with GTK2 GUI.  Features included (+) or not (-):
+acl             +cmdline_info    +emacs_tags      -hangul_input    +menu            +mouse_xterm     +python3         +syntax          +virtualedit     +xsmp_interact
+arabic          +comments        +eval            +iconv           +mksession       +multi_byte      +quickfix        +tag_binary      +visual          +xterm_clipboard
+autocmd         +conceal         +ex_extra        +insert_expand   +modify_fname    +multi_lang      +reltime         +tag_old_static  +visualextra     -xterm_save
+balloon_eval    +cryptv          +extra_search    +jumplist        +mouse           -mzscheme        +rightleft       -tag_any_white   +viminfo         -xpm
+browse          +cscope          +farsi           +keymap          +mouseshape      +netbeans_intg   +ruby            -tcl             +vreplace
++builtin_terms  +cursorbind      +file_in_path    +langmap         +mouse_dec       +path_extra      +scrollbind      +terminfo        +wildignore
+byte_offset     +cursorshape     +find_in_path    +libcall         +mouse_gpm       +perl            +signs           +termresponse    +wildmenu
+cindent         +dialog_con_gui  +float           +linebreak       -mouse_jsbterm   +persistent_undo +smartindent     +textobjects     +windows
+clientserver    +diff            +folding         +lispindent      +mouse_netterm   +postscript      -sniff           +title           +writebackup
+clipboard       +digraphs        -footer          +listcmds        +mouse_sgr       +printer         +startuptime     +toolbar         +X11
+cmdline_compl   +dnd             +fork()          +localmap        -mouse_sysmouse  +profile         +statusline      +user_commands   -xfontset
+cmdline_hist    -ebcdic          +gettext         +lua             +mouse_urxvt     -python          -sun_workshop    +vertsplit       +xim
system vimrc file: "/etc/vimrc"
    user vimrc file: "$HOME/.vimrc"
2nd user vimrc file: "~/.vim/vimrc"
    user exrc file: "$HOME/.exrc"
system gvimrc file: "/etc/gvimrc"
    user gvimrc file: "$HOME/.gvimrc"
2nd user gvimrc file: "~/.vim/gvimrc"
    system menu file: "$VIMRUNTIME/menu.vim"
fall-back for $VIM: "/usr/share/vim"
Compilation: gcc -c -I. -Iproto -DHAVE_CONFIG_H -DFEAT_GUI_GTK  -pthread -I/usr/include/gtk-2.0 -I/usr/lib/gtk-2.0/include -I/usr/include/pango-1.0 -I/usr/include/atk-1.0 -I/
usr/include/cairo -I/usr/include/pixman-1 -I/usr/include/libdrm -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/libpng16 -I/usr/include/pango-1.0 -I/usr/include/freetype2 -I/usr
/include/libpng16 -I/usr/include/harfbuzz -I/usr/include/freetype2 -I/usr/include/libpng16 -I/usr/include/harfbuzz -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -D_FORT
IFY_SOURCE=2  -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1
Linking: gcc   -L. -Wl,-O1,--sort-common,--as-needed,-z,relro -fstack-protector -rdynamic -Wl,-export-dynamic -Wl,-E -Wl,-rpath,/usr/lib/perl5/core_perl/CORE  -Wl,-O1,--sort-
common,--as-needed,-z,relro -L/usr/local/lib -Wl,--as-needed -o vim   -lgtk-x11-2.0 -lgdk-x11-2.0 -lpangocairo-1.0 -latk-1.0 -lcairo -lgdk_pixbuf-2.0 -lgio-2.0 -lpangoft2-1.0
-lpango-1.0 -lgobject-2.0 -lglib-2.0 -lfontconfig -lfreetype -lSM -lICE -lXt -lX11 -lXdmcp -lSM -lICE  -lm -lncurses -lelf -lnsl   -lacl -lattr -lgpm -ldl  -L/usr/lib -llua
-Wl,-E -Wl,-rpath,/usr/lib/perl5/core_perl/CORE -Wl,-O1,--sort-common,--as-needed,-z,relro -fstack-protector-strong -L/usr/local/lib  -L/usr/lib/perl5/core_perl/CORE -lperl -
lpthread -lnsl -ldl -lm -lcrypt -lutil -lc  -L/usr/lib/python3.5/config-3.5m -lpython3.5m -lpthread -ldl -lutil -lm  -lruby -lpthread -lgmp -ldl -lcrypt -lm  -L/usr/lib

Output of :JediDebugInfo:

Using Python version: 3

Also, I installed jedi with Vundle and it is up to date as of a few minutes ago (commit dc23f0b)

Thanks for your help!

@MikeDacre
Copy link
Author

Huh, just fixed it by adding:

else
    return ""

to if g:jedi#popup_select_first && stridx(&completeopt, 'longest') > -1

Creating pull request now.

@blueyed
Copy link
Collaborator

blueyed commented Jun 3, 2017

Could reproduce this.

I think we might just remove the special handling based on g:jedi#popup_select_first?!
noselect in completeopt should control this instead.

@blueyed blueyed added the bug label Jun 3, 2017
blueyed added a commit to blueyed/jedi-vim that referenced this issue Jun 4, 2017
Temporarily set &completeopt before triggering automatic completion,
instead of handling different settings afterwards.
`g:jedi#popup_select_first` is used to use `noinsert` instead of
`noselect`.

Fixes davidhalter#516.
Fixes davidhalter#706.
@blueyed
Copy link
Collaborator

blueyed commented Jun 4, 2017

Please try #715.

@blueyed
Copy link
Collaborator

blueyed commented Aug 6, 2017

@MikeDacre
Can you try #715, please?

blueyed added a commit to blueyed/jedi-vim that referenced this issue Aug 6, 2017
Temporarily set &completeopt before triggering automatic completion,
instead of handling different settings afterwards.
`g:jedi#popup_select_first` is used to use `noinsert` instead of
`noselect`.

Fixes davidhalter#516.
Fixes davidhalter#706.
@blueyed blueyed closed this as completed in a46ea1a Aug 7, 2017
blueyed added a commit to blueyed/jedi-vim that referenced this issue Aug 11, 2019
    * pythonx/jedi 60415033...35e5cf2c (106):
      > A small Changelog improvement
      > Cleanup Changelog for the next release
      > Make it possible to access functions that were inherited, see #1347
      > Messed up a Windows test
      > Again a small windows issue fixed.
      > Need to escape the path backslash for windows slashes
      > Make it possible to access properties again
      > A small compatibility fix
      > Fix an issue with type vars that might have been a problem for other things as well
      > Don't add quotes after paths if they are already there
      > A small speed optimization that helps a lot with sys.version_info >= (3, 0) patterns in typeshed
      > Remove an unnecessary isinstance usage
      > Make CompiledValue lazy
      > A python 2 fix
      > Fix an error that occured because of some refactorings
      > Fix one more os.path.join issue
      > Fix more issues with os.path path completion
      > Make join detection much easier
      > Fix some remaining issues with file path completions
      > A few more tests for path completions (join)
      > Fix quote completions for os.path.join path completions
      > Fix first param argument of os.path.join file completions
      > Fix arglist/trailer issues
      > in os.path.join completions, directories should not end in a slash
      > Make some file path completions in os.path.join work
      > Fix os.path.join static value gathering
      > os.path.sep should always have a clear value
      > Fix string name completion for stuff like dirname and abspath
      > Fix bytes issue with file path adding
      > Python 2 compatibility
      > Make __file__ return the correct value
      > Fix string additions when used in certain ways
      > Make string additions work for file path completion
      > Fix interpeter project path
      > Fix the REPL completer for file path completions
      > Fix a few more file name completion cases
      > A first iteration for file path completions
      > Fix a test failure
      > Add Definition.execute, fixes davidhalter#1076
      > Add tests to show that davidhalter#516 is not working, yet
      > List possible Definition.type in its docstring, fixes davidhalter#1069.
      > Start writing the Changelog for 0.15.0
      > 3.8-dev should not be allowed to fail
      > Skip more Python 2 tests
      > Skipping of tests was done the wrong way again
      > Skip the right tests
      > Parameter.kind is not avaialble in Python 3.5
      > Fix Python 2 test issues
      > Add a few docstrings to make some things clearer
      > Add ParamDefinition.kind, fixes #1361
      > Make it possible to format a param to a string, fixes davidhalter#1074
      > Add another test for signature annotations
      > Add Signature.to_string() with proper tests, fixes davidhalter#779, fixes davidhalter#780
      > Test infer_default
      > Use a helper to create definitions
      > Add a execute_annotation option to infer_annotation
      > Test infer_annotation
      > Make it possible for users to infer annotations/defaults
      > A first iteration of adding signatures to the API, fixes #1139
      > Fix a caching issue
      > Forgot the right resolve_stars parameters in one place
      > Cache getting resolved param names
      > Turn around resolve_stars, it shouldn't by default be resolved
      > Remove a class that is not needed anymore
      > Revert "Use __str__ instead of to_string"
      > Fix the last remaining issues with function signature
      > overloaded_functions should be private
      > Use __str__ instead of to_string
      > Better repr for CallSignature
      > Fix some minor signature issues
      > Remove the unused function signature_matches
      > Fix signatures for __init__ calls when used with supers, fixes #1163
      > Fix some issues for args resolving in method calls
      > Remove a bit of code that i sprobably unused
      > Move get_signatures from Function to FunctionMixin
      > Merge the signature changes
      > Remove an import
      > Small refactoring
      > Skipped Python 2 Interpreter tests the wrong way
      > Remove a paragraph in docs that was arguing that stubs and generics (and other things) were not properly supported, fixes davidhalter#1012
      > Fix partial signatures for MixedObject
      > Fix partial signatures, fixes #1371
      > Make sure with a test that the staticmethod signature is also correct
      > Fix classmethod signature, fixes davidhalter#498
      > Deal with annotation on *args and **kwargs correctly, fixes davidhalter#980
      > Use LazyContextWrapper more
      > Very small refactoring
      > Fix for failing assertion on native modules Issue #1354 (#1370)
      > Skip numpydoc tests for Python 2
      > Remove code that didn't mean anything
      > Fix docstrings for wrapped functions, fixes davidhalter#906
      > Fix an isue about dict ordering in Python before 3.6.
      > Make it clearer when get_param is used.
      > A small dataclass refactoring
      > Evaluate annotations for dataclasses when infer is called on param
      > Get inheritance of dataclass right
      > A first working iteration of dataclass signatures, fixes #1213
      > Remove an unused function
      > Dataclass progress
      > Add enum changes to changelog
      > Fix a recursion error about getting metaclasses
      > One test about recursion issues only applied to Python 2
      > Use class filters in instances differently so metaclass plugins work, fixes davidhalter#1090
      > First step in working with metaclasses in plugins, see davidhalter#1090.
      > Refactor the plugin registry
      > Remove classes from plugins and use decorators instead
davidhalter pushed a commit that referenced this issue Aug 11, 2019
    * pythonx/jedi 60415033...35e5cf2c (106):
      > A small Changelog improvement
      > Cleanup Changelog for the next release
      > Make it possible to access functions that were inherited, see #1347
      > Messed up a Windows test
      > Again a small windows issue fixed.
      > Need to escape the path backslash for windows slashes
      > Make it possible to access properties again
      > A small compatibility fix
      > Fix an issue with type vars that might have been a problem for other things as well
      > Don't add quotes after paths if they are already there
      > A small speed optimization that helps a lot with sys.version_info >= (3, 0) patterns in typeshed
      > Remove an unnecessary isinstance usage
      > Make CompiledValue lazy
      > A python 2 fix
      > Fix an error that occured because of some refactorings
      > Fix one more os.path.join issue
      > Fix more issues with os.path path completion
      > Make join detection much easier
      > Fix some remaining issues with file path completions
      > A few more tests for path completions (join)
      > Fix quote completions for os.path.join path completions
      > Fix first param argument of os.path.join file completions
      > Fix arglist/trailer issues
      > in os.path.join completions, directories should not end in a slash
      > Make some file path completions in os.path.join work
      > Fix os.path.join static value gathering
      > os.path.sep should always have a clear value
      > Fix string name completion for stuff like dirname and abspath
      > Fix bytes issue with file path adding
      > Python 2 compatibility
      > Make __file__ return the correct value
      > Fix string additions when used in certain ways
      > Make string additions work for file path completion
      > Fix interpeter project path
      > Fix the REPL completer for file path completions
      > Fix a few more file name completion cases
      > A first iteration for file path completions
      > Fix a test failure
      > Add Definition.execute, fixes #1076
      > Add tests to show that #516 is not working, yet
      > List possible Definition.type in its docstring, fixes #1069.
      > Start writing the Changelog for 0.15.0
      > 3.8-dev should not be allowed to fail
      > Skip more Python 2 tests
      > Skipping of tests was done the wrong way again
      > Skip the right tests
      > Parameter.kind is not avaialble in Python 3.5
      > Fix Python 2 test issues
      > Add a few docstrings to make some things clearer
      > Add ParamDefinition.kind, fixes #1361
      > Make it possible to format a param to a string, fixes #1074
      > Add another test for signature annotations
      > Add Signature.to_string() with proper tests, fixes #779, fixes #780
      > Test infer_default
      > Use a helper to create definitions
      > Add a execute_annotation option to infer_annotation
      > Test infer_annotation
      > Make it possible for users to infer annotations/defaults
      > A first iteration of adding signatures to the API, fixes #1139
      > Fix a caching issue
      > Forgot the right resolve_stars parameters in one place
      > Cache getting resolved param names
      > Turn around resolve_stars, it shouldn't by default be resolved
      > Remove a class that is not needed anymore
      > Revert "Use __str__ instead of to_string"
      > Fix the last remaining issues with function signature
      > overloaded_functions should be private
      > Use __str__ instead of to_string
      > Better repr for CallSignature
      > Fix some minor signature issues
      > Remove the unused function signature_matches
      > Fix signatures for __init__ calls when used with supers, fixes #1163
      > Fix some issues for args resolving in method calls
      > Remove a bit of code that i sprobably unused
      > Move get_signatures from Function to FunctionMixin
      > Merge the signature changes
      > Remove an import
      > Small refactoring
      > Skipped Python 2 Interpreter tests the wrong way
      > Remove a paragraph in docs that was arguing that stubs and generics (and other things) were not properly supported, fixes #1012
      > Fix partial signatures for MixedObject
      > Fix partial signatures, fixes #1371
      > Make sure with a test that the staticmethod signature is also correct
      > Fix classmethod signature, fixes #498
      > Deal with annotation on *args and **kwargs correctly, fixes #980
      > Use LazyContextWrapper more
      > Very small refactoring
      > Fix for failing assertion on native modules Issue #1354 (#1370)
      > Skip numpydoc tests for Python 2
      > Remove code that didn't mean anything
      > Fix docstrings for wrapped functions, fixes #906
      > Fix an isue about dict ordering in Python before 3.6.
      > Make it clearer when get_param is used.
      > A small dataclass refactoring
      > Evaluate annotations for dataclasses when infer is called on param
      > Get inheritance of dataclass right
      > A first working iteration of dataclass signatures, fixes #1213
      > Remove an unused function
      > Dataclass progress
      > Add enum changes to changelog
      > Fix a recursion error about getting metaclasses
      > One test about recursion issues only applied to Python 2
      > Use class filters in instances differently so metaclass plugins work, fixes #1090
      > First step in working with metaclasses in plugins, see #1090.
      > Refactor the plugin registry
      > Remove classes from plugins and use decorators instead
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

2 participants