vscode-text-marker icon indicating copy to clipboard operation
vscode-text-marker copied to clipboard

Allow toggling multiple selections with multiple cursors

Open Kronuz opened this issue 4 years ago • 1 comments

I'd be really useful if we could have multiple selections and toggle all of them at once.

How to reproduce

  1. Select multiple lines with text
  2. Highlight parts of each line
  3. Use toggle highlight command to turn on the highlights

Desired behavior

All selections should be added as a highlights

What we see instead

Only first selected text is highlighted, all others are ignored.

Proposed solution

Add selections to TextEditor (lib/vscode/text-editor.ts) and use it in ToggleHighlightCommand (lib/commands/toggle-highlight.ts) to iterate through all active selections in execute().

Kronuz avatar Nov 30 '21 16:11 Kronuz

Hello,

I would like to suggest one sub-feature for multiple cursors too :

  1. Select multiple lines with text
  2. Highlight parts of each line
  3. Use toggle highlight command to turn on the highlights and make the multicursor selected text a single regex group

So it avoid to spread the hightlights on all the file if one selected text area is one char only (hightlight all "d" of the file for exemple.)

LoanCaecke avatar Mar 25 '22 19:03 LoanCaecke