summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKent Overstreet <koverstreet@google.com>2013-03-18 04:30:16 -0700
committerKent Overstreet <koverstreet@google.com>2013-04-23 16:37:36 -0700
commit25b10e39b63c4fd7583fee117e84ff46dd577091 (patch)
treedb164f78ca861ba6e6958d65453ef7b8696be7c3
parentadcff12c7f030423791b377c86328893959bb42c (diff)
kill bce
-rw-r--r--st.c3
-rw-r--r--term.c52
2 files changed, 26 insertions, 29 deletions
diff --git a/st.c b/st.c
index 14dc00f..d9c298b 100644
--- a/st.c
+++ b/st.c
@@ -503,6 +503,9 @@ static void xdraw_glyphs(struct st_window *xw, struct coord pos,
XftFont *xfont = font->match;
bool found;
unsigned ucs = glyphs[i].c;
+
+ if (!ucs)
+ ucs = ' ';
retry:
xglyphs[nxglyphs] = XftCharIndex(xw->dpy, xfont, ucs);
found = xglyphs[nxglyphs];
diff --git a/term.c b/term.c
index 4cebdc7..e692b16 100644
--- a/term.c
+++ b/term.c
@@ -191,7 +191,7 @@ static void csireset(struct csi_escape *csi)
/* t code */
static void __tclearline(struct st_term *term, unsigned y,
- unsigned start, unsigned end, int bce)
+ unsigned start, unsigned end)
{
struct st_glyph *g;
@@ -200,30 +200,24 @@ static void __tclearline(struct st_term *term, unsigned y,
for (g = &term->line[y][start];
g < &term->line[y][end];
g++) {
- g->set = bce;
-
- if (g->set) {
- *g = term->c.attr;
-
- g->c = ' ';
- g->set = 1;
- }
+ *g = term->c.attr;
+ g->c = 0;
+ g->set = 1;
}
}
-static void tclearline(struct st_term *term,
- unsigned start, unsigned end, int bce)
+static void tclearline(struct st_term *term, unsigned start, unsigned end)
{
- __tclearline(term, term->c.pos.y, start, end, bce);
+ __tclearline(term, term->c.pos.y, start, end);
}
static void tclearregion(struct st_term *term, struct coord p1,
- struct coord p2, int bce)
+ struct coord p2)
{
struct coord p;
for (p.y = p1.y; p.y < p2.y; p.y++)
- __tclearline(term, p.y, p1.x, p2.x, bce);
+ __tclearline(term, p.y, p1.x, p2.x);
}
static void tscrolldown(struct st_term *term, int orig, int n)
@@ -234,7 +228,7 @@ static void tscrolldown(struct st_term *term, int orig, int n)
tclearregion(term,
(struct coord) {0, term->bot - n + 1},
- (struct coord) {term->size.x, term->bot + 1}, 0);
+ (struct coord) {term->size.x, term->bot + 1});
for (i = term->bot; i >= orig + n; i--) {
swap(term->line[i], term->line[i - n]);
@@ -254,7 +248,7 @@ static void tscrollup(struct st_term *term, int orig, int n)
tclearregion(term,
(struct coord) {0, orig},
- (struct coord) {term->size.x, orig + n}, 0);
+ (struct coord) {term->size.x, orig + n});
/* XXX: optimize? */
for (i = orig; i <= term->bot - n; i++) {
@@ -345,7 +339,7 @@ static void treset(struct st_term *term)
term->appcursor = 0;
term->mousesgr = 0;
- tclearregion(term, ORIGIN, term->size, 0);
+ tclearregion(term, ORIGIN, term->size);
tmoveto(term, ORIGIN);
tcursor_save(term);
}
@@ -431,7 +425,7 @@ static void tdeletechar(struct st_term *term, int n)
start = term->size.x - n;
}
- tclearline(term, start, term->size.x, 0);
+ tclearline(term, start, term->size.x);
}
static void tinsertblank(struct st_term *term, int n)
@@ -450,7 +444,7 @@ static void tinsertblank(struct st_term *term, int n)
end = dst.x;
}
- tclearline(term, term->c.pos.x, end, 0);
+ tclearline(term, term->c.pos.x, end);
}
static void tinsertblankline(struct st_term *term, int n)
@@ -649,7 +643,7 @@ static void tsetmode(struct st_term *term, bool priv,
case 1047:{
if (term->altscreen)
tclearregion(term, ORIGIN,
- term->size, 0);
+ term->size);
if (set != term->altscreen)
tswapscreen(term);
if (*args != 1049)
@@ -776,19 +770,19 @@ static void csihandle(struct st_term *term)
term->sel.bx = -1;
switch (csi->arg[0]) {
case 0: /* below */
- tclearregion(term, term->c.pos, term->size, 1);
+ tclearregion(term, term->c.pos, term->size);
if (term->c.pos.y < term->size.y - 1)
tclearregion(term, (struct coord)
{0, term->c.pos.y + 1},
- term->size, 1);
+ term->size);
break;
case 1: /* above */
if (term->c.pos.y > 1)
- tclearregion(term, ORIGIN, term->size, 1);
- tclearline(term, 0, term->c.pos.x + 1, 1);
+ tclearregion(term, ORIGIN, term->size);
+ tclearline(term, 0, term->c.pos.x + 1);
break;
case 2: /* all */
- tclearregion(term, ORIGIN, term->size, 1);
+ tclearregion(term, ORIGIN, term->size);
break;
default:
goto unknown;
@@ -797,13 +791,13 @@ static void csihandle(struct st_term *term)
case 'K': /* EL -- Clear line */
switch (csi->arg[0]) {
case 0: /* right */
- tclearline(term, term->c.pos.x, term->size.x, 1);
+ tclearline(term, term->c.pos.x, term->size.x);
break;
case 1: /* left */
- tclearline(term, 0, term->c.pos.x + 1, 1);
+ tclearline(term, 0, term->c.pos.x + 1);
break;
case 2: /* all */
- tclearline(term, 0, term->size.x, 1);
+ tclearline(term, 0, term->size.x);
break;
}
break;
@@ -828,7 +822,7 @@ static void csihandle(struct st_term *term)
break;
case 'X': /* ECH -- Erase <n> char */
DEFAULT(csi->arg[0], 1);
- tclearline(term, term->c.pos.x, term->c.pos.x + csi->arg[0], 1);
+ tclearline(term, term->c.pos.x, term->c.pos.x + csi->arg[0]);
break;
case 'P': /* DCH -- Delete <n> char */
DEFAULT(csi->arg[0], 1);