* catch limit off in x_redraw (bytes vs chars vs curpos)
XXX should probably be screenpos, might need to use x_size* here XXX this seems to be the tab bug I noticed which we inherited from obsd * catch backspace if x_col == 0 (XXX better)
This commit is contained in:
parent
47daa0eadc
commit
b03ed7b315
22
edit.c
22
edit.c
@ -5,7 +5,7 @@
|
|||||||
|
|
||||||
#include "sh.h"
|
#include "sh.h"
|
||||||
|
|
||||||
__RCSID("$MirOS: src/bin/mksh/edit.c,v 1.51 2006/11/05 19:15:15 tg Exp $");
|
__RCSID("$MirOS: src/bin/mksh/edit.c,v 1.52 2006/11/05 19:35:52 tg Exp $");
|
||||||
|
|
||||||
/* tty driver characters we are interested in */
|
/* tty driver characters we are interested in */
|
||||||
typedef struct {
|
typedef struct {
|
||||||
@ -2204,9 +2204,14 @@ x_load_hist(char **hp)
|
|||||||
xbp = xbuf;
|
xbp = xbuf;
|
||||||
xep = xcp = xbuf + strlen(xbuf);
|
xep = xcp = xbuf + strlen(xbuf);
|
||||||
xlp_valid = false;
|
xlp_valid = false;
|
||||||
if (xep <= x_lastcp())
|
D("J");
|
||||||
|
if (xep <= x_lastcp()) {
|
||||||
|
D("K %d ", oldsize);
|
||||||
x_redraw(oldsize);
|
x_redraw(oldsize);
|
||||||
|
}
|
||||||
|
D("L");
|
||||||
x_goto(xep);
|
x_goto(xep);
|
||||||
|
D("M");
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
@ -2405,8 +2410,13 @@ x_redraw(int limit)
|
|||||||
if (limit >= 0) {
|
if (limit >= 0) {
|
||||||
if (xep > xlp)
|
if (xep > xlp)
|
||||||
i = 0; /* we fill the line */
|
i = 0; /* we fill the line */
|
||||||
else
|
else {
|
||||||
i = limit - (xlp - xbp);
|
char *cpl = xbp;
|
||||||
|
|
||||||
|
i = limit;
|
||||||
|
while (cpl < xlp)
|
||||||
|
i -= utf_widthadj(cpl, (const char **)&cpl);
|
||||||
|
}
|
||||||
|
|
||||||
for (j = 0; j < i && x_col < (xx_cols - 2); j++)
|
for (j = 0; j < i && x_col < (xx_cols - 2); j++)
|
||||||
x_e_putc2(' ');
|
x_e_putc2(' ');
|
||||||
@ -3052,7 +3062,7 @@ x_e_putc2(int c)
|
|||||||
|
|
||||||
if (c == '\r' || c == '\n')
|
if (c == '\r' || c == '\n')
|
||||||
x_col = 0;
|
x_col = 0;
|
||||||
if (x_col < xx_cols) {
|
if ((x_col < xx_cols) && (x_col || (c != '\b'))) {
|
||||||
if (Flag(FUTFHACK) && (c > 0x7F)) {
|
if (Flag(FUTFHACK) && (c > 0x7F)) {
|
||||||
char utf_tmp[3];
|
char utf_tmp[3];
|
||||||
size_t x;
|
size_t x;
|
||||||
@ -3094,7 +3104,7 @@ x_e_putc3(const char **cp)
|
|||||||
|
|
||||||
if (c == '\r' || c == '\n')
|
if (c == '\r' || c == '\n')
|
||||||
x_col = 0;
|
x_col = 0;
|
||||||
if (x_col < xx_cols) {
|
if ((x_col < xx_cols) && (x_col || (c != '\b'))) {
|
||||||
if (Flag(FUTFHACK) && (c > 0x7F)) {
|
if (Flag(FUTFHACK) && (c > 0x7F)) {
|
||||||
char *cp2;
|
char *cp2;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user