Ticket #4433 (closed enhancement: fixed)
Allow setting color for abnormal characters in editor from skin file
Reported by: | ArtemKuchin | Owned by: | andrew_b |
---|---|---|---|
Priority: | minor | Milestone: | 4.8.31 |
Component: | mc-skin | Version: | master |
Keywords: | color abnormal non printable skin | Cc: | |
Blocked By: | Blocking: | ||
Branch state: | merged | Votes for changeset: | committed-master |
Description (last modified by andrew_b) (diff)
in editdraw.c
/* If non-printable - use black background */ color = (style & MOD_ABNORMAL) != 0 ? 0 : p->style >> 16;
So, if, for example, file contains CR (^M) i see a lot of ^M on black background tearing apart all my nice colors and poking my eyes out.
It would be nice to have something like editabnormal in skin file to set it to something noticeable but nice.
I tried adding it myself
skin.h
#define EDITOR_ABNORMAL_COLOR mc_skin_color__cache[50] #define MC_SKIN_COLOR_CACHE_COUNT 68
and renumbered cache array
colors.c
EDITOR_ABNORMAL_COLOR = mc_skin_color_get ("editor", "editabnormal");
editdraw.c
else //tty_setcolor (EDITOR_ABNORMAL_COLOR); tty_lowlevel_setcolor (color);
But it does not work somehow. Compiles fine but just does not work. Abnormal chars just show as normal.
Attachments
Change History
comment:1 Changed 2 years ago by andrew_b
- Description modified (diff)
- Milestone changed from 4.8.29 to Future Releases
comment:2 Changed 2 years ago by ArtemKuchin
correct change i did is:
else tty_setcolor (EDITOR_ABNORMAL_COLOR); //tty_lowlevel_setcolor (color);
It also broke syntax highlighting somehow. I am missing something.
comment:4 follow-up: ↓ 5 Changed 2 years ago by andrew_b
You should add the "editabnormal" color in the skin files. See the attached file.
comment:5 in reply to: ↑ 4 Changed 2 years ago by ArtemKuchin
Replying to andrew_b:
You should add the "editabnormal" color in the skin files. See the attached file.
Ah! Missed that. Thank you very much for the diff. Works great!
comment:6 Changed 13 months ago by andrew_b
- Status changed from new to accepted
- Description modified (diff)
- Component changed from mcedit to mc-skin
- Branch state changed from no branch to on review
- Milestone changed from Future Releases to 4.8.31
- Owner set to andrew_b
The editnonprintable color is added.
Branch: 4433_edit_nonprintable_color
changeset:bdf78fb2a3a1ba4b964fc5b8bf659e484a0cfa19
comment:7 Changed 13 months ago by andrew_b
- Votes for changeset set to andrew_b
- Branch state changed from on review to approved
comment:8 Changed 13 months ago by andrew_b
- Status changed from accepted to testing
- Votes for changeset changed from andrew_b to committed-master
- Resolution set to fixed
- Branch state changed from approved to merged
Merged to master: [15419524e87547bb07d8967cc1a875789720e102].