Skip to content

Can we highlight multiple lines as specified? #100

Open

Description

@GreenLim

In certain scenarios, I would like to highlight specific lines, for example, if a line contains particular information, highlighting can provide better prompts for the user. However, I haven’t found an available API for this. How can I achieve this requirement?

Activity

  1. added
    enhancement
    on Oct 23, 2025
  2. heckmon commented on Jan 17, 2026

    @heckmon

    @GreenLim
    You can use this editor.

    It provides a decoration API in the controller that can be used to highlight a line:

    controller.setGitDiffDecorations(
      addedRanges: [(int startLine, int endLine), (int startline, int endLine), ... etc],
      removedRanges: [same pattern as above],
      modifiedRanges: [same pattern as above],
      addedColor: const Color(0xFF4CAF50),
      removedColor: const Color(0xFFE53935),
      modifiedColor: const Color(0xFF2196F3),
    )

    Also there's another API to scroll to a specific line:
    controller.scrollToLine(int line)

    Both of these provide a better line/lines highlighting.

    git_diff.png

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

enhancement

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions