Skip to content

New file has no highlighting when using diff-hl-flydiff-mode (and make Emacs slow) #226

Open
@whhone

Description

@whhone

Repro steps

  1. Create a new file in a repo (Git or Hg), open it.
  2. Enable diff-hl-flydiff-mode

Expected
I can see highlights (all green for each line since they are new)

Actual
There is no highlight. Also, it makes Emacs slow.

Causes

  1. diff-hl tries to find the new file from the previous revision (around (diff-hl-create-revision file revision))
  2. Since the file does not exist in the previous revision, it throws an error.
  3. Hence, it does not show the diff highlights.
  4. Also, on every file modification, it repeats calling the expensive call the find the file from a previous revision.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions