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

Incremental substitution preview (inccommand) partially overridden by indent-blankline #434

Open
Frederick888 opened this issue Jun 10, 2022 · 6 comments
Labels
wontfix This will not be worked on

Comments

@Frederick888
Copy link

Given file

int main() {
    int foo;
    int bar;
}

// vim: set expandtab tabstop=8 shiftwidth=4:

Type :%s/^ \+int/char but don't hit enter yet, by default (inccommand=nosplit) it looks like:
image

Now use the vimrc below and do the same thing

set runtimepath^=~/.vim runtimepath+=~/.vim/after
let &packpath = &runtimepath

call plug#begin('~/.vim/plugged')
Plug 'lukas-reineke/indent-blankline.nvim'
call plug#end()

set nocompatible
set updatetime=300
set cmdheight=2

" indent-blankline.nvim
set list
set listchars=tab:\ \ ,trail:-,nbsp:+
highlight IndentBlanklineIndent1 guifg=#70363A gui=nocombine
highlight IndentBlanklineIndent2 guifg=#72603E gui=nocombine
highlight IndentBlanklineIndent3 guifg=#4C623C gui=nocombine
highlight IndentBlanklineIndent4 guifg=#2B5B61 gui=nocombine
highlight IndentBlanklineIndent5 guifg=#305878 gui=nocombine
highlight IndentBlanklineIndent6 guifg=#633C6E gui=nocombine
let g:indent_blankline_char_list = ['|', '¦', '', '']
let g:indent_blankline_char_highlight_list = ['IndentBlanklineIndent1', 'IndentBlanklineIndent2', 'IndentBlanklineIndent3',
      \ 'IndentBlanklineIndent4', 'IndentBlanklineIndent5', 'IndentBlanklineIndent6']
let g:indent_blankline_show_first_indent_level = v:false
let g:indent_blankline_show_trailing_blankline_indent = v:false
let g:indent_blankline_use_treesitter = v:true
let g:indent_blankline_filetype_exclude = ['man', 'help', 'fugitive']
let g:indent_blankline_buftype_exclude = ['terminal', 'quickfix', 'nowrite']
let g:indent_blankline_max_indent_increase = 1
let g:indent_blankline_indent_level = 8

It looks like:
image

@lukas-reineke
Copy link
Owner

I don't think there is anything in the plugin I can do to fix this.
This has to be addressed in Neovim core.

@Frederick888
Copy link
Author

@lukas-reineke Is there already a Neovim issue I can subscribe to? If not could you help file one? Thank you!

@lukas-reineke
Copy link
Owner

I don't think so. I'm not even sure how this could be solved.
Indent blankline has no way to hook into what the preview is doing. And the built-in substitute preview doesn't know indent blankline exists.

You could just disable indent blankline when you enter cmdline mode.

au CmdlineEnter * IndentBlanklineDisable
au CmdlineLeave * IndentBlanklineEnable

@Frederick888
Copy link
Author

That's unfortunate. So instead of a bug report, do you think this can be a feature request to Neovim something along the lines of e.g. 'allow inccommand to override virtual texts' or 'make intermediate inccommand results visible to plugins'?

@lukas-reineke
Copy link
Owner

Yeah, probably the second one. But this would be pretty complex I imagine

@Frederick888
Copy link
Author

I'm probably asking too much for an edge case but could you outline what you need from Neovim in a feature request, just to see if it gets us somewhere?

Absolutely no rush of cos.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
wontfix This will not be worked on
Projects
None yet
Development

No branches or pull requests

2 participants