File tree Expand file tree Collapse file tree 1 file changed +9
-2
lines changed
Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change 121121
122122 finishUpdate : function ( data , first ) {
123123 if ( this . data ) CodeMirror . signal ( this . data , "update" ) ;
124- if ( data && this . data && CodeMirror . cmpPos ( data . from , this . data . from ) ) data = null ;
125- this . data = data ;
126124
127125 var picked = ( this . widget && this . widget . picked ) || ( first && this . options . completeSingle ) ;
128126 if ( this . widget ) this . widget . close ( ) ;
127+
128+ if ( data && this . data && isNewCompletion ( this . data , data ) ) return ;
129+ this . data = data ;
130+
129131 if ( data && data . list . length ) {
130132 if ( picked && data . list . length == 1 ) {
131133 this . pick ( data , 0 ) ;
137139 }
138140 } ;
139141
142+ function isNewCompletion ( old , nw ) {
143+ var moved = CodeMirror . cmpPos ( nw . from , old . from )
144+ return moved > 0 && old . to . ch - old . from . ch != nw . to . ch - nw . from . ch
145+ }
146+
140147 function parseOptions ( cm , pos , options ) {
141148 var editor = cm . options . hintOptions ;
142149 var out = { } ;
You can’t perform that action at this time.
0 commit comments