Closed noscript closed 3 years ago
I got same. Since redir cannot be nested, the only solution to fix this problem is to merge this pull-request.
If you worry about conpatibility issue:
diff --git a/autoload/indent_guides.vim b/autoload/indent_guides.vim
index 482d0ad..001d4d1 100644
--- a/autoload/indent_guides.vim
+++ b/autoload/indent_guides.vim
@@ -246,9 +246,13 @@ endfunction
" Returns: 'Normal xxx guifg=#323232 guibg=#ffffff'
"
function! indent_guides#capture_highlight(group_name)
- redir => l:output
- exe "silent hi " . a:group_name
- redir END
+ if exists("*execute")
+ let l:output = execute("silent hi " . a:group_name)
+ else
+ redir => l:output
+ exe "silent hi " . a:group_name
+ redir END
+ endif
let l:output = substitute(l:output, "\n", "", "")
return l:output
I have this problem too. Would love for this PR to be considered!
@alerque FYI, seems that this PR is still useful.
Thanks for the tip @gou4shi1, I fired up a new PR based on this since the original poster here seems to have deleted their fork. I'd appreciate any review comments there.
I know it's been more than a month of Mondays since this fix was proposed, but it's now available on master
if anybody still cares, @tmm @mattn — and thanks for the contribution @noscript.
Using lambdas with
execute()
will produce an error if any of the subsequent code uses:redir
. According to Vim docs (:h execute()
):In my case I have a mapping that causes indent guides to refresh. This PR replaces use of
:redir
withexecute()
equivalent.How to reproduce Long version:
Short version:
Vim output: