Skip to content

Commit

Permalink
Allow specifying a different style for diff indicator in vcs gutter. (#…
Browse files Browse the repository at this point in the history
…8343)

This allows using a background in diff style
(for nice patch file coloring) while keeping the
gutter indicator nice (and using appropriate colors).
  • Loading branch information
amousset authored Sep 20, 2023
1 parent 651fd1c commit 2284bce
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
3 changes: 3 additions & 0 deletions book/src/themes.md
Original file line number Diff line number Diff line change
Expand Up @@ -245,9 +245,12 @@ We use a similar set of scopes as

- `diff` - version control changes
- `plus` - additions
- `gutter` - gutter indicator
- `minus` - deletions
- `gutter` - gutter indicator
- `delta` - modifications
- `moved` - renamed or moved files/changes
- `gutter` - gutter indicator

#### Interface

Expand Down
6 changes: 3 additions & 3 deletions helix-view/src/gutter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -94,9 +94,9 @@ pub fn diff<'doc>(
theme: &Theme,
_is_focused: bool,
) -> GutterFn<'doc> {
let added = theme.get("diff.plus");
let deleted = theme.get("diff.minus");
let modified = theme.get("diff.delta");
let added = theme.get("diff.plus.gutter");
let deleted = theme.get("diff.minus.gutter");
let modified = theme.get("diff.delta.gutter");
if let Some(diff_handle) = doc.diff_handle() {
let hunks = diff_handle.load();
let mut hunk_i = 0;
Expand Down

0 comments on commit 2284bce

Please sign in to comment.