Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

刚装上这个插件 source ~/.vimrc 后就出现报错信息:“E969: 属性类型 FittenSuggestion 已定义” #29

Open
cuncaojin opened this issue Jul 26, 2024 · 2 comments

Comments

@cuncaojin
Copy link

处理 /home/cuncaojin/.vimrc[96]../usr/share/vim/vim90/syntax/syntax.vim[19]../usr/share/vim/vim90/syntax/synload.vim[19]..ColorScheme 自动命令 "*"..function SetSuggestionStyle 时发生错误:
第 6 行:
E969: 属性类型 FittenSuggestion 已定义
E969: 属性类型 FittenSuggestion 已定义
E969: 属性类型 FittenSuggestion 已定义
2024-07-27_05-09

@cuncaojin
Copy link
Author

VIM - Vi IMproved 9.0 (2022 Jun 28, 编译于 May 10 2022 08:40:37)
包含补丁: 1-749

@luozhiya
Copy link
Contributor

@cuncaojin

您试下这个 patch,看是否解决问题了

diff --git a/plugin/fittencode.vim b/plugin/fittencode.vim
index 1d1610e..b0337fa 100644
--- a/plugin/fittencode.vim
+++ b/plugin/fittencode.vim
@@ -9,11 +9,13 @@ let g:loaded_fittencode = 1
 let s:hlgroup = 'FittenSuggestion'
 function! SetSuggestionStyle() abort
     if &t_Co == 256
-        hi def FittenSuggestion guifg=#808080 ctermfg=244
+        hi FittenSuggestion guifg=#808080 ctermfg=244
     else
-        hi def FittenSuggestion guifg=#808080 ctermfg=8
+        hi FittenSuggestion guifg=#808080 ctermfg=8
+    endif
+    if empty(prop_type_get(s:hlgroup))
+        call prop_type_add(s:hlgroup, {'highlight': s:hlgroup})
     endif
-    call prop_type_add(s:hlgroup, {'highlight': s:hlgroup})
 endfunction
 
 function! Fittenlogin(account, password)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants