Skip to content

Commit f5fb337

Browse files
Takeshi NISHIDAvim-scripts
authored andcommitted
Version 2.12.1: - Changed to avoid a strange behavior with Microsoft IME.
1 parent bf28f29 commit f5fb337

File tree

2 files changed

+17
-14
lines changed

2 files changed

+17
-14
lines changed

autoload/acp.vim

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -280,30 +280,31 @@ function s:isModifiedSinceLastCall()
280280
let posPrev = s:posLast
281281
let nLinesPrev = s:nLinesLast
282282
let textPrev = s:textLast
283-
let postTextPrev = s:postTextLast
284283
endif
285284
let s:posLast = getpos('.')
286285
let s:nLinesLast = line('$')
287-
let s:textLast = s:getCurrentText()
288-
let s:postTextLast = s:getPostText()
286+
let s:textLast = getline('.')
289287
if !exists('posPrev')
290288
return 1
291289
elseif posPrev[1] != s:posLast[1] || nLinesPrev != s:nLinesLast
292290
return (posPrev[1] - s:posLast[1] == nLinesPrev - s:nLinesLast)
293-
elseif textPrev ==# s:textLast || postTextPrev !=# s:postTextLast
291+
elseif textPrev ==# s:textLast
294292
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]
298298
endif
299-
return 1
299+
return posPrev[2] != s:posLast[2]
300300
endfunction
301301

302302
"
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
307308
let behavs = copy(exists('g:acp_behavior[&filetype]')
308309
\ ? g:acp_behavior[&filetype]
309310
\ : g:acp_behavior['*'])
@@ -336,8 +337,7 @@ function s:feedPopup()
336337
return ''
337338
endif
338339
endif
339-
let s:behavsCurrent = s:makeCurrentBehaviorSet(
340-
\ s:behavsCurrent, s:isModifiedSinceLastCall())
340+
let s:behavsCurrent = s:makeCurrentBehaviorSet()
341341
if empty(s:behavsCurrent)
342342
call s:finishPopup(1)
343343
return ''

doc/acp.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -283,6 +283,9 @@ SPECIAL THANKS *acp-thanks*
283283
==============================================================================
284284
CHANGELOG *acp-changelog*
285285

286+
2.12.1
287+
- Changed to avoid a strange behavior with Microsoft IME.
288+
286289
2.12
287290
- Added g:acp_behaviorKeywordIgnores option.
288291
- Added g:acp_behaviorUserDefinedMeets option and removed

0 commit comments

Comments
 (0)