From 04e70c4255edef8b78fe6a3d96db5cdc1790c928 Mon Sep 17 00:00:00 2001 From: lijing00333 Date: Mon, 1 Jan 2024 11:35:05 +0800 Subject: [PATCH] add readme file --- autoload/easycomplete/pum.vim | 9 +++++++-- custom-config.md | 2 +- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/autoload/easycomplete/pum.vim b/autoload/easycomplete/pum.vim index c7ca1dff..b4586003 100644 --- a/autoload/easycomplete/pum.vim +++ b/autoload/easycomplete/pum.vim @@ -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] @@ -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 = [ diff --git a/custom-config.md b/custom-config.md index b2addfa2..a9c7589a 100644 --- a/custom-config.md +++ b/custom-config.md @@ -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.