Skip to content

Commit

Permalink
add readme file
Browse files Browse the repository at this point in the history
  • Loading branch information
jayli committed Jan 1, 2024
1 parent 63b1756 commit 04e70c4
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
9 changes: 7 additions & 2 deletions autoload/easycomplete/pum.vim
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,7 @@ function! s:select(line_index)
let s:selected_i = l:line_index
" TODO here 这里在 kind 开头的时候,cursorline 高亮的位置出错
" 原因是特殊字符的长度问题,strlen("ˆ") == 2 而不是1
if g:easycomplete_pum_format[0] == "kind"
if g:easycomplete_pum_format[0] == "kind" && g:easycomplete_nerd_font == 1
try
let bufline_str = getbufline(s:pum_buffer, s:selected_i)[0]
let kind_char = bufline_str[2]
Expand Down Expand Up @@ -741,7 +741,12 @@ function! s:MapFunction(key, val)
\ "menu" : "^" . get(a:val, "menu", "") . "^"
\ }
let ret = []
for item in g:easycomplete_pum_format
if g:easycomplete_nerd_font
let format_s = g:easycomplete_pum_format
else
let format_s = ["abbr", "kind", "menu"]
endif
for item in format_s
call add(ret, " " . get(format_object, item, ""))
endfor
" let ret = [
Expand Down
2 changes: 1 addition & 1 deletion custom-config.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ vim.g.easycomplete_kind_icons = {
parameter = "󰏗",
}

-- Custom pum format
-- Custom pum format. Only avilable with `g:easycomplete_nerd_font == 1` in nvim
vim.g.easycomplete_pum_format = ["kind", "abbr", "menu"]

-- Define highlight group for fuzzy matched charactors.
Expand Down

0 comments on commit 04e70c4

Please sign in to comment.