File tree Expand file tree Collapse file tree 3 files changed +15
-4
lines changed
Expand file tree Collapse file tree 3 files changed +15
-4
lines changed Original file line number Diff line number Diff line change @@ -15,14 +15,18 @@ endfunction
1515
1616fun ! pymode#rope#complete (dot)
1717 if pumvisible ()
18- return " \<C-n> "
18+ if stridx (' noselect' , &completeopt ) != -1
19+ return " \<C-n> "
20+ else
21+ return " "
22+ endif
1923 endif
2024 if a: dot
2125 PymodePython rope.complete (True)
2226 else
2327 PymodePython rope.complete ()
2428 endif
25- return pumvisible () ? " \<C-p>\<Down> " : " "
29+ return pumvisible () && stridx ( ' noselect ' , & completeopt ) != -1 ? " \<C-p>\<Down> " : " "
2630endfunction
2731
2832fun ! pymode#rope#complete_on_dot () " {{{
Original file line number Diff line number Diff line change 1- *pymode.txt* For Vim Version 8.0 Last change: 2017 November 20
1+ *pymode.txt* For Vim Version 8.0 Last change: 2019 March 08
22
33 ____ _ _ ____ _ _ _____ _ _ __ __ _____ ____ ____ ~
44 ( _ \( \/ )(_ _)( )_( )( _ )( \( )___( \/ )( _ )( _ \( ___) ~
@@ -483,6 +483,12 @@ your code. <C-X><C-O> and <C-P>/<C-N> works too.
483483
484484Autocompletion is also called by typing a period in | Insert | mode by default.
485485
486+ If there's only one complete item, vim may be inserting it automatically
487+ instead of using a popup menu. If the complete item which inserted is not
488+ your wanted, you can roll it back use '<c-w> ' in | Insert | mode or setup
489+ 'completeopt' with `menuone` and `noinsert` in your vimrc. .e.g.
490+ >
491+ set completeopt=menuone,noinsert
486492
487493 Turn on code completion support in the plugin *'g:pymode_rope_completion'*
488494>
Original file line number Diff line number Diff line change @@ -94,7 +94,8 @@ def complete(dot=False):
9494 line = env .lines [row - 1 ]
9595 cline = line [:col ] + p_prefix + line [col :]
9696 if cline != line :
97- env .curbuf [row - 1 ] = env .prepare_value (cline , dumps = False )
97+ if 'noinsert' not in env .var ('&completeopt' ):
98+ env .curbuf [row - 1 ] = env .prepare_value (cline , dumps = False )
9899 env .current .window .cursor = (row , col + len (p_prefix ))
99100 env .run ('complete' , col - len (prefix ) + len (p_prefix ) + 1 , proposals )
100101 return True
You can’t perform that action at this time.
0 commit comments