https://www.slant.co/topics/358/~best-color-themes-for-text-editors
* Wily
-* Gruvbox
* badwolf
* jelly beans
-* monokai/molokai
-* tomorrow
-* spacegray
-* base16
-* dracula
* one dark
* zenburn
-* ayu
* railscast
* material
* spacemacs
* soda light
* predawn
* lucario
-* vim desert
-* two firewatch
* obsidian
* leuven
* afterglow
-* apathy
-* vim guru
* nord
* plastic code wrap
* wombat
void x11_draw_rect(int color, int x, int y, int width, int height);
void x11_draw_utf8(XFont font, int fg, int bg, int x, int y, char* str);
-void x11_draw_glyphs(int fg, int bg, XGlyphSpec* glyphs, size_t nglyphs);
+void x11_draw_glyphs(int fg, int bg, XGlyphSpec* specs, size_t nspecs, bool eol);
void x11_draw_utf8(XFont font, int fg, int bg, int x, int y, char* str);
bool x11_sel_get(int selid, void(*cbfn)(char*));
int ncols = runewidth(col, r);
/* write the rune to the screen buf */
scrrow->cols[col].attr = attr;
- if (r == '\t' || r == '\n' || r == RUNE_CRLF)
+ if (r == RUNE_CRLF)
+ scrrow->cols[col].rune = '\n';
+ else if (r == '\t')
scrrow->cols[col].rune = ' ';
else
scrrow->cols[col].rune = r;
static void draw_glyphs(size_t x, size_t y, UGlyph* glyphs, size_t rlen, size_t ncols) {
XGlyphSpec specs[rlen];
size_t i = 0;
+ bool eol = false;
while (rlen && i < ncols) {
int numspecs = 0;
uint32_t attr = glyphs[i].attr;
while (i < ncols && glyphs[i].attr == attr) {
+ if (glyphs[i].rune == '\n')
+ glyphs[i].rune = ' ', eol = true;
x11_font_getglyph(Font, &(specs[numspecs]), glyphs[i].rune);
specs[numspecs].x = x;
specs[numspecs].y = y - x11_font_descent(Font);
/* Draw the glyphs with the proper colors */
uint8_t bg = attr >> 8;
uint8_t fg = attr & 0xFF;
- x11_draw_glyphs(fg, bg, specs, numspecs);
- rlen -= numspecs;
+ x11_draw_glyphs(fg, bg, specs, numspecs, eol);
+ eol = false, rlen -= numspecs;
}
}
/* Otherwise check the cache */
for (int f = 0; f < font->ncached; f++) {
glyphidx = XftCharIndex(X.display, font->cache[f].font, rune);
- /* Fond a suitable font or found a default font */
+ /* Found a suitable font or found a default font */
if (glyphidx || (!glyphidx && font->cache[f].unicodep == rune)) {
spec->font = font->cache[f].font;
spec->glyph = glyphidx;
return numspecs;
}
-void x11_draw_glyphs(int fg, int bg, XGlyphSpec* specs, size_t nspecs) {
+void x11_draw_glyphs(int fg, int bg, XGlyphSpec* specs, size_t nspecs, bool eol) {
if (!nspecs) return;
XftFont* font = specs[0].font;
XftColor fgc, bgc;
+
if (bg > 0) {
XGlyphInfo extent;
XftTextExtentsUtf8(X.display, font, (const FcChar8*)"0", 1, &extent);
int h = (font->height - font->descent) + config_get_int(LineSpacing);
xftcolor(&bgc, bg);
size_t width = specs[nspecs-1].x - specs[0].x + w;
+ if (eol) width = X.width - specs[0].x;
x11_draw_rect(bg, specs[0].x, specs[0].y - h, width, font->height + config_get_int(LineSpacing));
XftColorFree(X.display, X.visual, X.colormap, &bgc);
}
nspecs++;
str++;
}
- x11_draw_glyphs(fg, bg, (XGlyphSpec*)specs, nspecs);
+ x11_draw_glyphs(fg, bg, (XGlyphSpec*)specs, nspecs, false);
}
/* Selection Handling
view_insert(view, false, *str);
view_insert(view, false, '\n');
if (ChoiceIdx == i+off) {
- selection.beg = view->selection.end-1;
+ selection.beg = view->selection.end;
selection.end = beg;
}
}