diff --git a/rc/filetype/diff.kak b/rc/filetype/diff.kak index 6658bab0..b4c550a6 100644 --- a/rc/filetype/diff.kak +++ b/rc/filetype/diff.kak @@ -7,6 +7,11 @@ hook global WinSetOption filetype=diff %{ require-module diff } +hook -group diff-highlight global WinSetOption filetype=diff %{ + add-highlighter window/diff ref diff + hook -once -always window WinSetOption filetype=.* %{ remove-highlighter window/diff } +} + provide-module diff %ยง add-highlighter shared/diff group @@ -14,11 +19,6 @@ add-highlighter shared/diff/ regex "^\+[^\n]*\n" 0:green,default add-highlighter shared/diff/ regex "^-[^\n]*\n" 0:red,default add-highlighter shared/diff/ regex "^@@[^\n]*@@" 0:cyan,default -hook -group diff-highlight global WinSetOption filetype=diff %{ - add-highlighter window/diff ref diff - hook -once -always window WinSetOption filetype=.* %{ remove-highlighter window/diff } -} - define-command diff-jump \ -docstring %{diff-jump [] []: edit the diff's source file at the cursor position. Paths are resolved relative to , or the current working directory if unspecified.