comparison src/libvterm/src/state.c @ 20448:89fade12827d v8.2.0778

patch 8.2.0778: libvterm code lags behind the upstream version Commit: https://github.com/vim/vim/commit/d4a5f40c0cc45fdfac01df0e408d557006eb0206 Author: Bram Moolenaar <Bram@vim.org> Date: Sun May 17 16:04:44 2020 +0200 patch 8.2.0778: libvterm code lags behind the upstream version Problem: Libvterm code lags behind the upstream version. Solution: Include revisions 720 - 723.
author Bram Moolenaar <Bram@vim.org>
date Sun, 17 May 2020 16:15:03 +0200
parents e8d1f3209dcd
children c15dd3da4f47
comparison
equal deleted inserted replaced
20447:4fdc8319ab24 20448:89fade12827d
920 static int on_csi(const char *leader, const long args[], int argcount, const char *intermed, char command, void *user) 920 static int on_csi(const char *leader, const long args[], int argcount, const char *intermed, char command, void *user)
921 { 921 {
922 VTermState *state = user; 922 VTermState *state = user;
923 int leader_byte = 0; 923 int leader_byte = 0;
924 int intermed_byte = 0; 924 int intermed_byte = 0;
925 int cancel_phantom = 1;
925 VTermPos oldpos = state->pos; 926 VTermPos oldpos = state->pos;
926 int handled = 1; 927 int handled = 1;
927 928
928 // Some temporaries for later code 929 // Some temporaries for later code
929 int count, val; 930 int count, val;
1235 count = CSI_ARG_COUNT(args[0]); 1236 count = CSI_ARG_COUNT(args[0]);
1236 state->pos.col += count; 1237 state->pos.col += count;
1237 state->at_phantom = 0; 1238 state->at_phantom = 0;
1238 break; 1239 break;
1239 1240
1241 case 0x62: { // REP - ECMA-48 8.3.103
1242 const int row_width = THISROWWIDTH(state);
1243 count = CSI_ARG_COUNT(args[0]);
1244 col = state->pos.col + count;
1245 UBOUND(col, row_width);
1246 while (state->pos.col < col) {
1247 putglyph(state, state->combine_chars, state->combine_width, state->pos);
1248 state->pos.col += state->combine_width;
1249 }
1250 if (state->pos.col + state->combine_width >= row_width) {
1251 if (state->mode.autowrap) {
1252 state->at_phantom = 1;
1253 cancel_phantom = 0;
1254 }
1255 }
1256 break;
1257 }
1258
1240 case 0x63: // DA - ECMA-48 8.3.24 1259 case 0x63: // DA - ECMA-48 8.3.24
1241 val = CSI_ARG_OR(args[0], 0); 1260 val = CSI_ARG_OR(args[0], 0);
1242 if(val == 0) 1261 if(val == 0)
1243 // DEC VT100 response 1262 // DEC VT100 response
1244 vterm_push_output_sprintf_ctrl(state->vt, C1_CSI, "?1;2c"); 1263 vterm_push_output_sprintf_ctrl(state->vt, C1_CSI, "?1;2c");
1521 UBOUND(state->pos.row, state->rows-1); 1540 UBOUND(state->pos.row, state->rows-1);
1522 LBOUND(state->pos.col, 0); 1541 LBOUND(state->pos.col, 0);
1523 UBOUND(state->pos.col, THISROWWIDTH(state)-1); 1542 UBOUND(state->pos.col, THISROWWIDTH(state)-1);
1524 } 1543 }
1525 1544
1526 updatecursor(state, &oldpos, 1); 1545 updatecursor(state, &oldpos, cancel_phantom);
1527 1546
1528 #ifdef DEBUG 1547 #ifdef DEBUG
1529 if(state->pos.row < 0 || state->pos.row >= state->rows || 1548 if(state->pos.row < 0 || state->pos.row >= state->rows ||
1530 state->pos.col < 0 || state->pos.col >= state->cols) { 1549 state->pos.col < 0 || state->pos.col >= state->cols) {
1531 fprintf(stderr, "Position out of bounds after CSI %c: (%d,%d)\n", 1550 fprintf(stderr, "Position out of bounds after CSI %c: (%d,%d)\n",