remove old upstreamed patches
This commit is contained in:
parent
40dcf01b68
commit
d2db831596
@ -1,12 +0,0 @@
|
||||
--- alerts.c-orig 2017-05-16 10:09:31.000000000 -0300
|
||||
+++ alerts.c 2017-08-04 22:46:34.352115185 -0300
|
||||
@@ -199,7 +199,7 @@
|
||||
|
||||
if (action == BELL_CURRENT && ws != w)
|
||||
action = BELL_NONE;
|
||||
- if (action == BELL_OTHER && ws != w)
|
||||
+ if (action == BELL_OTHER && ws == w)
|
||||
action = BELL_NONE;
|
||||
|
||||
if (!visual) {
|
||||
|
@ -1,15 +0,0 @@
|
||||
--- a/cmd-find.c
|
||||
+++ a/cmd-find.c
|
||||
@@ -977,8 +977,11 @@ cmd_find_target(struct cmd_find_state *fs, struct cmdq_item *item,
|
||||
} else if (cmd_find_from_client(¤t, item->client) == 0) {
|
||||
fs->current = ¤t;
|
||||
log_debug("%s: current is from client", __func__);
|
||||
- } else
|
||||
+ } else {
|
||||
+ if (~flags & CMD_FIND_QUIET)
|
||||
+ cmdq_error(item, "no current target");
|
||||
goto error;
|
||||
+ }
|
||||
if (!cmd_find_valid_state(fs->current))
|
||||
fatalx("invalid current find state");
|
||||
|
@ -1,29 +0,0 @@
|
||||
From 6e5121be7e280914f1116189b04c9c7a4b5f1590 Mon Sep 17 00:00:00 2001
|
||||
From: nicm <nicm>
|
||||
Date: Wed, 11 Oct 2017 11:26:58 +0000
|
||||
Subject: [PATCH] Clear to end of line properly with UTF-8 present.
|
||||
|
||||
---
|
||||
mode-tree.c | 8 +++++---
|
||||
1 file changed, 5 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/mode-tree.c b/mode-tree.c
|
||||
index 7b3787950..349cda493 100644
|
||||
--- a/mode-tree.c
|
||||
+++ b/mode-tree.c
|
||||
@@ -554,10 +554,12 @@ mode_tree_draw(struct mode_tree_data *mtd)
|
||||
}
|
||||
|
||||
if (i != mtd->current) {
|
||||
- screen_write_puts(&ctx, &gc0, "%.*s", w, text);
|
||||
+ screen_write_nputs(&ctx, w, &gc0, "%s", text);
|
||||
screen_write_clearendofline(&ctx, 8);
|
||||
- } else
|
||||
- screen_write_puts(&ctx, &gc, "%-*.*s", w, w, text);
|
||||
+ } else {
|
||||
+ screen_write_nputs(&ctx, w, &gc, "%s", text);
|
||||
+ screen_write_clearendofline(&ctx, gc.bg);
|
||||
+ }
|
||||
free(text);
|
||||
|
||||
if (mti->tagged) {
|
@ -1,204 +0,0 @@
|
||||
From c03565611e41649ce9295012faec2f0eddb2a822 Mon Sep 17 00:00:00 2001
|
||||
From: nicm <nicm>
|
||||
Date: Fri, 12 Jan 2018 16:32:12 +0000
|
||||
Subject: [PATCH] Simplify UTF-8 states down into one state.
|
||||
|
||||
---
|
||||
input.c | 120 ++++++++++++----------------------------------------------------
|
||||
1 file changed, 22 insertions(+), 98 deletions(-)
|
||||
|
||||
diff --git a/input.c b/input.c
|
||||
index 42ff7f3b2..cce4df1f7 100644
|
||||
--- a/input.c
|
||||
+++ b/input.c
|
||||
@@ -85,6 +85,7 @@ struct input_ctx {
|
||||
u_int param_list_len;
|
||||
|
||||
struct utf8_data utf8data;
|
||||
+ int utf8started;
|
||||
|
||||
int ch;
|
||||
int last;
|
||||
@@ -146,9 +147,7 @@ static void input_csi_dispatch_sgr_256(struct input_ctx *, int, u_int *);
|
||||
static void input_csi_dispatch_sgr_rgb(struct input_ctx *, int, u_int *);
|
||||
static void input_csi_dispatch_sgr(struct input_ctx *);
|
||||
static int input_dcs_dispatch(struct input_ctx *);
|
||||
-static int input_utf8_open(struct input_ctx *);
|
||||
-static int input_utf8_add(struct input_ctx *);
|
||||
-static int input_utf8_close(struct input_ctx *);
|
||||
+static int input_top_bit_set(struct input_ctx *);
|
||||
|
||||
/* Command table comparison function. */
|
||||
static int input_table_compare(const void *, const void *);
|
||||
@@ -314,9 +313,6 @@ static const struct input_transition input_state_osc_string_table[];
|
||||
static const struct input_transition input_state_apc_string_table[];
|
||||
static const struct input_transition input_state_rename_string_table[];
|
||||
static const struct input_transition input_state_consume_st_table[];
|
||||
-static const struct input_transition input_state_utf8_three_table[];
|
||||
-static const struct input_transition input_state_utf8_two_table[];
|
||||
-static const struct input_transition input_state_utf8_one_table[];
|
||||
|
||||
/* ground state definition. */
|
||||
static const struct input_state input_state_ground = {
|
||||
@@ -437,27 +433,6 @@ static const struct input_state input_state_consume_st = {
|
||||
input_state_consume_st_table
|
||||
};
|
||||
|
||||
-/* utf8_three state definition. */
|
||||
-static const struct input_state input_state_utf8_three = {
|
||||
- "utf8_three",
|
||||
- NULL, NULL,
|
||||
- input_state_utf8_three_table
|
||||
-};
|
||||
-
|
||||
-/* utf8_two state definition. */
|
||||
-static const struct input_state input_state_utf8_two = {
|
||||
- "utf8_two",
|
||||
- NULL, NULL,
|
||||
- input_state_utf8_two_table
|
||||
-};
|
||||
-
|
||||
-/* utf8_one state definition. */
|
||||
-static const struct input_state input_state_utf8_one = {
|
||||
- "utf8_one",
|
||||
- NULL, NULL,
|
||||
- input_state_utf8_one_table
|
||||
-};
|
||||
-
|
||||
/* ground state table. */
|
||||
static const struct input_transition input_state_ground_table[] = {
|
||||
INPUT_STATE_ANYWHERE,
|
||||
@@ -467,11 +442,7 @@ static const struct input_transition input_state_ground_table[] = {
|
||||
{ 0x1c, 0x1f, input_c0_dispatch, NULL },
|
||||
{ 0x20, 0x7e, input_print, NULL },
|
||||
{ 0x7f, 0x7f, NULL, NULL },
|
||||
- { 0x80, 0xc1, NULL, NULL },
|
||||
- { 0xc2, 0xdf, input_utf8_open, &input_state_utf8_one },
|
||||
- { 0xe0, 0xef, input_utf8_open, &input_state_utf8_two },
|
||||
- { 0xf0, 0xf4, input_utf8_open, &input_state_utf8_three },
|
||||
- { 0xf5, 0xff, NULL, NULL },
|
||||
+ { 0x80, 0xff, input_top_bit_set, NULL },
|
||||
|
||||
{ -1, -1, NULL, NULL }
|
||||
};
|
||||
@@ -717,39 +688,6 @@ static const struct input_transition input_state_consume_st_table[] = {
|
||||
{ -1, -1, NULL, NULL }
|
||||
};
|
||||
|
||||
-/* utf8_three state table. */
|
||||
-static const struct input_transition input_state_utf8_three_table[] = {
|
||||
- /* No INPUT_STATE_ANYWHERE */
|
||||
-
|
||||
- { 0x00, 0x7f, NULL, &input_state_ground },
|
||||
- { 0x80, 0xbf, input_utf8_add, &input_state_utf8_two },
|
||||
- { 0xc0, 0xff, NULL, &input_state_ground },
|
||||
-
|
||||
- { -1, -1, NULL, NULL }
|
||||
-};
|
||||
-
|
||||
-/* utf8_two state table. */
|
||||
-static const struct input_transition input_state_utf8_two_table[] = {
|
||||
- /* No INPUT_STATE_ANYWHERE */
|
||||
-
|
||||
- { 0x00, 0x7f, NULL, &input_state_ground },
|
||||
- { 0x80, 0xbf, input_utf8_add, &input_state_utf8_one },
|
||||
- { 0xc0, 0xff, NULL, &input_state_ground },
|
||||
-
|
||||
- { -1, -1, NULL, NULL }
|
||||
-};
|
||||
-
|
||||
-/* utf8_one state table. */
|
||||
-static const struct input_transition input_state_utf8_one_table[] = {
|
||||
- /* No INPUT_STATE_ANYWHERE */
|
||||
-
|
||||
- { 0x00, 0x7f, NULL, &input_state_ground },
|
||||
- { 0x80, 0xbf, input_utf8_close, &input_state_ground },
|
||||
- { 0xc0, 0xff, NULL, &input_state_ground },
|
||||
-
|
||||
- { -1, -1, NULL, NULL }
|
||||
-};
|
||||
-
|
||||
/* Input table compare. */
|
||||
static int
|
||||
input_table_compare(const void *key, const void *value)
|
||||
@@ -1059,6 +997,8 @@ input_print(struct input_ctx *ictx)
|
||||
{
|
||||
int set;
|
||||
|
||||
+ ictx->utf8started = 0; /* can't be valid UTF-8 */
|
||||
+
|
||||
set = ictx->cell.set == 0 ? ictx->cell.g0set : ictx->cell.g1set;
|
||||
if (set == 1)
|
||||
ictx->cell.cell.attr |= GRID_ATTR_CHARSET;
|
||||
@@ -1132,6 +1072,8 @@ input_c0_dispatch(struct input_ctx *ictx)
|
||||
struct window_pane *wp = ictx->wp;
|
||||
struct screen *s = sctx->s;
|
||||
|
||||
+ ictx->utf8started = 0; /* can't be valid UTF-8 */
|
||||
+
|
||||
log_debug("%s: '%c'", __func__, ictx->ch);
|
||||
|
||||
switch (ictx->ch) {
|
||||
@@ -2064,47 +2006,29 @@ input_exit_rename(struct input_ctx *ictx)
|
||||
|
||||
/* Open UTF-8 character. */
|
||||
static int
|
||||
-input_utf8_open(struct input_ctx *ictx)
|
||||
+input_top_bit_set(struct input_ctx *ictx)
|
||||
{
|
||||
struct utf8_data *ud = &ictx->utf8data;
|
||||
|
||||
- if (utf8_open(ud, ictx->ch) != UTF8_MORE)
|
||||
- fatalx("UTF-8 open invalid %#x", ictx->ch);
|
||||
-
|
||||
- log_debug("%s %hhu", __func__, ud->size);
|
||||
ictx->last = -1;
|
||||
|
||||
- return (0);
|
||||
-}
|
||||
-
|
||||
-/* Append to UTF-8 character. */
|
||||
-static int
|
||||
-input_utf8_add(struct input_ctx *ictx)
|
||||
-{
|
||||
- struct utf8_data *ud = &ictx->utf8data;
|
||||
-
|
||||
- if (utf8_append(ud, ictx->ch) != UTF8_MORE)
|
||||
- fatalx("UTF-8 add invalid %#x", ictx->ch);
|
||||
-
|
||||
- log_debug("%s", __func__);
|
||||
-
|
||||
- return (0);
|
||||
-}
|
||||
-
|
||||
-/* Close UTF-8 string. */
|
||||
-static int
|
||||
-input_utf8_close(struct input_ctx *ictx)
|
||||
-{
|
||||
- struct utf8_data *ud = &ictx->utf8data;
|
||||
+ if (!ictx->utf8started) {
|
||||
+ if (utf8_open(ud, ictx->ch) != UTF8_MORE)
|
||||
+ return (0);
|
||||
+ ictx->utf8started = 1;
|
||||
+ return (0);
|
||||
+ }
|
||||
|
||||
- if (utf8_append(ud, ictx->ch) != UTF8_DONE) {
|
||||
- /*
|
||||
- * An error here could be invalid UTF-8 or it could be a
|
||||
- * nonprintable character for which we can't get the
|
||||
- * width. Drop it.
|
||||
- */
|
||||
+ switch (utf8_append(ud, ictx->ch)) {
|
||||
+ case UTF8_MORE:
|
||||
+ return (0);
|
||||
+ case UTF8_ERROR:
|
||||
+ ictx->utf8started = 0;
|
||||
return (0);
|
||||
+ case UTF8_DONE:
|
||||
+ break;
|
||||
}
|
||||
+ ictx->utf8started = 0;
|
||||
|
||||
log_debug("%s %hhu '%*s' (width %hhu)", __func__, ud->size,
|
||||
(int)ud->size, ud->data, ud->width);
|
@ -1,85 +0,0 @@
|
||||
From aeda2e5808af7c4b629dce23d2b4331a77ecde83 Mon Sep 17 00:00:00 2001
|
||||
From: nicm <nicm>
|
||||
Date: Wed, 15 Nov 2017 19:18:57 +0000
|
||||
Subject: [PATCH] If there is a double width character at the very end of the
|
||||
line with not enough room to draw it, just leave it out.
|
||||
|
||||
---
|
||||
tty.c | 23 ++++++++++++++++-------
|
||||
1 file changed, 16 insertions(+), 7 deletions(-)
|
||||
|
||||
diff --git a/tty.c b/tty.c
|
||||
index 90361e3fb..0dee5008e 100644
|
||||
--- a/tty.c
|
||||
+++ b/tty.c
|
||||
@@ -882,6 +882,7 @@ void
|
||||
tty_draw_line(struct tty *tty, const struct window_pane *wp,
|
||||
struct screen *s, u_int py, u_int ox, u_int oy)
|
||||
{
|
||||
+ struct grid *gd = s->grid;
|
||||
struct grid_cell gc, last;
|
||||
u_int i, j, ux, sx, nx, width;
|
||||
int flags, cleared = 0;
|
||||
@@ -900,15 +901,15 @@ tty_draw_line(struct tty *tty, const struct window_pane *wp,
|
||||
* there may be empty background cells after it (from BCE).
|
||||
*/
|
||||
sx = screen_size_x(s);
|
||||
- if (sx > s->grid->linedata[s->grid->hsize + py].cellsize)
|
||||
- sx = s->grid->linedata[s->grid->hsize + py].cellsize;
|
||||
+ if (sx > gd->linedata[gd->hsize + py].cellsize)
|
||||
+ sx = gd->linedata[gd->hsize + py].cellsize;
|
||||
if (sx > tty->sx)
|
||||
sx = tty->sx;
|
||||
ux = 0;
|
||||
|
||||
if (wp == NULL ||
|
||||
py == 0 ||
|
||||
- (~s->grid->linedata[s->grid->hsize + py - 1].flags & GRID_LINE_WRAPPED) ||
|
||||
+ (~gd->linedata[gd->hsize + py - 1].flags & GRID_LINE_WRAPPED) ||
|
||||
ox != 0 ||
|
||||
tty->cx < tty->sx ||
|
||||
screen_size_x(s) < tty->sx) {
|
||||
@@ -932,7 +933,7 @@ tty_draw_line(struct tty *tty, const struct window_pane *wp,
|
||||
width = 0;
|
||||
|
||||
for (i = 0; i < sx; i++) {
|
||||
- grid_view_get_cell(s->grid, i, py, &gc);
|
||||
+ grid_view_get_cell(gd, i, py, &gc);
|
||||
if (len != 0 &&
|
||||
(((~tty->flags & TTY_UTF8) &&
|
||||
(gc.data.size != 1 ||
|
||||
@@ -943,6 +944,7 @@ tty_draw_line(struct tty *tty, const struct window_pane *wp,
|
||||
gc.attr != last.attr ||
|
||||
gc.fg != last.fg ||
|
||||
gc.bg != last.bg ||
|
||||
+ ux + width + gc.data.width >= screen_size_x(s) ||
|
||||
(sizeof buf) - len < gc.data.size)) {
|
||||
tty_attributes(tty, &last, wp);
|
||||
tty_putn(tty, buf, len, width);
|
||||
@@ -956,7 +958,14 @@ tty_draw_line(struct tty *tty, const struct window_pane *wp,
|
||||
screen_select_cell(s, &last, &gc);
|
||||
else
|
||||
memcpy(&last, &gc, sizeof last);
|
||||
- if (((~tty->flags & TTY_UTF8) &&
|
||||
+ if (ux + gc.data.width > screen_size_x(s))
|
||||
+ for (j = 0; j < gc.data.width; j++) {
|
||||
+ if (ux + j > screen_size_x(s))
|
||||
+ break;
|
||||
+ tty_putc(tty, ' ');
|
||||
+ ux++;
|
||||
+ }
|
||||
+ else if (((~tty->flags & TTY_UTF8) &&
|
||||
(gc.data.size != 1 ||
|
||||
*gc.data.data >= 0x7f ||
|
||||
gc.data.width != 1)) ||
|
||||
@@ -993,8 +1002,8 @@ tty_draw_line(struct tty *tty, const struct window_pane *wp,
|
||||
}
|
||||
}
|
||||
|
||||
- nx = screen_size_x(s) - ux;
|
||||
- if (!cleared && ux < tty->sx && nx != 0) {
|
||||
+ if (!cleared && ux < screen_size_x(s)) {
|
||||
+ nx = screen_size_x(s) - ux;
|
||||
tty_default_attributes(tty, wp, 8);
|
||||
tty_clear_line(tty, wp, oy + py, ox + ux, nx, 8);
|
||||
}
|
Loading…
Reference in New Issue
Block a user