-
-
Save akiradeveloper/3378402 to your computer and use it in GitHub Desktop.
| Error detected while processing function <SNR>26_IndentGuidesToggle..indent_guides#toggle..indent_guides#enable..indent_guides#init_script_vars..indent_guides#capture_highlight: | |
| line 2: | |
| E411: highlight group not found: Normal | |
| Error detected while processing function indent_guides#process_autocmds..indent_guides#enable..indent_guides#init_script_vars..indent_guides#capture_highlight: |
akira@Paptimus> find . | xargs grep -in normal /.vimbundle/vim-indent-guides s:color_hex_bg_pat
./doc/indent_guides.txt:254: * Added support for gVim themes that don't specify a hi Normal guibg
./autoload/indent_guides.vim:114: let l:hi_normal_guibg = ''
./autoload/indent_guides.vim:116: " capture the backgroud color from the normal highlight
./autoload/indent_guides.vim:117: if s:hi_normal =
./autoload/indent_guides.vim:119: let l:hi_normal_guibg = matchstr(s:hi_normal, s:color_hex_bg_pat)
./autoload/indent_guides.vim:121: elseif s:hi_normal =~ s:color_name_bg_pat
./autoload/indent_guides.vim:123: let l:color_name = matchstr(s:hi_normal, s:color_name_bg_pat)
./autoload/indent_guides.vim:124: let l:hi_normal_guibg = color_helper#color_name_to_hex(l:color_name)
./autoload/indent_guides.vim:131: if l:hi_normal_guibg =~ s:color_hex_pat
./autoload/indent_guides.vim:133: let l:hi_odd_bg = indent_guides#lighten_or_darken_color(l:hi_normal_guibg)
./autoload/indent_guides.vim:180: let s:hi_normal = indent_guides#capture_highlight('Normal')
./autoload/indent_guides.vim:182: " remove 'font=' from the s:hi_normal string (only seems to happen on Vim startup in Windows)
./autoload/indent_guides.vim:183: let s:hi_normal = substitute(s:hi_normal, ' font=[A-Za-z0-9:]+', "", "")
./autoload/indent_guides.vim:204: echo 's:hi_normal = ' . s:hi_normal
./autoload/indent_guides.vim:234:" Example: indent_guides#capture_highlight('normal')
./autoload/indent_guides.vim:235:" Returns: 'Normal xxx guifg=#323232 guibg=#ffffff
silent hiというのはhighlightのことかな.
https://sites.google.com/site/fudist/Home/vim-nihongo-ban/vim-color
同じようなコードで色設定してる.
redir => l:output
exe "silent hi " . a:group_name
redir END というのは?
囲まれた中のコマンドの出力を変数に格納するという意味のようである.
:hi Normal
Normal xxx cleared
こうなる. hi Normalはあるようである.
:highlight Normal
Normal xxx cleared
やはり, highlightの略である. こんなことを略して可読性を落とすとか, プログラマがバカである.
いるディレクトリによって違うな.
vim-indent-guidesにいながら autoload/indent-guides.vimを開いてると, :hi Normalが認識されるけど,
~ にいると認識されない.
Normalはないが, Numberとかならあるようだ. Normalというのはそもそもどこで定義されたものなのだ?
その一つ上の.vimbundleをpwdにしても, autoload/indent-guides.vimをopenしたらhi Normalが通った.
openすることに意味がありそう
プラグインのバグではなく, .pyでは, Normalが定義されていないという設定側のバグと判明した.
.c .md. .vimなどでは出来る. .pyはなぜか出来ない. 言語によって定義されているものらしい.
vimfilerと相性が悪いのか?
一度 vimファイルを開いたあとだったらうまくいく.
$vim から vimfilerで e test.c はダメ.
$vim .vimrc と無駄に開いてからならおk
ghcmod-vimのChangelog.mdみたいなわけわからんファイルを一回経由してからでもうまくいく.
ようするに, 一回騒ぎ出すと止まらないが, 最初に黙らせておけばあとは永遠に黙るというクソ設計になってるのか. これはプラグインのコードが悪いと直感する.
経由した, ではなく, $vim ChangeLog.mdで初期化時に開いてる.
mdやvimスクリプトファイルはおkで, pyやcはダメというわけわからん仕様?
僕の勘では, filetypeの問題だと思う.
mdやvimにはNormalが定義されている.
filetypeの設定はバッファローカルであるべきだと思うが, グローバルにNormalが設定される.
だから, mdやvimスクリプトを開いた時にNormalが設定されて,
後に, 設定されて「いない」cやpyを開いた時にも有効のように判断される.
$vim test.hsからスタートしても問題がない.
これは確定か.
[123] akira@Paptimus> find-grep . capture_highlight ~/.vimbundle/vim-indent-guides
let s:hi_normal = indent_guides#capture_highlight('Normal')
" Example: indent_guides#capture_highlight('normal')
function! indent_guides#capture_highlight(group_name)