@@ -63,6 +63,18 @@ local MARK_DELETION = M.MARK_DELETION
63
63
local MARK_MODIFICATION = M .MARK_MODIFICATION
64
64
local INDIC_ADDITION = M .INDIC_ADDITION
65
65
local 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'
66
78
67
79
-- Localizations.
68
80
local _L = _L
@@ -490,19 +502,22 @@ end)
490
502
491
503
events .connect (events .VIEW_NEW , function ()
492
504
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
494
507
}
495
508
for mark , color in pairs (markers ) do
496
509
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
498
511
if not CURSES then
499
512
view .marker_layer [mark ], view .marker_alpha [mark ] = view .LAYER_UNDER_TEXT , 0x60
500
513
end
501
514
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
+ }
503
518
for indic , color in pairs (indicators ) do
504
519
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
506
521
if not CURSES then view .indic_alpha [indic ], view .indic_under [indic ] = 0x60 , true end
507
522
end
508
523
end )
0 commit comments