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
15
15
16
16
fun ! pymode#rope#complete (dot)
17
17
if pumvisible ()
18
- return " \<C-n> "
18
+ if stridx (' noselect' , &completeopt ) != -1
19
+ return " \<C-n> "
20
+ else
21
+ return " "
22
+ endif
19
23
endif
20
24
if a: dot
21
25
PymodePython rope.complete (True)
22
26
else
23
27
PymodePython rope.complete ()
24
28
endif
25
- return pumvisible () ? " \<C-p>\<Down> " : " "
29
+ return pumvisible () && stridx ( ' noselect ' , & completeopt ) != -1 ? " \<C-p>\<Down> " : " "
26
30
endfunction
27
31
28
32
fun ! 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
2
2
3
3
____ _ _ ____ _ _ _____ _ _ __ __ _____ ____ ____ ~
4
4
( _ \( \/ )(_ _)( )_( )( _ )( \( )___( \/ )( _ )( _ \( ___) ~
@@ -483,6 +483,12 @@ your code. <C-X><C-O> and <C-P>/<C-N> works too.
483
483
484
484
Autocompletion is also called by typing a period in | Insert | mode by default.
485
485
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
486
492
487
493
Turn on code completion support in the plugin *'g:pymode_rope_completion'*
488
494
>
Original file line number Diff line number Diff line change @@ -94,7 +94,8 @@ def complete(dot=False):
94
94
line = env .lines [row - 1 ]
95
95
cline = line [:col ] + p_prefix + line [col :]
96
96
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 )
98
99
env .current .window .cursor = (row , col + len (p_prefix ))
99
100
env .run ('complete' , col - len (prefix ) + len (p_prefix ) + 1 , proposals )
100
101
return True
You can’t perform that action at this time.
0 commit comments