Comments (18)
To clarify, wilder
doesn't hijack or remap /
(unless you use a mapping for wilder#start_from_normal_mode()
). It uses CmdlineEnter
to detect that the /
or :
cmdline has been entered.
What is happening here is that vim-visual-multi
remaps /
and when multi
mode is entered, the statusline is changed to show additional info for multi
mode. wilder
is drawing over the statusline, which is causing the conflict here.
For triggering wilder
on a keybinding, you can use
" remove the wilder#enable_cmdline_enter() call
cmap <expr> <F1> wilder#main#start()
wilder
will then start only after <F1>
is pressed.
This can be followed up with another mapping
nmap g/ /<F1>
which would avoid conflicting with the /
mapping of vim-visual-multi
.
from wilder.nvim.
Ah, I think I understand now. thank you, I will try your suggestions
from wilder.nvim.
vim-visual-multi
exposes enough information to recreate the statusline so an alternative would be to add that information to wilder#wildmenu_renderer()
.
Very rough example to demonstrate:
let s:Wildmenu_renderer = wilder#wildmenu_renderer(({
\ 'left': [{-> s:vm()}, wilder#previous_arrow()],
\ 'right': [wilder#next_arrow()],
\ }))
function! s:foo()
if !exists('b:visual_multi')
return ''
endif
let v = b:VM_Selection.Vars
let vm = VMInfos()
let color = '%#VM_Extend#'
try
if v.insert
if vm.Insert.replace
let [ mode, color ] = [ 'V-R', '%#VM_Mono#' ]
else
let [ mode, color ] = [ 'V-I', '%#VM_Cursor#' ]
endif
else
let mode = { 'n': 'V-M', 'v': 'V', 'V': 'V-L', "\<C-v>": 'V-B' }[mode()]
endif
catch
let mode = 'V-M'
endtry
let mode = exists('v.statusline_mode') ? v.statusline_mode : mode
let patterns = string(vm.patterns)[:(winwidth(0)-30)]
return printf(' %s %s %s %s ', mode, vm.ratio, patterns, vm.status)
endfunction
For reference: https://github.com/mg979/vim-visual-multi/blob/f994695813ebaecc9e37c7ea216c65d9cd659767/autoload/vm/themes.vim#L100-L126
from wilder.nvim.
I'm not sure but I don't think the problem is just the statusline getting covered up, because it also functionally doesn't work.
It reverts back to just searching the document, without doing the vim-visual-multi things.
from wilder.nvim.
Can you paste your config here?
from wilder.nvim.
My whole config is actually here on github: https://github.com/indianBoy42/lunarvim
the wilder config is in lua/lv-wilder/init.lua
from wilder.nvim.
Could you also list steps to reproduce?
from wilder.nvim.
BTW: disabling wilder#enable_cmdline_enter()
and enabling wilder separately seems to work, which is what is on the latest commit in the repo
from wilder.nvim.
To reproduce the problem
- uncomment out
wilder#enable_cmdline_enter()
firstly - Visually select some region of test
- enter
/
to enter vim-visual-multi "Visual Regex" - the vim-visual-multi statusline would flicker briefly and the regex search will act like a vanilla vim search
- if
wilder#enable_cmdline_enter()
is disabled then after step 3, you would be able to type some search and when you hit enter, the found regions will be added as selections in vim-visual-multi
from wilder.nvim.
I'm not able to reproduce this - am I missing a keymapping (I'm using the default g:VM_leader
\\
)?
- Visually selecting a region and entering
/
doesn't enterVM-REGEX
mode, it's Vim's default Visual mode - Visually selecting a region and entering
\\/
entersVM-REGEX
mode VM-REGEX
mode is the same as searching with/
, after entering your search with<CR>
:
a. If there's one or more matches, it goes back toV-M
mode with the matches added to selections
b. If there's no match across the whole buffer, aPattern not found
error is thrown, and it goes back toVM-REGEX
mode
c. If there's no match within the lines of the visual selection, but a match in the buffer, there's no error thrown and it goes back to normal mode (likely a bug?)
d. Note that matches also have to start after the cursor
e. Matches are searched within the lines where the visual selection starts and stops, so it's possible to have a match outside the visual selection if it's on the same line- If
wilder
is active, there's no difference in the behavior, other than the statusline being drawn over
Can I confirm my observations are correct?
from wilder.nvim.
For point one I have remapped "/" in visual mode to do VM-REGEX, sorry for not mentioning that (relevant config)
point 2 is correct for the default mapping
point 3 is how it should work
point 4 is where we diverge for some reason, after searching it doesn't go to V-M mode, it goes to normal mode for me, which it shouldnt do. This only happens if wilder is active, either from cmdline_enter or from wilder#main#start()
also I have noticed that the search highlighting is a bit weird with wilder active, the highlight disappears as I type, although it shows up permanently after I hit <CR>
. I don't know if this is expected/related
from wilder.nvim.
Regarding the highlights, see #30.
Can you check if Step 3c is being reached? The match has to start after the cursor and be within the lines of the visual selection.
e.g.
|f|oobar
If f
is the visual selection, foo
is not considered a match and it would go back to normal mode. This occurs with or without wilder
. I'm using a minimal config with vim-visual-multi
as the only plugin.
" set to wherever vim-plug was installed
set runtimepath^=~/.vim/
call plug#begin('~/.vim/plugins')
Plug 'mg979/vim-visual-multi'
call plug#end()
let g:VM_maps = {}
let g:VM_maps["Visual Regex"] = "/"
from wilder.nvim.
No 3c isn't being reached, I am searching for something that definitely has a match in the visual selection region
I just tried to implement the fix from #30, I changed to use wildmenu_renderer
instead of popupmenu_renderer
and now VM-REGEX works. Switching back makes it stop working again
The popupmenu renderer uses a buffer right? to change the contents does vim technically switch out of the file buffer? This would rip us out of any visual-multi mode (V-M or VM-REGEX)
from wilder.nvim.
I have encountered this problem of BufLeave/BufExit autocmds being run due to popup windows like that (compe autocompletion windows for example). It is annoying but I suppose it means that popupmenu_renderer is just incompatible
from wilder.nvim.
I think some other plugin in combination with wilder
and vim-visual-multi
is causing this issue.
I don't have a better workaround than the one in #63 (comment).
from wilder.nvim.
Did you try wilder+vim-visual-multi using popupmenu_renderer
or with wildmenu_renderer
? Can you confirm whether they work together with popupmenu for you?
from wilder.nvim.
Both work fine for me, other than the statusline being covered.
from wilder.nvim.
I'm closing this issue since the original question is solved by #63 (comment).
If you wish to, we can continue the investigation with vim-visual-multi
in another issue if you open one.
from wilder.nvim.
Related Issues (20)
- Relative to `pwd` path
- Wilder slow on `:!` HOT 1
- File finder: customizable behavior on should_use_file_finder HOT 1
- Changing the background color HOT 1
- Strange off-by-one error when hitting <Tab> in the command line HOT 3
- `_wilder_python_search` error when searching with `/` HOT 2
- Highlight the candidates
- Wilder removes topline in buffer in .10 nightly
- Wilder pop up breaks lualine "diff" component
- The popup menu's color is weird HOT 1
- I entered / in cmdline and received this error HOT 6
- Issue with wilder when trying to select commands(TAB) HOT 1
- Trying to install wilder correctly for NvChad, getting Unknown function _wilder_python_file_finder HOT 1
- Semshi/Wilder conflict HOT 6
- Configure to operate similarly to wildmode=list:longest?
- "error caught in async handler" when searching HOT 1
- Popupmenu_render only works on 1st table.
- Bug when trying to save harpoon buffer
- How to select the first listed item by default? HOT 5
- Unknown function: _wilder_python_search HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from wilder.nvim.