Ticket #3546: mcview-3546-dim-wrapped-lines-v0.patch

File mcview-3546-dim-wrapped-lines-v0.patch, 5.7 KB (added by egmont, 7 years ago)

Patch, v0

  • lib/skin.h

    diff --git a/lib/skin.h b/lib/skin.h
    index 8d32180..0518e8a 100644
    a b  
    7979#define VIEW_BOLD_COLOR           mc_skin_color__cache[45] 
    8080#define VIEW_UNDERLINED_COLOR     mc_skin_color__cache[46] 
    8181#define VIEW_SELECTED_COLOR       mc_skin_color__cache[47] 
     82#define VIEW_FADE_COLOR           mc_skin_color__cache[48] 
    8283 
    8384/* 
    8485 * editor colors - only 4 for normal, search->found, select, and whitespace 
    8586 * respectively 
    8687 * Last is defined to view color. 
    8788 */ 
    88 #define EDITOR_NORMAL_COLOR       mc_skin_color__cache[48] 
    89 #define EDITOR_BOLD_COLOR         mc_skin_color__cache[49] 
    90 #define EDITOR_MARKED_COLOR       mc_skin_color__cache[50] 
    91 #define EDITOR_WHITESPACE_COLOR   mc_skin_color__cache[51] 
    92 #define EDITOR_RIGHT_MARGIN_COLOR mc_skin_color__cache[52] 
    93 #define EDITOR_BACKGROUND         mc_skin_color__cache[53] 
    94 #define EDITOR_FRAME              mc_skin_color__cache[54] 
    95 #define EDITOR_FRAME_ACTIVE       mc_skin_color__cache[55] 
    96 #define EDITOR_FRAME_DRAG         mc_skin_color__cache[56] 
     89#define EDITOR_NORMAL_COLOR       mc_skin_color__cache[49] 
     90#define EDITOR_BOLD_COLOR         mc_skin_color__cache[50] 
     91#define EDITOR_MARKED_COLOR       mc_skin_color__cache[51] 
     92#define EDITOR_WHITESPACE_COLOR   mc_skin_color__cache[52] 
     93#define EDITOR_RIGHT_MARGIN_COLOR mc_skin_color__cache[53] 
     94#define EDITOR_BACKGROUND         mc_skin_color__cache[54] 
     95#define EDITOR_FRAME              mc_skin_color__cache[55] 
     96#define EDITOR_FRAME_ACTIVE       mc_skin_color__cache[56] 
     97#define EDITOR_FRAME_DRAG         mc_skin_color__cache[57] 
    9798/* color of left 8 char status per line */ 
    98 #define LINE_STATE_COLOR          mc_skin_color__cache[57] 
    99 #define BOOK_MARK_COLOR           mc_skin_color__cache[58] 
    100 #define BOOK_MARK_FOUND_COLOR     mc_skin_color__cache[59] 
     99#define LINE_STATE_COLOR          mc_skin_color__cache[58] 
     100#define BOOK_MARK_COLOR           mc_skin_color__cache[59] 
     101#define BOOK_MARK_FOUND_COLOR     mc_skin_color__cache[60] 
    101102 
    102103/* Diff colors */ 
    103 #define DFF_ADD_COLOR             mc_skin_color__cache[60] 
    104 #define DFF_CHG_COLOR             mc_skin_color__cache[61] 
    105 #define DFF_CHH_COLOR             mc_skin_color__cache[62] 
    106 #define DFF_CHD_COLOR             mc_skin_color__cache[63] 
    107 #define DFF_DEL_COLOR             mc_skin_color__cache[64] 
    108 #define DFF_ERROR_COLOR           mc_skin_color__cache[65] 
    109  
    110 #define MC_SKIN_COLOR_CACHE_COUNT 66 
     104#define DFF_ADD_COLOR             mc_skin_color__cache[61] 
     105#define DFF_CHG_COLOR             mc_skin_color__cache[62] 
     106#define DFF_CHH_COLOR             mc_skin_color__cache[63] 
     107#define DFF_CHD_COLOR             mc_skin_color__cache[64] 
     108#define DFF_DEL_COLOR             mc_skin_color__cache[65] 
     109#define DFF_ERROR_COLOR           mc_skin_color__cache[66] 
     110 
     111#define MC_SKIN_COLOR_CACHE_COUNT 67 
    111112 
    112113/*** enums ***************************************************************************************/ 
    113114 
  • lib/skin/colors.c

    diff --git a/lib/skin/colors.c b/lib/skin/colors.c
    index 61e3a80..18ecbed 100644
    a b mc_skin_color_cache_init (void) 
    237237    VIEW_BOLD_COLOR = mc_skin_color_get ("viewer", "viewbold"); 
    238238    VIEW_UNDERLINED_COLOR = mc_skin_color_get ("viewer", "viewunderline"); 
    239239    VIEW_SELECTED_COLOR = mc_skin_color_get ("viewer", "viewselected"); 
     240    VIEW_FADE_COLOR = mc_skin_color_get ("viewer", "viewfade"); 
    240241 
    241242    EDITOR_NORMAL_COLOR = mc_skin_color_get ("editor", "_default_"); 
    242243    EDITOR_BOLD_COLOR = mc_skin_color_get ("editor", "editbold"); 
  • misc/skins/gray-green-purple256.ini

    diff --git a/misc/skins/gray-green-purple256.ini b/misc/skins/gray-green-purple256.ini
    index 964b26f..8b3734d 100644
    a b  
    120120    viewbold = rgb000;;bold 
    121121    viewunderline = ;;underline 
    122122    viewselected = rgb303;rgb141;bold 
     123    viewfade = gray11 
    123124 
    124125[diffviewer] 
    125126    added = ;rgb340 
  • misc/skins/gray-orange-blue256.ini

    diff --git a/misc/skins/gray-orange-blue256.ini b/misc/skins/gray-orange-blue256.ini
    index f8426f1..024db09 100644
    a b  
    120120    viewbold = rgb000;;bold 
    121121    viewunderline = ;;underline 
    122122    viewselected = rgb004;rgb530;bold 
     123    viewfade = gray11 
    123124 
    124125[diffviewer] 
    125126    added = ;rgb340 
  • src/viewer/ascii.c

    diff --git a/src/viewer/ascii.c b/src/viewer/ascii.c
    index d04a544..3c772a3 100644
    a b mcview_display_line (mcview_t * view, mcview_state_machine_t * state, int row, 
    616616 
    617617        state_saved = *state; 
    618618        n = mcview_next_combining_char_sequence (view, state, cs, 1 + MAX_COMBINING_CHARS, &color); 
     619        if (state->paraline > 0 && color == VIEW_NORMAL_COLOR) 
     620            color = VIEW_FADE_COLOR; 
     621 
    619622        if (n == 0) 
    620623        { 
    621624            if (linewidth != NULL) 
    mcview_display_line (mcview_t * view, mcview_state_machine_t * state, int row, 
    666669            && col > 0) 
    667670        { 
    668671            *state = state_saved; 
     672            state->paraline++; 
    669673            if (paragraph_ended != NULL) 
    670674                *paragraph_ended = FALSE; 
    671675            if (linewidth != NULL) 
  • src/viewer/internal.h

    diff --git a/src/viewer/internal.h b/src/viewer/internal.h
    index 9a507ad..329c964 100644
    a b typedef struct 
    9595    off_t offset;               /* The file offset at which this is the state. */ 
    9696    off_t unwrapped_column;     /* Columns if the paragraph wasn't wrapped, */ 
    9797    /* used for positioning TABs in wrapped lines */ 
     98    off_t paraline;             /* Line number within the paragraph, 0-based */ 
    9899    gboolean nroff_underscore_is_underlined;    /* whether _\b_ is underlined rather than bold */ 
    99100    gboolean print_lonely_combining;    /* whether lonely combining marks are printed on a dotted circle */ 
    100101} mcview_state_machine_t;