mirror of
https://github.com/tmux/tmux.git
synced 2025-07-18 00:00:58 -04:00
Compare commits
No commits in common. "e7c829fc67c9b037402ad1624139de33665fb96b" and "62f657845ef6229b2f1a78fbceb8f3b2a736227e" have entirely different histories.
e7c829fc67
...
62f657845e
@ -1,3 +1,5 @@
|
|||||||
|
# Makefile.am
|
||||||
|
|
||||||
# Obvious program stuff.
|
# Obvious program stuff.
|
||||||
bin_PROGRAMS = tmux
|
bin_PROGRAMS = tmux
|
||||||
CLEANFILES = tmux.1.mdoc tmux.1.man cmd-parse.c
|
CLEANFILES = tmux.1.mdoc tmux.1.man cmd-parse.c
|
||||||
@ -189,7 +191,6 @@ dist_tmux_SOURCES = \
|
|||||||
tty-keys.c \
|
tty-keys.c \
|
||||||
tty-term.c \
|
tty-term.c \
|
||||||
tty.c \
|
tty.c \
|
||||||
utf8-combined.c \
|
|
||||||
utf8.c \
|
utf8.c \
|
||||||
window-buffer.c \
|
window-buffer.c \
|
||||||
window-client.c \
|
window-client.c \
|
||||||
|
@ -39,7 +39,7 @@ const struct cmd_entry cmd_capture_pane_entry = {
|
|||||||
.name = "capture-pane",
|
.name = "capture-pane",
|
||||||
.alias = "capturep",
|
.alias = "capturep",
|
||||||
|
|
||||||
.args = { "ab:CeE:JNpPqS:Tt:", 0, 0, NULL },
|
.args = { "ab:CeE:JNpPqS:t:", 0, 0, NULL },
|
||||||
.usage = "[-aCeJNpPqT] " CMD_BUFFER_USAGE " [-E end-line] "
|
.usage = "[-aCeJNpPqT] " CMD_BUFFER_USAGE " [-E end-line] "
|
||||||
"[-S start-line] " CMD_TARGET_PANE_USAGE,
|
"[-S start-line] " CMD_TARGET_PANE_USAGE,
|
||||||
|
|
||||||
|
@ -60,7 +60,7 @@ cmd_new_window_exec(struct cmd *self, struct cmdq_item *item)
|
|||||||
struct session *s = target->s;
|
struct session *s = target->s;
|
||||||
struct winlink *wl = target->wl, *new_wl = NULL;
|
struct winlink *wl = target->wl, *new_wl = NULL;
|
||||||
int idx = target->idx, before;
|
int idx = target->idx, before;
|
||||||
char *cause = NULL, *cp, *expanded;
|
char *cause = NULL, *cp;
|
||||||
const char *template, *name;
|
const char *template, *name;
|
||||||
struct cmd_find_state fs;
|
struct cmd_find_state fs;
|
||||||
struct args_value *av;
|
struct args_value *av;
|
||||||
@ -71,19 +71,16 @@ cmd_new_window_exec(struct cmd *self, struct cmdq_item *item)
|
|||||||
*/
|
*/
|
||||||
name = args_get(args, 'n');
|
name = args_get(args, 'n');
|
||||||
if (args_has(args, 'S') && name != NULL && target->idx == -1) {
|
if (args_has(args, 'S') && name != NULL && target->idx == -1) {
|
||||||
expanded = format_single(item, name, c, s, NULL, NULL);
|
|
||||||
RB_FOREACH(wl, winlinks, &s->windows) {
|
RB_FOREACH(wl, winlinks, &s->windows) {
|
||||||
if (strcmp(wl->window->name, expanded) != 0)
|
if (strcmp(wl->window->name, name) != 0)
|
||||||
continue;
|
continue;
|
||||||
if (new_wl == NULL) {
|
if (new_wl == NULL) {
|
||||||
new_wl = wl;
|
new_wl = wl;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
cmdq_error(item, "multiple windows named %s", name);
|
cmdq_error(item, "multiple windows named %s", name);
|
||||||
free(expanded);
|
|
||||||
return (CMD_RETURN_ERROR);
|
return (CMD_RETURN_ERROR);
|
||||||
}
|
}
|
||||||
free(expanded);
|
|
||||||
if (new_wl != NULL) {
|
if (new_wl != NULL) {
|
||||||
if (args_has(args, 'd'))
|
if (args_has(args, 'd'))
|
||||||
return (CMD_RETURN_NORMAL);
|
return (CMD_RETURN_NORMAL);
|
||||||
|
@ -24,8 +24,8 @@
|
|||||||
#include "tmux.h"
|
#include "tmux.h"
|
||||||
|
|
||||||
#define SIXEL_COLOUR_REGISTERS 1024
|
#define SIXEL_COLOUR_REGISTERS 1024
|
||||||
#define SIXEL_WIDTH_LIMIT 10000
|
#define SIXEL_WIDTH_LIMIT 2016
|
||||||
#define SIXEL_HEIGHT_LIMIT 10000
|
#define SIXEL_HEIGHT_LIMIT 2016
|
||||||
|
|
||||||
struct sixel_line {
|
struct sixel_line {
|
||||||
u_int x;
|
u_int x;
|
||||||
|
@ -85,7 +85,7 @@ static const char *options_table_remain_on_exit_list[] = {
|
|||||||
"off", "on", "failed", NULL
|
"off", "on", "failed", NULL
|
||||||
};
|
};
|
||||||
static const char *options_table_detach_on_destroy_list[] = {
|
static const char *options_table_detach_on_destroy_list[] = {
|
||||||
"off", "on", "no-detached", "previous", "next", NULL
|
"off", "on", "no-detached", NULL
|
||||||
};
|
};
|
||||||
static const char *options_table_extended_keys_list[] = {
|
static const char *options_table_extended_keys_list[] = {
|
||||||
"off", "on", "always", NULL
|
"off", "on", "always", NULL
|
||||||
|
@ -1887,8 +1887,6 @@ screen_write_collect_add(struct screen_write_ctx *ctx,
|
|||||||
u_int sx = screen_size_x(s);
|
u_int sx = screen_size_x(s);
|
||||||
int collect;
|
int collect;
|
||||||
|
|
||||||
ctx->flags &= ~SCREEN_WRITE_COMBINE;
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Don't need to check that the attributes and whatnot are still the
|
* Don't need to check that the attributes and whatnot are still the
|
||||||
* same - input_parse will end the collection when anything that isn't
|
* same - input_parse will end the collection when anything that isn't
|
||||||
@ -1937,37 +1935,46 @@ screen_write_cell(struct screen_write_ctx *ctx, const struct grid_cell *gc)
|
|||||||
{
|
{
|
||||||
struct screen *s = ctx->s;
|
struct screen *s = ctx->s;
|
||||||
struct grid *gd = s->grid;
|
struct grid *gd = s->grid;
|
||||||
struct grid_cell copy;
|
const struct utf8_data *ud = &gc->data;
|
||||||
const struct utf8_data *ud = &gc->data, *previous = NULL, *combine;
|
const struct utf8_data zwj = { "\342\200\215", 0, 3, 0 };
|
||||||
struct grid_line *gl;
|
struct grid_line *gl;
|
||||||
struct grid_cell_entry *gce;
|
struct grid_cell_entry *gce;
|
||||||
struct grid_cell tmp_gc, now_gc;
|
struct grid_cell tmp_gc, now_gc;
|
||||||
struct tty_ctx ttyctx;
|
struct tty_ctx ttyctx;
|
||||||
u_int sx = screen_size_x(s), sy = screen_size_y(s);
|
u_int sx = screen_size_x(s), sy = screen_size_y(s);
|
||||||
u_int width = ud->width, xx, last, cx, cy;
|
u_int width = gc->data.width, xx, last, cx, cy;
|
||||||
int selected, skip = 1;
|
int selected, skip = 1;
|
||||||
|
|
||||||
/* Ignore padding cells. */
|
/* Ignore padding cells. */
|
||||||
if (gc->flags & GRID_FLAG_PADDING)
|
if (gc->flags & GRID_FLAG_PADDING)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
/* Check if this cell needs to be combined with the previous cell. */
|
/*
|
||||||
if (ctx->flags & SCREEN_WRITE_COMBINE)
|
* If this is a zero width joiner, set the flag so the next character
|
||||||
previous = &ctx->previous;
|
* will be treated as zero width and appended. Note that we assume a
|
||||||
switch (utf8_try_combined(ud, previous, &combine, &width)) {
|
* ZWJ will not change the width - the width of the first character is
|
||||||
case UTF8_DISCARD_NOW:
|
* used.
|
||||||
log_debug("%s: UTF8_DISCARD_NOW (width %u)", __func__, width);
|
*/
|
||||||
ctx->flags &= ~SCREEN_WRITE_COMBINE;
|
if (ud->size == 3 && memcmp(ud->data, "\342\200\215", 3) == 0) {
|
||||||
|
log_debug("zero width joiner at %u,%u", s->cx, s->cy);
|
||||||
|
ctx->flags |= SCREEN_WRITE_ZWJ;
|
||||||
return;
|
return;
|
||||||
case UTF8_WRITE_NOW:
|
}
|
||||||
log_debug("%s: UTF8_WRITE_NOW (width %u)", __func__, width);
|
|
||||||
ctx->flags &= ~SCREEN_WRITE_COMBINE;
|
/*
|
||||||
break;
|
* If the width is zero, combine onto the previous character. We always
|
||||||
case UTF8_COMBINE_NOW:
|
* combine with the cell to the left of the cursor position. In theory,
|
||||||
log_debug("%s: UTF8_COMBINE_NOW (width %u)", __func__, width);
|
* the application could have moved the cursor somewhere else, but if
|
||||||
|
* they are silly enough to do that, who cares?
|
||||||
|
*/
|
||||||
|
if (ctx->flags & SCREEN_WRITE_ZWJ) {
|
||||||
screen_write_collect_flush(ctx, 0, __func__);
|
screen_write_collect_flush(ctx, 0, __func__);
|
||||||
gc = screen_write_combine(ctx, combine, &xx, &cx);
|
screen_write_combine(ctx, &zwj, &xx, &cx);
|
||||||
if (gc != NULL) {
|
}
|
||||||
|
if (width == 0 || (ctx->flags & SCREEN_WRITE_ZWJ)) {
|
||||||
|
ctx->flags &= ~SCREEN_WRITE_ZWJ;
|
||||||
|
screen_write_collect_flush(ctx, 0, __func__);
|
||||||
|
if ((gc = screen_write_combine(ctx, ud, &xx, &cx)) != NULL) {
|
||||||
cy = s->cy;
|
cy = s->cy;
|
||||||
screen_write_set_cursor(ctx, xx, s->cy);
|
screen_write_set_cursor(ctx, xx, s->cy);
|
||||||
screen_write_initctx(ctx, &ttyctx, 0);
|
screen_write_initctx(ctx, &ttyctx, 0);
|
||||||
@ -1975,27 +1982,8 @@ screen_write_cell(struct screen_write_ctx *ctx, const struct grid_cell *gc)
|
|||||||
tty_write(tty_cmd_cell, &ttyctx);
|
tty_write(tty_cmd_cell, &ttyctx);
|
||||||
s->cx = cx; s->cy = cy;
|
s->cx = cx; s->cy = cy;
|
||||||
}
|
}
|
||||||
ctx->flags &= ~SCREEN_WRITE_COMBINE;
|
|
||||||
return;
|
|
||||||
case UTF8_WRITE_MAYBE_COMBINE:
|
|
||||||
log_debug("%s: UTF8_WRITE_MAYBE_COMBINE (width %u)", __func__,
|
|
||||||
width);
|
|
||||||
utf8_copy(&ctx->previous, ud);
|
|
||||||
ctx->flags |= SCREEN_WRITE_COMBINE;
|
|
||||||
break;
|
|
||||||
case UTF8_DISCARD_MAYBE_COMBINE:
|
|
||||||
log_debug("%s: UTF8_DISCARD_MAYBE_COMBINE (width %u)", __func__,
|
|
||||||
width);
|
|
||||||
utf8_copy(&ctx->previous, ud);
|
|
||||||
ctx->flags |= SCREEN_WRITE_COMBINE;
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (width != ud->width) {
|
|
||||||
memcpy(©, gc, sizeof copy);
|
|
||||||
copy.data.width = width;
|
|
||||||
gc = ©
|
|
||||||
}
|
|
||||||
ud = NULL;
|
|
||||||
|
|
||||||
/* Flush any existing scrolling. */
|
/* Flush any existing scrolling. */
|
||||||
screen_write_collect_flush(ctx, 1, __func__);
|
screen_write_collect_flush(ctx, 1, __func__);
|
||||||
|
51
server-fn.c
51
server-fn.c
@ -27,6 +27,7 @@
|
|||||||
|
|
||||||
#include "tmux.h"
|
#include "tmux.h"
|
||||||
|
|
||||||
|
static struct session *server_next_session(struct session *);
|
||||||
static void server_destroy_session_group(struct session *);
|
static void server_destroy_session_group(struct session *);
|
||||||
|
|
||||||
void
|
void
|
||||||
@ -206,7 +207,7 @@ server_kill_window(struct window *w, int renumber)
|
|||||||
if (session_detach(s, wl)) {
|
if (session_detach(s, wl)) {
|
||||||
server_destroy_session_group(s);
|
server_destroy_session_group(s);
|
||||||
break;
|
break;
|
||||||
}
|
} else
|
||||||
server_redraw_session_group(s);
|
server_redraw_session_group(s);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -384,10 +385,9 @@ server_destroy_session_group(struct session *s)
|
|||||||
struct session_group *sg;
|
struct session_group *sg;
|
||||||
struct session *s1;
|
struct session *s1;
|
||||||
|
|
||||||
if ((sg = session_group_contains(s)) == NULL) {
|
if ((sg = session_group_contains(s)) == NULL)
|
||||||
server_destroy_session(s);
|
server_destroy_session(s);
|
||||||
session_destroy(s, 1, __func__);
|
else {
|
||||||
} else {
|
|
||||||
TAILQ_FOREACH_SAFE(s, &sg->sessions, gentry, s1) {
|
TAILQ_FOREACH_SAFE(s, &sg->sessions, gentry, s1) {
|
||||||
server_destroy_session(s);
|
server_destroy_session(s);
|
||||||
session_destroy(s, 1, __func__);
|
session_destroy(s, 1, __func__);
|
||||||
@ -396,55 +396,52 @@ server_destroy_session_group(struct session *s)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static struct session *
|
static struct session *
|
||||||
server_find_session(struct session *s,
|
server_next_session(struct session *s)
|
||||||
int (*f)(struct session *, struct session *))
|
|
||||||
{
|
{
|
||||||
struct session *s_loop, *s_out = NULL;
|
struct session *s_loop, *s_out = NULL;
|
||||||
|
|
||||||
RB_FOREACH(s_loop, sessions, &sessions) {
|
RB_FOREACH(s_loop, sessions, &sessions) {
|
||||||
if (s_loop != s && (s_out == NULL || f(s_loop, s_out)))
|
if (s_loop == s)
|
||||||
|
continue;
|
||||||
|
if (s_out == NULL ||
|
||||||
|
timercmp(&s_loop->activity_time, &s_out->activity_time, <))
|
||||||
s_out = s_loop;
|
s_out = s_loop;
|
||||||
}
|
}
|
||||||
return (s_out);
|
return (s_out);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static struct session *
|
||||||
server_newer_session(struct session *s_loop, struct session *s_out)
|
server_next_detached_session(struct session *s)
|
||||||
{
|
{
|
||||||
return (timercmp(&s_loop->activity_time, &s_out->activity_time, <));
|
struct session *s_loop, *s_out = NULL;
|
||||||
}
|
|
||||||
|
|
||||||
static int
|
RB_FOREACH(s_loop, sessions, &sessions) {
|
||||||
server_newer_detached_session(struct session *s_loop, struct session *s_out)
|
if (s_loop == s || s_loop->attached)
|
||||||
{
|
continue;
|
||||||
if (s_loop->attached)
|
if (s_out == NULL ||
|
||||||
return (0);
|
timercmp(&s_loop->activity_time, &s_out->activity_time, <))
|
||||||
return (server_newer_session(s_loop, s_out));
|
s_out = s_loop;
|
||||||
|
}
|
||||||
|
return (s_out);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
server_destroy_session(struct session *s)
|
server_destroy_session(struct session *s)
|
||||||
{
|
{
|
||||||
struct client *c;
|
struct client *c;
|
||||||
struct session *s_new = NULL;
|
struct session *s_new;
|
||||||
int detach_on_destroy;
|
int detach_on_destroy;
|
||||||
|
|
||||||
detach_on_destroy = options_get_number(s->options, "detach-on-destroy");
|
detach_on_destroy = options_get_number(s->options, "detach-on-destroy");
|
||||||
if (detach_on_destroy == 0)
|
if (detach_on_destroy == 0)
|
||||||
s_new = server_find_session(s, server_newer_session);
|
s_new = server_next_session(s);
|
||||||
else if (detach_on_destroy == 2)
|
else if (detach_on_destroy == 2)
|
||||||
s_new = server_find_session(s, server_newer_detached_session);
|
s_new = server_next_detached_session(s);
|
||||||
else if (detach_on_destroy == 3)
|
else
|
||||||
s_new = session_previous_session(s);
|
|
||||||
else if (detach_on_destroy == 4)
|
|
||||||
s_new = session_next_session(s);
|
|
||||||
if (s_new == s)
|
|
||||||
s_new = NULL;
|
s_new = NULL;
|
||||||
TAILQ_FOREACH(c, &clients, entry) {
|
TAILQ_FOREACH(c, &clients, entry) {
|
||||||
if (c->session != s)
|
if (c->session != s)
|
||||||
continue;
|
continue;
|
||||||
c->session = NULL;
|
|
||||||
c->last_session = NULL;
|
|
||||||
server_client_set_session(c, s_new);
|
server_client_set_session(c, s_new);
|
||||||
if (s_new == NULL)
|
if (s_new == NULL)
|
||||||
c->flags |= CLIENT_EXIT;
|
c->flags |= CLIENT_EXIT;
|
||||||
|
1
server.c
1
server.c
@ -207,7 +207,6 @@ server_start(struct tmuxproc *client, int flags, struct event_base *base,
|
|||||||
fatal("pledge failed");
|
fatal("pledge failed");
|
||||||
|
|
||||||
input_key_build();
|
input_key_build();
|
||||||
utf8_build_combined();
|
|
||||||
RB_INIT(&windows);
|
RB_INIT(&windows);
|
||||||
RB_INIT(&all_window_panes);
|
RB_INIT(&all_window_panes);
|
||||||
TAILQ_INIT(&clients);
|
TAILQ_INIT(&clients);
|
||||||
|
@ -365,8 +365,10 @@ session_detach(struct session *s, struct winlink *wl)
|
|||||||
|
|
||||||
session_group_synchronize_from(s);
|
session_group_synchronize_from(s);
|
||||||
|
|
||||||
if (RB_EMPTY(&s->windows))
|
if (RB_EMPTY(&s->windows)) {
|
||||||
|
session_destroy(s, 1, __func__);
|
||||||
return (1);
|
return (1);
|
||||||
|
}
|
||||||
return (0);
|
return (0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
15
tmux.1
15
tmux.1
@ -4042,25 +4042,16 @@ The default is 80x24.
|
|||||||
If enabled and the session is no longer attached to any clients, it is
|
If enabled and the session is no longer attached to any clients, it is
|
||||||
destroyed.
|
destroyed.
|
||||||
.It Xo Ic detach-on-destroy
|
.It Xo Ic detach-on-destroy
|
||||||
.Op Ic off | on | no-detached | previous | next
|
.Op Ic off | on | no-detached
|
||||||
.Xc
|
.Xc
|
||||||
If
|
If on (the default), the client is detached when the session it is attached to
|
||||||
.Ic on
|
|
||||||
(the default), the client is detached when the session it is attached to
|
|
||||||
is destroyed.
|
is destroyed.
|
||||||
If
|
If off, the client is switched to the most recently active of the remaining
|
||||||
.Ic off ,
|
|
||||||
the client is switched to the most recently active of the remaining
|
|
||||||
sessions.
|
sessions.
|
||||||
If
|
If
|
||||||
.Ic no-detached ,
|
.Ic no-detached ,
|
||||||
the client is detached only if there are no detached sessions; if detached
|
the client is detached only if there are no detached sessions; if detached
|
||||||
sessions exist, the client is switched to the most recently active.
|
sessions exist, the client is switched to the most recently active.
|
||||||
If
|
|
||||||
.Ic previous
|
|
||||||
or
|
|
||||||
.Ic next ,
|
|
||||||
the client is switched to the previous or next session in alphabetical order.
|
|
||||||
.It Ic display-panes-active-colour Ar colour
|
.It Ic display-panes-active-colour Ar colour
|
||||||
Set the colour used by the
|
Set the colour used by the
|
||||||
.Ic display-panes
|
.Ic display-panes
|
||||||
|
21
tmux.h
21
tmux.h
@ -627,15 +627,6 @@ enum utf8_state {
|
|||||||
UTF8_ERROR
|
UTF8_ERROR
|
||||||
};
|
};
|
||||||
|
|
||||||
/* UTF-8 combine state. */
|
|
||||||
enum utf8_combine_state {
|
|
||||||
UTF8_DISCARD_NOW, /* discard immediately */
|
|
||||||
UTF8_WRITE_NOW, /* do not combine, write immediately */
|
|
||||||
UTF8_COMBINE_NOW, /* combine immediately */
|
|
||||||
UTF8_WRITE_MAYBE_COMBINE, /* write but try to combine the next */
|
|
||||||
UTF8_DISCARD_MAYBE_COMBINE /* discard but try to combine the next */
|
|
||||||
};
|
|
||||||
|
|
||||||
/* Colour flags. */
|
/* Colour flags. */
|
||||||
#define COLOUR_FLAG_256 0x01000000
|
#define COLOUR_FLAG_256 0x01000000
|
||||||
#define COLOUR_FLAG_RGB 0x02000000
|
#define COLOUR_FLAG_RGB 0x02000000
|
||||||
@ -930,7 +921,7 @@ struct screen_write_ctx {
|
|||||||
|
|
||||||
int flags;
|
int flags;
|
||||||
#define SCREEN_WRITE_SYNC 0x1
|
#define SCREEN_WRITE_SYNC 0x1
|
||||||
#define SCREEN_WRITE_COMBINE 0x2
|
#define SCREEN_WRITE_ZWJ 0x2
|
||||||
|
|
||||||
screen_write_init_ctx_cb init_ctx_cb;
|
screen_write_init_ctx_cb init_ctx_cb;
|
||||||
void *arg;
|
void *arg;
|
||||||
@ -938,7 +929,6 @@ struct screen_write_ctx {
|
|||||||
struct screen_write_citem *item;
|
struct screen_write_citem *item;
|
||||||
u_int scrolled;
|
u_int scrolled;
|
||||||
u_int bg;
|
u_int bg;
|
||||||
struct utf8_data previous;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
/* Box border lines option. */
|
/* Box border lines option. */
|
||||||
@ -3348,15 +3338,6 @@ int utf8_cstrhas(const char *, const struct utf8_data *);
|
|||||||
char *osdep_get_name(int, char *);
|
char *osdep_get_name(int, char *);
|
||||||
char *osdep_get_cwd(int);
|
char *osdep_get_cwd(int);
|
||||||
struct event_base *osdep_event_init(void);
|
struct event_base *osdep_event_init(void);
|
||||||
/* utf8-combined.c */
|
|
||||||
void utf8_build_combined(void);
|
|
||||||
int utf8_try_combined(const struct utf8_data *,
|
|
||||||
const struct utf8_data *, const struct utf8_data **,
|
|
||||||
u_int *width);
|
|
||||||
|
|
||||||
/* procname.c */
|
|
||||||
char *get_proc_name(int, char *);
|
|
||||||
char *get_proc_cwd(int);
|
|
||||||
|
|
||||||
/* log.c */
|
/* log.c */
|
||||||
void log_add_level(void);
|
void log_add_level(void);
|
||||||
|
1135
utf8-combined.c
1135
utf8-combined.c
File diff suppressed because it is too large
Load Diff
6
utf8.c
6
utf8.c
@ -229,13 +229,13 @@ utf8_width(struct utf8_data *ud, int *width)
|
|||||||
case 0:
|
case 0:
|
||||||
return (UTF8_ERROR);
|
return (UTF8_ERROR);
|
||||||
}
|
}
|
||||||
log_debug("UTF-8 %.*s is %05X", (int)ud->size, ud->data, (u_int)wc);
|
log_debug("UTF-8 %.*s is %08X", (int)ud->size, ud->data, (u_int)wc);
|
||||||
#ifdef HAVE_UTF8PROC
|
#ifdef HAVE_UTF8PROC
|
||||||
*width = utf8proc_wcwidth(wc);
|
*width = utf8proc_wcwidth(wc);
|
||||||
log_debug("utf8proc_wcwidth(%05X) returned %d", (u_int)wc, *width);
|
log_debug("utf8proc_wcwidth(%08X) returned %d", (u_int)wc, *width);
|
||||||
#else
|
#else
|
||||||
*width = wcwidth(wc);
|
*width = wcwidth(wc);
|
||||||
log_debug("wcwidth(%05X) returned %d", (u_int)wc, *width);
|
log_debug("wcwidth(%08X) returned %d", (u_int)wc, *width);
|
||||||
if (*width < 0) {
|
if (*width < 0) {
|
||||||
/*
|
/*
|
||||||
* C1 control characters are nonprintable, so they are always
|
* C1 control characters are nonprintable, so they are always
|
||||||
|
@ -3763,7 +3763,8 @@ window_copy_search(struct window_mode_entry *wme, int direction, int regex)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
endline = gd->hsize + gd->sy - 1;
|
endline = gd->hsize + gd->sy - 1;
|
||||||
} else {
|
}
|
||||||
|
else {
|
||||||
window_copy_move_left(s, &fx, &fy, wrapflag);
|
window_copy_move_left(s, &fx, &fy, wrapflag);
|
||||||
endline = 0;
|
endline = 0;
|
||||||
}
|
}
|
||||||
@ -3805,7 +3806,8 @@ window_copy_search(struct window_mode_entry *wme, int direction, int regex)
|
|||||||
data->cy = fy - screen_hsize(data->backing) +
|
data->cy = fy - screen_hsize(data->backing) +
|
||||||
data-> oy;
|
data-> oy;
|
||||||
}
|
}
|
||||||
} else {
|
}
|
||||||
|
else {
|
||||||
/*
|
/*
|
||||||
* When searching backward, position the cursor at the
|
* When searching backward, position the cursor at the
|
||||||
* beginning of the mark.
|
* beginning of the mark.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user