@@ -63,6 +63,18 @@ local MARK_DELETION = M.MARK_DELETION
6363local MARK_MODIFICATION = M .MARK_MODIFICATION
6464local INDIC_ADDITION = M .INDIC_ADDITION
6565local INDIC_DELETION = M .INDIC_DELETION
66+ --- The name of the theme color used to mark additions.
67+ -- The default value is 'green'. If your theme does not define that color, set this field to
68+ -- your theme's equivalent.
69+ M .addition_color_name = ' green'
70+ --- The name of the theme color used to mark deletions.
71+ -- The default value is 'red'. If your theme does not define that color, set this field to your
72+ -- theme's equivalent.
73+ M .deletion_color_name = ' red'
74+ --- The name of the theme color used to mark modifications.
75+ -- The default value is 'yellow'. If your theme does not define that color, set this field to
76+ -- your theme's equivalent.
77+ M .modification_color_name = ' yellow'
6678
6779-- Localizations.
6880local _L = _L
@@ -490,19 +502,22 @@ end)
490502
491503events .connect (events .VIEW_NEW , function ()
492504 local markers = {
493- [MARK_ADDITION ] = ' green' , [MARK_DELETION ] = ' red' , [MARK_MODIFICATION ] = ' yellow'
505+ [MARK_ADDITION ] = M .addition_color_name , [MARK_DELETION ] = M .deletion_color_name ,
506+ [MARK_MODIFICATION ] = M .modification_color_name
494507 }
495508 for mark , color in pairs (markers ) do
496509 view :marker_define (mark , not CURSES and view .MARK_BACKGROUND or view .MARK_FULLRECT )
497- view .marker_back [mark ] = view .colors [color ]
510+ if view .colors [ color ] then view . marker_back [mark ] = view .colors [color ] end
498511 if not CURSES then
499512 view .marker_layer [mark ], view .marker_alpha [mark ] = view .LAYER_UNDER_TEXT , 0x60
500513 end
501514 end
502- local indicators = {[INDIC_ADDITION ] = ' green' , [INDIC_DELETION ] = ' red' }
515+ local indicators = {
516+ [INDIC_ADDITION ] = M .addition_color_name , [INDIC_DELETION ] = M .deletion_color_name
517+ }
503518 for indic , color in pairs (indicators ) do
504519 view .indic_style [indic ] = not CURSES and view .INDIC_FULLBOX or view .INDIC_STRAIGHTBOX
505- view .indic_fore [indic ] = view .colors [color ]
520+ if view .colors [ color ] then view . indic_fore [indic ] = view .colors [color ] end
506521 if not CURSES then view .indic_alpha [indic ], view .indic_under [indic ] = 0x60 , true end
507522 end
508523end )
0 commit comments