Comments (6)
This is the one: d1084c0. It's about :DoMatchParen
then. I will look into the source of matchparen again (help is still appreciated though).
from lightspeed.nvim.
I think I found the issue for what is happening.
See this line from the visual mode documentation (:h Visual
):
If you use <Esc>, click the left mouse button or use any command that does a jump to another buffer
while in Visual mode, the highlighting stops and no text is affected.
When checking the source for the DoMatchParen
command we can see that windo
is used to activate the highlighting in all visible windows:
func s:DoMatchParen()
runtime plugin/matchparen.vim
let w = winnr()
silent windo doau CursorMoved <-- this line here
exe "noau ". w . "wincmd w"
endfunc
windo
will navigate to every window of the current tabpage and execute the given command there (see :h windo
). As soon as one of those windows is visiting another buffer than the current one the highlighting stops as stated in the visual mode documentation. That is the reason it works for splits showing the same buffer.
We could have a simple workaround to prevent this like the following:
(fn force-matchparen-highlight []
; NOTE: :DoMatchParen overwrites the current dot-repeat setting,
; that should be (re)set after this call!
(let [mode (vim.fn.mode)] ; save current mode
(when (= (vim.fn.exists ":DoMatchParen") 2)
(vim.cmd :DoMatchParen)
(when (or (= mode "v") (= mode "V") (= mode "CTRL-V")) ; if last mode was "visual"
(vim.cmd "normal gv"))))) ; restore selection
from lightspeed.nvim.
Yep, I can reproduce, unfortunately. This is a pretty serious bug, and at the moment I have absolutely no idea what could cause this, and when will I have the time to hunt it down. (Thanks for raising this btw!)
from lightspeed.nvim.
Okay, the good news is that this bug is not present in the older commits, so it's binary-searchable at least. I'm kinda relieved :)
from lightspeed.nvim.
Wow, you're invaluable :) I think this might also be the reason why it breaks dot-repeat (the selection is gone).
On the other hand, have you actually tried the workaround? I tried reselecting with gv
, but that did not work for me. The visual selection is not updated at that point, apparently, it restores the previous state. (Though I don't really understand why.)
But again, we can do something simpler: let's not use :DoMatchParen
at all, but trigger the refresh manually then, with doautocmd CursorMoved
, for our window only. This is a very clean solution.
from lightspeed.nvim.
No problem, I am always happy to help 🙂
For me it did work with gv
, but never the less I like the solution using doautocmd CursorMoved
way better. No need to "restart" matchparen
for all open windows.
from lightspeed.nvim.
Related Issues (20)
- Update configuration in init.vim HOT 6
- Control timeout of instant jump/instant repeat labels separately HOT 4
- Error in `set_editor_opts` in `LightspeedLeave` autocommand HOT 3
- fatal: invalid reference: master when Installing or Updating with vim-plug HOT 1
- A suggestion for f/t HOT 3
- Problems when setting safe_labels = {} HOT 1
- Error on yank after jumping HOT 1
- Features Request: Search all windows in the tabpage HOT 1
- Configurable delay/timeout for f motions HOT 1
- Option to add characters to special character list HOT 1
- Lightspeed overwriting neogit shortcuts HOT 4
- Newly installed lightspeed.nvim throws error. Doesn't override nvim defaults. HOT 2
- Potential matched words get highlighted, doesn't go away HOT 2
- Matching Issues HOT 2
- lightspeed with vim-multiple-cursors
- Lightspeed resets scrolloff to 0 HOT 1
- automatically exit f/F HOT 3
- multibyte bug with display bounds computation HOT 2
- how to begin troubleshooting if plugin does not seem to have mapped keys? HOT 2
- Cursor not refreshing.
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 lightspeed.nvim.