Skip to content

Optimization of Mark Editor's Selection Functionality #972

@edl7878

Description

@edl7878

Suggestion for Improving Mark Editor's Selection Feature

  • I use the default Asciidoctor preview template.
  • Currently, the selected portion in the editor (or the paragraph containing the cursor) does not display a vertical indicator bar on its left side—even though this bar does appear when using VS Code's default theme.

After reviewing the source code, I noticed that the current implementation of this feature does not guarantee consistent behavior across all possible preview CSS templates.

I believe that if an HTML element in the preview pane is visible, it must occupy some space on the page. Under this assumption, a more robust and consistent way to implement the Mark Editor's Selection feature would be to highlight the background color of the corresponding HTML element.

Changing the background color would only fail in one scenario: when the highlight color is identical to the template’s background color.

I’ve implemented a prototype of this approach, and a screenshot is attached below:

Image

I’d like to suggest adding this functionality to the plugin: highlight the selected region by changing its background color.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions