While working with multiple cursors, I noticed that using hotkeys isn’t working as expected: If you try to CTRL+B several selections at the same time, only the last selected cursor actually gets marked as bold. The same issue exists with CTRL+I and I suspect any other hotkey that manipulates text.
Steps to reproduce
(This bug is reproducible in the help-vault)
Activate multi cursors by ALT+LMB on text
Mark texts that should be bold/emphasized by selecting it with SHIFT+ARROW-KEY
Press hotkey (e.g. CTRL+B or CTRL+I)
Only the last selection actually is bold/emphasized now, any previous cursor gets ignored.
Expected result
All text selections by the multi-cursors should be bold/emphasized.
Actual result
The hotkey only worked on the last selected multi-cursor, instead of every multi-cursor.
Environment
Operating system: Win10 (64-bit)
Debug info:
SYSTEM INFO:
Obsidian version: v0.14.2
Installer version: v0.13.30
Operating system: Windows 10 Pro 10.0.19044
Login status: logged in
Catalyst license: insider
Insider build toggle: on
Live preview: on
Legacy editor: off
Base theme: dark
Community theme: none
Snippets enabled: 0
Safe mode: on
RECOMMENDATIONS:
none
Additional information
I’ve attached a small gif of the multi-cursor problem, see below:
I decided to put this here and not open a new thread.
The case is similar, only one instance is taken into consideration.
The same happens with the Advanced Cursors plugin as well. I opened an issue at its GitHub and while I was at it, I checked Obsidian’s built-in multiple cursor function.
The same problem arises using both: when multiple selections or matches are highlighted, regex replacements (I use Regex Pipeline on single documents) are only done per match of the first instance, like so (strings in Wikilinks are changed to strings bold text in this example): [[Hugo]] > **Hugo** , [[Bubu]] > **Hugo** , [[Dudu]] > **Hugo** ,
etc.
(I used the following ad hoc regex to search and replace: \[\[(.*?)\]\] → **$1**,
which is not the culprit because normal mouse selections on multiple items deliver the desired results.)
Similarly, Obsidian doesn’t add multiple cursors in between but adds cursors just to the first and last line.
Example (Mac)
In vsCode users are able to select multiple lines in a shot.
Let’s say you place cursor one at line 1 , then you hold opt+shift and click on the 10th line.
The result is, you get multiple cursors from line 1 to line 10 and not just a cursor in line 1 and another cursor in line 10