shithub: orca

Download patch

ref: 8103de478131d50431f6a188d6c8531655f58deb
parent: b01a1225245a7b2e1aac0571c1bbde773f62e836
author: cancel <cancel@cancel.fm>
date: Fri Dec 14 04:19:15 EST 2018

Change to use acs bullets for grid instead of .

--- a/tui_main.c
+++ b/tui_main.c
@@ -102,9 +102,9 @@
   return false;
 }
 
-static int term_attrs_of_cell(Glyph g, Mark m) {
+static attr_t term_attrs_of_cell(Glyph g, Mark m) {
   Glyph_class gclass = glyph_class_of(g);
-  int attr = A_normal;
+  int attr = (attr_t)A_normal;
   switch (gclass) {
   case Glyph_class_unknown:
     attr = A_bold | fg_bg(C_red, C_natural);
@@ -141,7 +141,7 @@
   if (m & Mark_flag_haste_input) {
     attr = A_bold | fg_bg(C_cyan, C_natural);
   }
-  return attr;
+  return (attr_t)attr;
 }
 
 typedef enum {
@@ -290,7 +290,8 @@
     int at_y = (int)(vis_sel_y + iy);
     int num = mvwinchnstr(win, at_y, (int)vis_sel_x, chbuffer, (int)vis_sel_w);
     for (int ix = 0; ix < num; ++ix) {
-      chbuffer[ix] = (chtype)((int)(chbuffer[ix] & A_CHARTEXT) | curs_attr);
+      chbuffer[ix] = (chtype)((chbuffer[ix] & (A_CHARTEXT | A_ALTCHARSET)) |
+                              (chtype)curs_attr);
     }
     waddchnstr(win, chbuffer, (int)num);
   }
@@ -473,12 +474,17 @@
     for (Usz ix = 0; ix < cols; ++ix) {
       Glyph g = g_row[ix];
       Mark m = m_row[ix];
-      int attrs = term_attrs_of_cell(g, m);
+      chtype ch;
       if (g == '.') {
         if (use_y_ruler && (ix + offset_x) % ruler_spacing_x == 0)
-          g = '+';
+          ch = '+';
+        else
+          ch = ACS_BULLET;
+      } else {
+        ch = (chtype)g;
       }
-      chbuffer[ix] = (chtype)((int)g | attrs);
+      attr_t attrs = term_attrs_of_cell(g, m);
+      chbuffer[ix] = ch | attrs;
     }
     wmove(win, draw_y + (int)iy, draw_x);
     waddchnstr(win, chbuffer, (int)cols);