Skip to content

Commit

Permalink
bugfix for typing_ctx
Browse files Browse the repository at this point in the history
  • Loading branch information
jayli committed Jan 15, 2024
1 parent 081dee5 commit 9f0252e
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions autoload/easycomplete/pum.vim
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ let s:has_scrollbar = 0
" easycomplete#pum#CompleteInfo() 的返回和 complete_info() 保持一致
let s:selected_i = 0
let s:curr_items = []
" 类似 b:typing_ctx,为了避免干扰,这里只给 pum 使用
" 类似 g:easycomplete_typing_ctx,为了避免干扰,这里只给 pum 使用
let s:original_ctx = {}
" 当前编辑窗口的原始配置
let s:original_opt = {}
Expand Down Expand Up @@ -136,11 +136,11 @@ function! s:OpenPum(startcol, lines)
let winid = s:OpenFloatWindow(s:pum_buffer, pum_opts, hl)
let s:pum_window = winid
call s:hl()
let s:original_ctx = deepcopy(b:typing_ctx)
let s:original_ctx = deepcopy(g:easycomplete_typing_ctx)
else
" 已经存在的 windowid 用 nvim_win_set_config
call nvim_win_set_config(s:pum_window, pum_opts)
let s:original_ctx = deepcopy(b:typing_ctx)
let s:original_ctx = deepcopy(g:easycomplete_typing_ctx)
doautocmd <nomodeline> User easycomplete_pum_completechanged
endif
call s:reset()
Expand Down Expand Up @@ -174,8 +174,8 @@ function! easycomplete#pum#WinScrolled()
endfunction

function! s:TabNineHLNormalize(menu_items)
if empty(b:typing_ctx) | return a:menu_items | endif
let typing_word = get(b:typing_ctx, "typing", "")
if empty(g:easycomplete_typing_ctx) | return a:menu_items | endif
let typing_word = get(g:easycomplete_typing_ctx, "typing", "")
let count_o = min([len(a:menu_items), 5])
for k in range(count_o)
let item = a:menu_items[k]
Expand Down

0 comments on commit 9f0252e

Please sign in to comment.