@@ -280,30 +280,31 @@ function s:isModifiedSinceLastCall()
280
280
let posPrev = s: posLast
281
281
let nLinesPrev = s: nLinesLast
282
282
let textPrev = s: textLast
283
- let postTextPrev = s: postTextLast
284
283
endif
285
284
let s: posLast = getpos (' .' )
286
285
let s: nLinesLast = line (' $' )
287
- let s: textLast = s: getCurrentText ()
288
- let s: postTextLast = s: getPostText ()
286
+ let s: textLast = getline (' .' )
289
287
if ! exists (' posPrev' )
290
288
return 1
291
289
elseif posPrev[1 ] != s: posLast [1 ] || nLinesPrev != s: nLinesLast
292
290
return (posPrev[1 ] - s: posLast [1 ] == nLinesPrev - s: nLinesLast )
293
- elseif textPrev == # s: textLast || postTextPrev !=# s: postTextLast
291
+ elseif textPrev == # s: textLast
294
292
return 0
295
- elseif has (' gui' ) && has (' multi_byte' ) && ! has (' win32' ) && ! has (' win64' )
296
- " NOTE: auto-popup causes a strange behavior when XIM is working
297
- return empty (s: textLast ) || char2nr (matchstr (s: textLast , ' .$' )) < 0x80
293
+ elseif posPrev[2 ] > s: posLast [2 ]
294
+ return 1
295
+ elseif has (' gui_running' ) && has (' multi_byte' )
296
+ " NOTE: auto-popup causes a strange behavior when IME/XIM is working
297
+ return posPrev[2 ] + 1 == s: posLast [2 ]
298
298
endif
299
- return 1
299
+ return posPrev[ 2 ] != s: posLast [ 2 ]
300
300
endfunction
301
301
302
302
"
303
- function s: makeCurrentBehaviorSet (behavsLast, cursorMoved )
304
- if exists (' behavsLast[s:iBehavs].repeat' ) && behavsLast[s: iBehavs ].repeat
305
- let behavs = [ behavsLast[s: iBehavs ] ]
306
- elseif a: cursorMoved
303
+ function s: makeCurrentBehaviorSet ()
304
+ let modified = s: isModifiedSinceLastCall ()
305
+ if exists (' s:behavsCurrent[s:iBehavs].repeat' ) && s: behavsCurrent [s: iBehavs ].repeat
306
+ let behavs = [ s: behavsCurrent [s: iBehavs ] ]
307
+ elseif modified
307
308
let behavs = copy (exists (' g:acp_behavior[&filetype]' )
308
309
\ ? g: acp_behavior [&filetype ]
309
310
\ : g: acp_behavior [' *' ])
@@ -336,8 +337,7 @@ function s:feedPopup()
336
337
return ' '
337
338
endif
338
339
endif
339
- let s: behavsCurrent = s: makeCurrentBehaviorSet (
340
- \ s: behavsCurrent , s: isModifiedSinceLastCall ())
340
+ let s: behavsCurrent = s: makeCurrentBehaviorSet ()
341
341
if empty (s: behavsCurrent )
342
342
call s: finishPopup (1 )
343
343
return ' '
0 commit comments