annotate src/libvterm/src/termscreen.c @ 18064:8b4f9be5db73 v8.1.2027

patch 8.1.2027: MS-Windows: problem with ambiwidth characters Commit: https://github.com/vim/vim/commit/57da69816872d53038e8a7e8dd4dc39a31192f0d Author: Bram Moolenaar <Bram@vim.org> Date: Fri Sep 13 22:30:11 2019 +0200 patch 8.1.2027: MS-Windows: problem with ambiwidth characters Problem: MS-Windows: problem with ambiwidth characters. Solution: handle ambiguous width characters in ConPTY on Windows 10 (1903). (Nobuhiro Takasaki, closes #4411)
author Bram Moolenaar <Bram@vim.org>
date Fri, 13 Sep 2019 22:45:04 +0200
parents 811a12a78164
children 9c3347b21b89
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
14734
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
1 #include "vterm_internal.h"
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
2
17777
811a12a78164 patch 8.1.1885: comments in libvterm are inconsistent
Bram Moolenaar <Bram@vim.org>
parents: 16429
diff changeset
3 // vim: set sw=2 :
14734
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
4 #include <stdio.h>
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
5 #include <string.h>
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
6
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
7 #include "rect.h"
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
8 #include "utf8.h"
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
9
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
10 #define UNICODE_SPACE 0x20
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
11 #define UNICODE_LINEFEED 0x0a
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
12
17777
811a12a78164 patch 8.1.1885: comments in libvterm are inconsistent
Bram Moolenaar <Bram@vim.org>
parents: 16429
diff changeset
13 // State of the pen at some moment in time, also used in a cell
14734
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
14 typedef struct
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
15 {
17777
811a12a78164 patch 8.1.1885: comments in libvterm are inconsistent
Bram Moolenaar <Bram@vim.org>
parents: 16429
diff changeset
16 // After the bitfield
14734
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
17 VTermColor fg, bg;
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
18
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
19 unsigned int bold : 1;
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
20 unsigned int underline : 2;
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
21 unsigned int italic : 1;
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
22 unsigned int blink : 1;
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
23 unsigned int reverse : 1;
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
24 unsigned int strike : 1;
17777
811a12a78164 patch 8.1.1885: comments in libvterm are inconsistent
Bram Moolenaar <Bram@vim.org>
parents: 16429
diff changeset
25 unsigned int font : 4; // 0 to 9
14734
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
26
17777
811a12a78164 patch 8.1.1885: comments in libvterm are inconsistent
Bram Moolenaar <Bram@vim.org>
parents: 16429
diff changeset
27 // Extra state storage that isn't strictly pen-related
14734
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
28 unsigned int protected_cell : 1;
17777
811a12a78164 patch 8.1.1885: comments in libvterm are inconsistent
Bram Moolenaar <Bram@vim.org>
parents: 16429
diff changeset
29 unsigned int dwl : 1; // on a DECDWL or DECDHL line
811a12a78164 patch 8.1.1885: comments in libvterm are inconsistent
Bram Moolenaar <Bram@vim.org>
parents: 16429
diff changeset
30 unsigned int dhl : 2; // on a DECDHL line (1=top 2=bottom)
14734
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
31 } ScreenPen;
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
32
17777
811a12a78164 patch 8.1.1885: comments in libvterm are inconsistent
Bram Moolenaar <Bram@vim.org>
parents: 16429
diff changeset
33 // Internal representation of a screen cell
14734
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
34 typedef struct
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
35 {
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
36 uint32_t chars[VTERM_MAX_CHARS_PER_CELL];
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
37 ScreenPen pen;
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
38 } ScreenCell;
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
39
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
40 static int vterm_screen_set_cell(VTermScreen *screen, VTermPos pos, const VTermScreenCell *cell);
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
41
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
42 struct VTermScreen
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
43 {
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
44 VTerm *vt;
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
45 VTermState *state;
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
46
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
47 const VTermScreenCallbacks *callbacks;
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
48 void *cbdata;
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
49
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
50 VTermDamageSize damage_merge;
17777
811a12a78164 patch 8.1.1885: comments in libvterm are inconsistent
Bram Moolenaar <Bram@vim.org>
parents: 16429
diff changeset
51 // start_row == -1 => no damage
14734
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
52 VTermRect damaged;
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
53 VTermRect pending_scrollrect;
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
54 int pending_scroll_downward, pending_scroll_rightward;
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
55
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
56 int rows;
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
57 int cols;
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
58 int global_reverse;
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
59
17777
811a12a78164 patch 8.1.1885: comments in libvterm are inconsistent
Bram Moolenaar <Bram@vim.org>
parents: 16429
diff changeset
60 // Primary and Altscreen. buffers[1] is lazily allocated as needed
14734
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
61 ScreenCell *buffers[2];
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
62
17777
811a12a78164 patch 8.1.1885: comments in libvterm are inconsistent
Bram Moolenaar <Bram@vim.org>
parents: 16429
diff changeset
63 // buffer will == buffers[0] or buffers[1], depending on altscreen
14734
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
64 ScreenCell *buffer;
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
65
17777
811a12a78164 patch 8.1.1885: comments in libvterm are inconsistent
Bram Moolenaar <Bram@vim.org>
parents: 16429
diff changeset
66 // buffer for a single screen row used in scrollback storage callbacks
14734
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
67 VTermScreenCell *sb_buffer;
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
68
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
69 ScreenPen pen;
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
70 };
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
71
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
72 static ScreenCell *getcell(const VTermScreen *screen, int row, int col)
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
73 {
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
74 if(row < 0 || row >= screen->rows)
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
75 return NULL;
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
76 if(col < 0 || col >= screen->cols)
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
77 return NULL;
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
78 return screen->buffer + (screen->cols * row) + col;
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
79 }
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
80
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
81 static ScreenCell *realloc_buffer(VTermScreen *screen, ScreenCell *buffer, int new_rows, int new_cols)
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
82 {
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
83 ScreenCell *new_buffer = vterm_allocator_malloc(screen->vt, sizeof(ScreenCell) * new_rows * new_cols);
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
84 int row, col;
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
85
16429
a1229400434a patch 8.1.1219: not checking for NULL return from alloc()
Bram Moolenaar <Bram@vim.org>
parents: 15249
diff changeset
86 if (new_buffer == NULL)
a1229400434a patch 8.1.1219: not checking for NULL return from alloc()
Bram Moolenaar <Bram@vim.org>
parents: 15249
diff changeset
87 return NULL;
14734
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
88 for(row = 0; row < new_rows; row++) {
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
89 for(col = 0; col < new_cols; col++) {
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
90 ScreenCell *new_cell = new_buffer + row*new_cols + col;
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
91
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
92 if(buffer && row < screen->rows && col < screen->cols)
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
93 *new_cell = buffer[row * screen->cols + col];
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
94 else {
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
95 new_cell->chars[0] = 0;
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
96 new_cell->pen = screen->pen;
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
97 }
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
98 }
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
99 }
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
100
15249
544490b69e1d patch 8.1.0633: crash when out of memory while opening a terminal window
Bram Moolenaar <Bram@vim.org>
parents: 14734
diff changeset
101 vterm_allocator_free(screen->vt, buffer);
14734
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
102
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
103 return new_buffer;
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
104 }
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
105
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
106 static void damagerect(VTermScreen *screen, VTermRect rect)
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
107 {
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
108 VTermRect emit;
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
109
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
110 switch(screen->damage_merge) {
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
111 case VTERM_DAMAGE_CELL:
17777
811a12a78164 patch 8.1.1885: comments in libvterm are inconsistent
Bram Moolenaar <Bram@vim.org>
parents: 16429
diff changeset
112 // Always emit damage event
14734
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
113 emit = rect;
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
114 break;
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
115
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
116 case VTERM_DAMAGE_ROW:
17777
811a12a78164 patch 8.1.1885: comments in libvterm are inconsistent
Bram Moolenaar <Bram@vim.org>
parents: 16429
diff changeset
117 // Emit damage longer than one row. Try to merge with existing damage in
811a12a78164 patch 8.1.1885: comments in libvterm are inconsistent
Bram Moolenaar <Bram@vim.org>
parents: 16429
diff changeset
118 // the same row
14734
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
119 if(rect.end_row > rect.start_row + 1) {
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
120 // Bigger than 1 line - flush existing, emit this
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
121 vterm_screen_flush_damage(screen);
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
122 emit = rect;
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
123 }
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
124 else if(screen->damaged.start_row == -1) {
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
125 // None stored yet
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
126 screen->damaged = rect;
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
127 return;
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
128 }
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
129 else if(rect.start_row == screen->damaged.start_row) {
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
130 // Merge with the stored line
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
131 if(screen->damaged.start_col > rect.start_col)
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
132 screen->damaged.start_col = rect.start_col;
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
133 if(screen->damaged.end_col < rect.end_col)
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
134 screen->damaged.end_col = rect.end_col;
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
135 return;
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
136 }
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
137 else {
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
138 // Emit the currently stored line, store a new one
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
139 emit = screen->damaged;
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
140 screen->damaged = rect;
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
141 }
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
142 break;
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
143
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
144 case VTERM_DAMAGE_SCREEN:
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
145 case VTERM_DAMAGE_SCROLL:
17777
811a12a78164 patch 8.1.1885: comments in libvterm are inconsistent
Bram Moolenaar <Bram@vim.org>
parents: 16429
diff changeset
146 // Never emit damage event
14734
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
147 if(screen->damaged.start_row == -1)
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
148 screen->damaged = rect;
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
149 else {
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
150 rect_expand(&screen->damaged, &rect);
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
151 }
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
152 return;
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
153
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
154 default:
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
155 DEBUG_LOG1("TODO: Maybe merge damage for level %d\n", screen->damage_merge);
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
156 return;
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
157 }
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
158
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
159 if(screen->callbacks && screen->callbacks->damage)
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
160 (*screen->callbacks->damage)(emit, screen->cbdata);
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
161 }
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
162
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
163 static void damagescreen(VTermScreen *screen)
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
164 {
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
165 VTermRect rect = {0,0,0,0};
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
166 rect.end_row = screen->rows;
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
167 rect.end_col = screen->cols;
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
168
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
169 damagerect(screen, rect);
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
170 }
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
171
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
172 static int putglyph(VTermGlyphInfo *info, VTermPos pos, void *user)
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
173 {
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
174 int i;
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
175 int col;
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
176 VTermRect rect;
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
177
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
178 VTermScreen *screen = user;
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
179 ScreenCell *cell = getcell(screen, pos.row, pos.col);
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
180
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
181 if(!cell)
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
182 return 0;
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
183
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
184 for(i = 0; i < VTERM_MAX_CHARS_PER_CELL && info->chars[i]; i++) {
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
185 cell->chars[i] = info->chars[i];
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
186 cell->pen = screen->pen;
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
187 }
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
188 if(i < VTERM_MAX_CHARS_PER_CELL)
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
189 cell->chars[i] = 0;
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
190
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
191 for(col = 1; col < info->width; col++)
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
192 getcell(screen, pos.row, pos.col + col)->chars[0] = (uint32_t)-1;
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
193
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
194 rect.start_row = pos.row;
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
195 rect.end_row = pos.row+1;
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
196 rect.start_col = pos.col;
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
197 rect.end_col = pos.col+info->width;
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
198
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
199 cell->pen.protected_cell = info->protected_cell;
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
200 cell->pen.dwl = info->dwl;
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
201 cell->pen.dhl = info->dhl;
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
202
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
203 damagerect(screen, rect);
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
204
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
205 return 1;
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
206 }
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
207
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
208 static int moverect_internal(VTermRect dest, VTermRect src, void *user)
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
209 {
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
210 VTermScreen *screen = user;
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
211
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
212 if(screen->callbacks && screen->callbacks->sb_pushline &&
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
213 dest.start_row == 0 && dest.start_col == 0 && // starts top-left corner
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
214 dest.end_col == screen->cols && // full width
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
215 screen->buffer == screen->buffers[0]) { // not altscreen
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
216 VTermPos pos;
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
217 for(pos.row = 0; pos.row < src.start_row; pos.row++) {
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
218 for(pos.col = 0; pos.col < screen->cols; pos.col++)
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
219 (void)vterm_screen_get_cell(screen, pos, screen->sb_buffer + pos.col);
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
220
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
221 (screen->callbacks->sb_pushline)(screen->cols, screen->sb_buffer, screen->cbdata);
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
222 }
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
223 }
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
224
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
225 {
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
226 int cols = src.end_col - src.start_col;
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
227 int downward = src.start_row - dest.start_row;
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
228 int init_row, test_row, inc_row;
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
229 int row;
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
230
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
231 if(downward < 0) {
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
232 init_row = dest.end_row - 1;
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
233 test_row = dest.start_row - 1;
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
234 inc_row = -1;
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
235 }
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
236 else {
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
237 init_row = dest.start_row;
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
238 test_row = dest.end_row;
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
239 inc_row = +1;
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
240 }
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
241
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
242 for(row = init_row; row != test_row; row += inc_row)
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
243 memmove(getcell(screen, row, dest.start_col),
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
244 getcell(screen, row + downward, src.start_col),
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
245 cols * sizeof(ScreenCell));
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
246 }
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
247
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
248 return 1;
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
249 }
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
250
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
251 static int moverect_user(VTermRect dest, VTermRect src, void *user)
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
252 {
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
253 VTermScreen *screen = user;
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
254
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
255 if(screen->callbacks && screen->callbacks->moverect) {
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
256 if(screen->damage_merge != VTERM_DAMAGE_SCROLL)
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
257 // Avoid an infinite loop
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
258 vterm_screen_flush_damage(screen);
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
259
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
260 if((*screen->callbacks->moverect)(dest, src, screen->cbdata))
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
261 return 1;
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
262 }
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
263
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
264 damagerect(screen, dest);
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
265
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
266 return 1;
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
267 }
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
268
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
269 static int erase_internal(VTermRect rect, int selective, void *user)
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
270 {
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
271 VTermScreen *screen = user;
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
272 int row, col;
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
273
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
274 for(row = rect.start_row; row < screen->state->rows && row < rect.end_row; row++) {
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
275 const VTermLineInfo *info = vterm_state_get_lineinfo(screen->state, row);
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
276
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
277 for(col = rect.start_col; col < rect.end_col; col++) {
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
278 ScreenCell *cell = getcell(screen, row, col);
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
279
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
280 if(selective && cell->pen.protected_cell)
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
281 continue;
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
282
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
283 cell->chars[0] = 0;
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
284 cell->pen = screen->pen;
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
285 cell->pen.dwl = info->doublewidth;
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
286 cell->pen.dhl = info->doubleheight;
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
287 }
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
288 }
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
289
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
290 return 1;
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
291 }
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
292
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
293 static int erase_user(VTermRect rect, int selective UNUSED, void *user)
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
294 {
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
295 VTermScreen *screen = user;
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
296
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
297 damagerect(screen, rect);
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
298
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
299 return 1;
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
300 }
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
301
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
302 static int erase(VTermRect rect, int selective, void *user)
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
303 {
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
304 erase_internal(rect, selective, user);
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
305 return erase_user(rect, 0, user);
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
306 }
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
307
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
308 static int scrollrect(VTermRect rect, int downward, int rightward, void *user)
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
309 {
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
310 VTermScreen *screen = user;
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
311
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
312 if(screen->damage_merge != VTERM_DAMAGE_SCROLL) {
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
313 vterm_scroll_rect(rect, downward, rightward,
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
314 moverect_internal, erase_internal, screen);
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
315
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
316 vterm_screen_flush_damage(screen);
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
317
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
318 vterm_scroll_rect(rect, downward, rightward,
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
319 moverect_user, erase_user, screen);
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
320
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
321 return 1;
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
322 }
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
323
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
324 if(screen->damaged.start_row != -1 &&
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
325 !rect_intersects(&rect, &screen->damaged)) {
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
326 vterm_screen_flush_damage(screen);
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
327 }
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
328
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
329 if(screen->pending_scrollrect.start_row == -1) {
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
330 screen->pending_scrollrect = rect;
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
331 screen->pending_scroll_downward = downward;
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
332 screen->pending_scroll_rightward = rightward;
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
333 }
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
334 else if(rect_equal(&screen->pending_scrollrect, &rect) &&
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
335 ((screen->pending_scroll_downward == 0 && downward == 0) ||
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
336 (screen->pending_scroll_rightward == 0 && rightward == 0))) {
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
337 screen->pending_scroll_downward += downward;
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
338 screen->pending_scroll_rightward += rightward;
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
339 }
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
340 else {
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
341 vterm_screen_flush_damage(screen);
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
342
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
343 screen->pending_scrollrect = rect;
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
344 screen->pending_scroll_downward = downward;
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
345 screen->pending_scroll_rightward = rightward;
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
346 }
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
347
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
348 vterm_scroll_rect(rect, downward, rightward,
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
349 moverect_internal, erase_internal, screen);
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
350
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
351 if(screen->damaged.start_row == -1)
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
352 return 1;
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
353
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
354 if(rect_contains(&rect, &screen->damaged)) {
17777
811a12a78164 patch 8.1.1885: comments in libvterm are inconsistent
Bram Moolenaar <Bram@vim.org>
parents: 16429
diff changeset
355 // Scroll region entirely contains the damage; just move it
14734
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
356 vterm_rect_move(&screen->damaged, -downward, -rightward);
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
357 rect_clip(&screen->damaged, &rect);
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
358 }
17777
811a12a78164 patch 8.1.1885: comments in libvterm are inconsistent
Bram Moolenaar <Bram@vim.org>
parents: 16429
diff changeset
359 // There are a number of possible cases here, but lets restrict this to only
811a12a78164 patch 8.1.1885: comments in libvterm are inconsistent
Bram Moolenaar <Bram@vim.org>
parents: 16429
diff changeset
360 // the common case where we might actually gain some performance by
811a12a78164 patch 8.1.1885: comments in libvterm are inconsistent
Bram Moolenaar <Bram@vim.org>
parents: 16429
diff changeset
361 // optimising it. Namely, a vertical scroll that neatly cuts the damage
811a12a78164 patch 8.1.1885: comments in libvterm are inconsistent
Bram Moolenaar <Bram@vim.org>
parents: 16429
diff changeset
362 // region in half.
14734
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
363 else if(rect.start_col <= screen->damaged.start_col &&
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
364 rect.end_col >= screen->damaged.end_col &&
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
365 rightward == 0) {
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
366 if(screen->damaged.start_row >= rect.start_row &&
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
367 screen->damaged.start_row < rect.end_row) {
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
368 screen->damaged.start_row -= downward;
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
369 if(screen->damaged.start_row < rect.start_row)
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
370 screen->damaged.start_row = rect.start_row;
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
371 if(screen->damaged.start_row > rect.end_row)
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
372 screen->damaged.start_row = rect.end_row;
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
373 }
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
374 if(screen->damaged.end_row >= rect.start_row &&
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
375 screen->damaged.end_row < rect.end_row) {
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
376 screen->damaged.end_row -= downward;
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
377 if(screen->damaged.end_row < rect.start_row)
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
378 screen->damaged.end_row = rect.start_row;
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
379 if(screen->damaged.end_row > rect.end_row)
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
380 screen->damaged.end_row = rect.end_row;
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
381 }
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
382 }
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
383 else {
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
384 DEBUG_LOG2("TODO: Just flush and redo damaged=" STRFrect " rect=" STRFrect "\n",
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
385 ARGSrect(screen->damaged), ARGSrect(rect));
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
386 }
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
387
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
388 return 1;
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
389 }
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
390
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
391 static int movecursor(VTermPos pos, VTermPos oldpos, int visible, void *user)
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
392 {
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
393 VTermScreen *screen = user;
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
394
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
395 if(screen->callbacks && screen->callbacks->movecursor)
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
396 return (*screen->callbacks->movecursor)(pos, oldpos, visible, screen->cbdata);
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
397
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
398 return 0;
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
399 }
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
400
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
401 static int setpenattr(VTermAttr attr, VTermValue *val, void *user)
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
402 {
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
403 VTermScreen *screen = user;
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
404
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
405 switch(attr) {
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
406 case VTERM_ATTR_BOLD:
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
407 screen->pen.bold = val->boolean;
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
408 return 1;
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
409 case VTERM_ATTR_UNDERLINE:
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
410 screen->pen.underline = val->number;
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
411 return 1;
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
412 case VTERM_ATTR_ITALIC:
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
413 screen->pen.italic = val->boolean;
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
414 return 1;
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
415 case VTERM_ATTR_BLINK:
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
416 screen->pen.blink = val->boolean;
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
417 return 1;
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
418 case VTERM_ATTR_REVERSE:
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
419 screen->pen.reverse = val->boolean;
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
420 return 1;
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
421 case VTERM_ATTR_STRIKE:
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
422 screen->pen.strike = val->boolean;
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
423 return 1;
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
424 case VTERM_ATTR_FONT:
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
425 screen->pen.font = val->number;
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
426 return 1;
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
427 case VTERM_ATTR_FOREGROUND:
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
428 screen->pen.fg = val->color;
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
429 return 1;
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
430 case VTERM_ATTR_BACKGROUND:
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
431 screen->pen.bg = val->color;
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
432 return 1;
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
433
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
434 case VTERM_N_ATTRS:
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
435 return 0;
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
436 }
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
437
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
438 return 0;
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
439 }
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
440
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
441 static int settermprop(VTermProp prop, VTermValue *val, void *user)
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
442 {
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
443 VTermScreen *screen = user;
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
444
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
445 switch(prop) {
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
446 case VTERM_PROP_ALTSCREEN:
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
447 if(val->boolean && !screen->buffers[1])
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
448 return 0;
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
449
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
450 screen->buffer = val->boolean ? screen->buffers[1] : screen->buffers[0];
17777
811a12a78164 patch 8.1.1885: comments in libvterm are inconsistent
Bram Moolenaar <Bram@vim.org>
parents: 16429
diff changeset
451 // only send a damage event on disable; because during enable there's an
811a12a78164 patch 8.1.1885: comments in libvterm are inconsistent
Bram Moolenaar <Bram@vim.org>
parents: 16429
diff changeset
452 // erase that sends a damage anyway
14734
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
453 if(!val->boolean)
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
454 damagescreen(screen);
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
455 break;
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
456 case VTERM_PROP_REVERSE:
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
457 screen->global_reverse = val->boolean;
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
458 damagescreen(screen);
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
459 break;
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
460 default:
17777
811a12a78164 patch 8.1.1885: comments in libvterm are inconsistent
Bram Moolenaar <Bram@vim.org>
parents: 16429
diff changeset
461 ; // ignore
14734
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
462 }
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
463
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
464 if(screen->callbacks && screen->callbacks->settermprop)
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
465 return (*screen->callbacks->settermprop)(prop, val, screen->cbdata);
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
466
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
467 return 1;
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
468 }
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
469
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
470 static int bell(void *user)
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
471 {
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
472 VTermScreen *screen = user;
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
473
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
474 if(screen->callbacks && screen->callbacks->bell)
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
475 return (*screen->callbacks->bell)(screen->cbdata);
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
476
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
477 return 0;
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
478 }
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
479
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
480 static int resize(int new_rows, int new_cols, VTermPos *delta, void *user)
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
481 {
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
482 VTermScreen *screen = user;
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
483
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
484 int is_altscreen = (screen->buffers[1] && screen->buffer == screen->buffers[1]);
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
485
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
486 int old_rows = screen->rows;
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
487 int old_cols = screen->cols;
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
488 int first_blank_row;
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
489
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
490 if(!is_altscreen && new_rows < old_rows) {
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
491 // Fewer rows - determine if we're going to scroll at all, and if so, push
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
492 // those lines to scrollback
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
493 VTermPos pos = { 0, 0 };
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
494 VTermPos cursor = screen->state->pos;
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
495 // Find the first blank row after the cursor.
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
496 for(pos.row = old_rows - 1; pos.row >= new_rows; pos.row--)
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
497 if(!vterm_screen_is_eol(screen, pos) || cursor.row == pos.row)
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
498 break;
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
499
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
500 first_blank_row = pos.row + 1;
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
501 if(first_blank_row > new_rows) {
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
502 VTermRect rect = {0,0,0,0};
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
503 rect.end_row = old_rows;
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
504 rect.end_col = old_cols;
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
505 scrollrect(rect, first_blank_row - new_rows, 0, user);
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
506 vterm_screen_flush_damage(screen);
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
507
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
508 delta->row -= first_blank_row - new_rows;
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
509 }
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
510 }
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
511
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
512 screen->buffers[0] = realloc_buffer(screen, screen->buffers[0], new_rows, new_cols);
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
513 if(screen->buffers[1])
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
514 screen->buffers[1] = realloc_buffer(screen, screen->buffers[1], new_rows, new_cols);
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
515
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
516 screen->buffer = is_altscreen ? screen->buffers[1] : screen->buffers[0];
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
517
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
518 screen->rows = new_rows;
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
519 screen->cols = new_cols;
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
520
15249
544490b69e1d patch 8.1.0633: crash when out of memory while opening a terminal window
Bram Moolenaar <Bram@vim.org>
parents: 14734
diff changeset
521 vterm_allocator_free(screen->vt, screen->sb_buffer);
14734
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
522
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
523 screen->sb_buffer = vterm_allocator_malloc(screen->vt, sizeof(VTermScreenCell) * new_cols);
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
524
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
525 if(new_cols > old_cols) {
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
526 VTermRect rect;
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
527 rect.start_row = 0;
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
528 rect.end_row = old_rows;
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
529 rect.start_col = old_cols;
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
530 rect.end_col = new_cols;
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
531 damagerect(screen, rect);
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
532 }
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
533
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
534 if(new_rows > old_rows) {
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
535 if(!is_altscreen && screen->callbacks && screen->callbacks->sb_popline) {
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
536 int rows = new_rows - old_rows;
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
537 while(rows) {
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
538 VTermRect rect = {0,0,0,0};
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
539 VTermPos pos = { 0, 0 };
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
540 if(!(screen->callbacks->sb_popline(screen->cols, screen->sb_buffer, screen->cbdata)))
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
541 break;
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
542
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
543 rect.end_row = screen->rows;
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
544 rect.end_col = screen->cols;
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
545 scrollrect(rect, -1, 0, user);
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
546
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
547 for(pos.col = 0; pos.col < screen->cols; pos.col += screen->sb_buffer[pos.col].width)
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
548 vterm_screen_set_cell(screen, pos, screen->sb_buffer + pos.col);
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
549
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
550 rect.end_row = 1;
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
551 damagerect(screen, rect);
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
552
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
553 vterm_screen_flush_damage(screen);
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
554
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
555 rows--;
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
556 delta->row++;
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
557 }
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
558 }
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
559
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
560 {
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
561 VTermRect rect;
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
562 rect.start_row = old_rows;
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
563 rect.end_row = new_rows;
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
564 rect.start_col = 0;
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
565 rect.end_col = new_cols;
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
566 damagerect(screen, rect);
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
567 }
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
568 }
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
569
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
570 if(screen->callbacks && screen->callbacks->resize)
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
571 return (*screen->callbacks->resize)(new_rows, new_cols, screen->cbdata);
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
572
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
573 return 1;
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
574 }
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
575
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
576 static int setlineinfo(int row, const VTermLineInfo *newinfo, const VTermLineInfo *oldinfo, void *user)
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
577 {
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
578 VTermScreen *screen = user;
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
579 int col;
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
580 VTermRect rect;
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
581
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
582 if(newinfo->doublewidth != oldinfo->doublewidth ||
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
583 newinfo->doubleheight != oldinfo->doubleheight) {
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
584 for(col = 0; col < screen->cols; col++) {
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
585 ScreenCell *cell = getcell(screen, row, col);
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
586 cell->pen.dwl = newinfo->doublewidth;
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
587 cell->pen.dhl = newinfo->doubleheight;
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
588 }
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
589
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
590 rect.start_row = row;
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
591 rect.end_row = row + 1;
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
592 rect.start_col = 0;
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
593 rect.end_col = newinfo->doublewidth ? screen->cols / 2 : screen->cols;
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
594 damagerect(screen, rect);
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
595
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
596 if(newinfo->doublewidth) {
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
597 rect.start_col = screen->cols / 2;
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
598 rect.end_col = screen->cols;
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
599
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
600 erase_internal(rect, 0, user);
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
601 }
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
602 }
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
603
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
604 return 1;
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
605 }
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
606
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
607 static VTermStateCallbacks state_cbs = {
17777
811a12a78164 patch 8.1.1885: comments in libvterm are inconsistent
Bram Moolenaar <Bram@vim.org>
parents: 16429
diff changeset
608 &putglyph, // putglyph
811a12a78164 patch 8.1.1885: comments in libvterm are inconsistent
Bram Moolenaar <Bram@vim.org>
parents: 16429
diff changeset
609 &movecursor, // movecursor
811a12a78164 patch 8.1.1885: comments in libvterm are inconsistent
Bram Moolenaar <Bram@vim.org>
parents: 16429
diff changeset
610 &scrollrect, // scrollrect
811a12a78164 patch 8.1.1885: comments in libvterm are inconsistent
Bram Moolenaar <Bram@vim.org>
parents: 16429
diff changeset
611 NULL, // moverect
811a12a78164 patch 8.1.1885: comments in libvterm are inconsistent
Bram Moolenaar <Bram@vim.org>
parents: 16429
diff changeset
612 &erase, // erase
811a12a78164 patch 8.1.1885: comments in libvterm are inconsistent
Bram Moolenaar <Bram@vim.org>
parents: 16429
diff changeset
613 NULL, // initpen
811a12a78164 patch 8.1.1885: comments in libvterm are inconsistent
Bram Moolenaar <Bram@vim.org>
parents: 16429
diff changeset
614 &setpenattr, // setpenattr
811a12a78164 patch 8.1.1885: comments in libvterm are inconsistent
Bram Moolenaar <Bram@vim.org>
parents: 16429
diff changeset
615 &settermprop, // settermprop
811a12a78164 patch 8.1.1885: comments in libvterm are inconsistent
Bram Moolenaar <Bram@vim.org>
parents: 16429
diff changeset
616 &bell, // bell
811a12a78164 patch 8.1.1885: comments in libvterm are inconsistent
Bram Moolenaar <Bram@vim.org>
parents: 16429
diff changeset
617 &resize, // resize
811a12a78164 patch 8.1.1885: comments in libvterm are inconsistent
Bram Moolenaar <Bram@vim.org>
parents: 16429
diff changeset
618 &setlineinfo // setlineinfo
14734
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
619 };
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
620
15249
544490b69e1d patch 8.1.0633: crash when out of memory while opening a terminal window
Bram Moolenaar <Bram@vim.org>
parents: 14734
diff changeset
621 /*
544490b69e1d patch 8.1.0633: crash when out of memory while opening a terminal window
Bram Moolenaar <Bram@vim.org>
parents: 14734
diff changeset
622 * Allocate a new screen and return it.
544490b69e1d patch 8.1.0633: crash when out of memory while opening a terminal window
Bram Moolenaar <Bram@vim.org>
parents: 14734
diff changeset
623 * Return NULL when out of memory.
544490b69e1d patch 8.1.0633: crash when out of memory while opening a terminal window
Bram Moolenaar <Bram@vim.org>
parents: 14734
diff changeset
624 */
14734
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
625 static VTermScreen *screen_new(VTerm *vt)
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
626 {
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
627 VTermState *state = vterm_obtain_state(vt);
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
628 VTermScreen *screen;
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
629 int rows, cols;
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
630
15249
544490b69e1d patch 8.1.0633: crash when out of memory while opening a terminal window
Bram Moolenaar <Bram@vim.org>
parents: 14734
diff changeset
631 if (state == NULL)
14734
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
632 return NULL;
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
633 screen = vterm_allocator_malloc(vt, sizeof(VTermScreen));
15249
544490b69e1d patch 8.1.0633: crash when out of memory while opening a terminal window
Bram Moolenaar <Bram@vim.org>
parents: 14734
diff changeset
634 if (screen == NULL)
544490b69e1d patch 8.1.0633: crash when out of memory while opening a terminal window
Bram Moolenaar <Bram@vim.org>
parents: 14734
diff changeset
635 return NULL;
14734
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
636
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
637 vterm_get_size(vt, &rows, &cols);
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
638
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
639 screen->vt = vt;
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
640 screen->state = state;
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
641
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
642 screen->damage_merge = VTERM_DAMAGE_CELL;
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
643 screen->damaged.start_row = -1;
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
644 screen->pending_scrollrect.start_row = -1;
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
645
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
646 screen->rows = rows;
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
647 screen->cols = cols;
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
648
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
649 screen->callbacks = NULL;
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
650 screen->cbdata = NULL;
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
651
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
652 screen->buffers[0] = realloc_buffer(screen, NULL, rows, cols);
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
653 screen->buffer = screen->buffers[0];
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
654 screen->sb_buffer = vterm_allocator_malloc(screen->vt, sizeof(VTermScreenCell) * cols);
15249
544490b69e1d patch 8.1.0633: crash when out of memory while opening a terminal window
Bram Moolenaar <Bram@vim.org>
parents: 14734
diff changeset
655 if (screen->buffer == NULL || screen->sb_buffer == NULL)
544490b69e1d patch 8.1.0633: crash when out of memory while opening a terminal window
Bram Moolenaar <Bram@vim.org>
parents: 14734
diff changeset
656 {
544490b69e1d patch 8.1.0633: crash when out of memory while opening a terminal window
Bram Moolenaar <Bram@vim.org>
parents: 14734
diff changeset
657 vterm_screen_free(screen);
544490b69e1d patch 8.1.0633: crash when out of memory while opening a terminal window
Bram Moolenaar <Bram@vim.org>
parents: 14734
diff changeset
658 return NULL;
544490b69e1d patch 8.1.0633: crash when out of memory while opening a terminal window
Bram Moolenaar <Bram@vim.org>
parents: 14734
diff changeset
659 }
14734
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
660
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
661 vterm_state_set_callbacks(screen->state, &state_cbs, screen);
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
662
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
663 return screen;
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
664 }
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
665
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
666 INTERNAL void vterm_screen_free(VTermScreen *screen)
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
667 {
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
668 vterm_allocator_free(screen->vt, screen->buffers[0]);
15249
544490b69e1d patch 8.1.0633: crash when out of memory while opening a terminal window
Bram Moolenaar <Bram@vim.org>
parents: 14734
diff changeset
669 vterm_allocator_free(screen->vt, screen->buffers[1]);
14734
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
670 vterm_allocator_free(screen->vt, screen->sb_buffer);
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
671 vterm_allocator_free(screen->vt, screen);
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
672 }
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
673
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
674 void vterm_screen_reset(VTermScreen *screen, int hard)
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
675 {
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
676 screen->damaged.start_row = -1;
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
677 screen->pending_scrollrect.start_row = -1;
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
678 vterm_state_reset(screen->state, hard);
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
679 vterm_screen_flush_damage(screen);
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
680 }
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
681
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
682 static size_t _get_chars(const VTermScreen *screen, const int utf8, void *buffer, size_t len, const VTermRect rect)
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
683 {
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
684 size_t outpos = 0;
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
685 int padding = 0;
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
686 int row, col;
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
687
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
688 #define PUT(c) \
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
689 if(utf8) { \
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
690 size_t thislen = utf8_seqlen(c); \
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
691 if(buffer && outpos + thislen <= len) \
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
692 outpos += fill_utf8((c), (char *)buffer + outpos); \
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
693 else \
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
694 outpos += thislen; \
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
695 } \
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
696 else { \
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
697 if(buffer && outpos + 1 <= len) \
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
698 ((uint32_t*)buffer)[outpos++] = (c); \
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
699 else \
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
700 outpos++; \
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
701 }
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
702
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
703 for(row = rect.start_row; row < rect.end_row; row++) {
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
704 for(col = rect.start_col; col < rect.end_col; col++) {
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
705 ScreenCell *cell = getcell(screen, row, col);
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
706 int i;
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
707
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
708 if(cell->chars[0] == 0)
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
709 // Erased cell, might need a space
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
710 padding++;
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
711 else if(cell->chars[0] == (uint32_t)-1)
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
712 // Gap behind a double-width char, do nothing
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
713 ;
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
714 else {
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
715 while(padding) {
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
716 PUT(UNICODE_SPACE);
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
717 padding--;
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
718 }
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
719 for(i = 0; i < VTERM_MAX_CHARS_PER_CELL && cell->chars[i]; i++) {
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
720 PUT(cell->chars[i]);
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
721 }
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
722 }
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
723 }
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
724
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
725 if(row < rect.end_row - 1) {
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
726 PUT(UNICODE_LINEFEED);
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
727 padding = 0;
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
728 }
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
729 }
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
730
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
731 return outpos;
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
732 }
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
733
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
734 size_t vterm_screen_get_chars(const VTermScreen *screen, uint32_t *chars, size_t len, const VTermRect rect)
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
735 {
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
736 return _get_chars(screen, 0, chars, len, rect);
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
737 }
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
738
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
739 size_t vterm_screen_get_text(const VTermScreen *screen, char *str, size_t len, const VTermRect rect)
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
740 {
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
741 return _get_chars(screen, 1, str, len, rect);
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
742 }
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
743
17777
811a12a78164 patch 8.1.1885: comments in libvterm are inconsistent
Bram Moolenaar <Bram@vim.org>
parents: 16429
diff changeset
744 // Copy internal to external representation of a screen cell
14734
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
745 int vterm_screen_get_cell(const VTermScreen *screen, VTermPos pos, VTermScreenCell *cell)
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
746 {
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
747 ScreenCell *intcell = getcell(screen, pos.row, pos.col);
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
748 int i;
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
749
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
750 if(!intcell)
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
751 return 0;
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
752
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
753 for(i = 0; ; i++) {
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
754 cell->chars[i] = intcell->chars[i];
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
755 if(!intcell->chars[i])
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
756 break;
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
757 }
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
758
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
759 cell->attrs.bold = intcell->pen.bold;
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
760 cell->attrs.underline = intcell->pen.underline;
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
761 cell->attrs.italic = intcell->pen.italic;
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
762 cell->attrs.blink = intcell->pen.blink;
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
763 cell->attrs.reverse = intcell->pen.reverse ^ screen->global_reverse;
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
764 cell->attrs.strike = intcell->pen.strike;
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
765 cell->attrs.font = intcell->pen.font;
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
766
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
767 cell->attrs.dwl = intcell->pen.dwl;
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
768 cell->attrs.dhl = intcell->pen.dhl;
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
769
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
770 cell->fg = intcell->pen.fg;
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
771 cell->bg = intcell->pen.bg;
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
772
18064
8b4f9be5db73 patch 8.1.2027: MS-Windows: problem with ambiwidth characters
Bram Moolenaar <Bram@vim.org>
parents: 17777
diff changeset
773 if(vterm_get_special_pty_type() == 2) {
8b4f9be5db73 patch 8.1.2027: MS-Windows: problem with ambiwidth characters
Bram Moolenaar <Bram@vim.org>
parents: 17777
diff changeset
774 /* Get correct cell width from cell information contained in line buffer */
8b4f9be5db73 patch 8.1.2027: MS-Windows: problem with ambiwidth characters
Bram Moolenaar <Bram@vim.org>
parents: 17777
diff changeset
775 if(pos.col < (screen->cols - 1) &&
8b4f9be5db73 patch 8.1.2027: MS-Windows: problem with ambiwidth characters
Bram Moolenaar <Bram@vim.org>
parents: 17777
diff changeset
776 getcell(screen, pos.row, pos.col + 1)->chars[0] == (uint32_t)-1) {
8b4f9be5db73 patch 8.1.2027: MS-Windows: problem with ambiwidth characters
Bram Moolenaar <Bram@vim.org>
parents: 17777
diff changeset
777 if(getcell(screen, pos.row, pos.col)->chars[0] == 0x20) {
8b4f9be5db73 patch 8.1.2027: MS-Windows: problem with ambiwidth characters
Bram Moolenaar <Bram@vim.org>
parents: 17777
diff changeset
778 getcell(screen, pos.row, pos.col)->chars[0] = 0;
8b4f9be5db73 patch 8.1.2027: MS-Windows: problem with ambiwidth characters
Bram Moolenaar <Bram@vim.org>
parents: 17777
diff changeset
779 cell->width = 2;
8b4f9be5db73 patch 8.1.2027: MS-Windows: problem with ambiwidth characters
Bram Moolenaar <Bram@vim.org>
parents: 17777
diff changeset
780 } else if(getcell(screen, pos.row, pos.col)->chars[0] == 0) {
8b4f9be5db73 patch 8.1.2027: MS-Windows: problem with ambiwidth characters
Bram Moolenaar <Bram@vim.org>
parents: 17777
diff changeset
781 getcell(screen, pos.row, pos.col + 1)->chars[0] = 0;
8b4f9be5db73 patch 8.1.2027: MS-Windows: problem with ambiwidth characters
Bram Moolenaar <Bram@vim.org>
parents: 17777
diff changeset
782 cell->width = 1;
8b4f9be5db73 patch 8.1.2027: MS-Windows: problem with ambiwidth characters
Bram Moolenaar <Bram@vim.org>
parents: 17777
diff changeset
783 } else {
8b4f9be5db73 patch 8.1.2027: MS-Windows: problem with ambiwidth characters
Bram Moolenaar <Bram@vim.org>
parents: 17777
diff changeset
784 cell->width = 2;
8b4f9be5db73 patch 8.1.2027: MS-Windows: problem with ambiwidth characters
Bram Moolenaar <Bram@vim.org>
parents: 17777
diff changeset
785 }
8b4f9be5db73 patch 8.1.2027: MS-Windows: problem with ambiwidth characters
Bram Moolenaar <Bram@vim.org>
parents: 17777
diff changeset
786 } else
8b4f9be5db73 patch 8.1.2027: MS-Windows: problem with ambiwidth characters
Bram Moolenaar <Bram@vim.org>
parents: 17777
diff changeset
787 cell->width = 1;
8b4f9be5db73 patch 8.1.2027: MS-Windows: problem with ambiwidth characters
Bram Moolenaar <Bram@vim.org>
parents: 17777
diff changeset
788 } else {
8b4f9be5db73 patch 8.1.2027: MS-Windows: problem with ambiwidth characters
Bram Moolenaar <Bram@vim.org>
parents: 17777
diff changeset
789 if(pos.col < (screen->cols - 1) &&
8b4f9be5db73 patch 8.1.2027: MS-Windows: problem with ambiwidth characters
Bram Moolenaar <Bram@vim.org>
parents: 17777
diff changeset
790 getcell(screen, pos.row, pos.col + 1)->chars[0] == (uint32_t)-1)
8b4f9be5db73 patch 8.1.2027: MS-Windows: problem with ambiwidth characters
Bram Moolenaar <Bram@vim.org>
parents: 17777
diff changeset
791 cell->width = 2;
8b4f9be5db73 patch 8.1.2027: MS-Windows: problem with ambiwidth characters
Bram Moolenaar <Bram@vim.org>
parents: 17777
diff changeset
792 else
8b4f9be5db73 patch 8.1.2027: MS-Windows: problem with ambiwidth characters
Bram Moolenaar <Bram@vim.org>
parents: 17777
diff changeset
793 cell->width = 1;
8b4f9be5db73 patch 8.1.2027: MS-Windows: problem with ambiwidth characters
Bram Moolenaar <Bram@vim.org>
parents: 17777
diff changeset
794 }
14734
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
795
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
796 return 1;
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
797 }
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
798
17777
811a12a78164 patch 8.1.1885: comments in libvterm are inconsistent
Bram Moolenaar <Bram@vim.org>
parents: 16429
diff changeset
799 // Copy external to internal representation of a screen cell
14734
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
800 /* static because it's only used internally for sb_popline during resize */
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
801 static int vterm_screen_set_cell(VTermScreen *screen, VTermPos pos, const VTermScreenCell *cell)
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
802 {
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
803 ScreenCell *intcell = getcell(screen, pos.row, pos.col);
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
804 int i;
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
805
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
806 if(!intcell)
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
807 return 0;
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
808
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
809 for(i = 0; ; i++) {
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
810 intcell->chars[i] = cell->chars[i];
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
811 if(!cell->chars[i])
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
812 break;
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
813 }
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
814
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
815 intcell->pen.bold = cell->attrs.bold;
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
816 intcell->pen.underline = cell->attrs.underline;
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
817 intcell->pen.italic = cell->attrs.italic;
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
818 intcell->pen.blink = cell->attrs.blink;
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
819 intcell->pen.reverse = cell->attrs.reverse ^ screen->global_reverse;
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
820 intcell->pen.strike = cell->attrs.strike;
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
821 intcell->pen.font = cell->attrs.font;
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
822
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
823 intcell->pen.fg = cell->fg;
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
824 intcell->pen.bg = cell->bg;
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
825
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
826 if(cell->width == 2)
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
827 getcell(screen, pos.row, pos.col + 1)->chars[0] = (uint32_t)-1;
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
828
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
829 return 1;
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
830 }
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
831
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
832 int vterm_screen_is_eol(const VTermScreen *screen, VTermPos pos)
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
833 {
17777
811a12a78164 patch 8.1.1885: comments in libvterm are inconsistent
Bram Moolenaar <Bram@vim.org>
parents: 16429
diff changeset
834 // This cell is EOL if this and every cell to the right is black
14734
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
835 for(; pos.col < screen->cols; pos.col++) {
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
836 ScreenCell *cell = getcell(screen, pos.row, pos.col);
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
837 if(cell->chars[0] != 0)
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
838 return 0;
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
839 }
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
840
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
841 return 1;
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
842 }
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
843
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
844 VTermScreen *vterm_obtain_screen(VTerm *vt)
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
845 {
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
846 if(!vt->screen)
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
847 vt->screen = screen_new(vt);
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
848 return vt->screen;
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
849 }
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
850
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
851 void vterm_screen_enable_altscreen(VTermScreen *screen, int altscreen)
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
852 {
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
853
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
854 if(!screen->buffers[1] && altscreen) {
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
855 int rows, cols;
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
856 vterm_get_size(screen->vt, &rows, &cols);
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
857
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
858 screen->buffers[1] = realloc_buffer(screen, NULL, rows, cols);
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
859 }
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
860 }
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
861
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
862 void vterm_screen_set_callbacks(VTermScreen *screen, const VTermScreenCallbacks *callbacks, void *user)
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
863 {
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
864 screen->callbacks = callbacks;
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
865 screen->cbdata = user;
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
866 }
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
867
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
868 void *vterm_screen_get_cbdata(VTermScreen *screen)
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
869 {
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
870 return screen->cbdata;
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
871 }
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
872
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
873 void vterm_screen_set_unrecognised_fallbacks(VTermScreen *screen, const VTermParserCallbacks *fallbacks, void *user)
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
874 {
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
875 vterm_state_set_unrecognised_fallbacks(screen->state, fallbacks, user);
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
876 }
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
877
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
878 void *vterm_screen_get_unrecognised_fbdata(VTermScreen *screen)
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
879 {
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
880 return vterm_state_get_unrecognised_fbdata(screen->state);
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
881 }
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
882
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
883 void vterm_screen_flush_damage(VTermScreen *screen)
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
884 {
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
885 if(screen->pending_scrollrect.start_row != -1) {
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
886 vterm_scroll_rect(screen->pending_scrollrect, screen->pending_scroll_downward, screen->pending_scroll_rightward,
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
887 moverect_user, erase_user, screen);
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
888
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
889 screen->pending_scrollrect.start_row = -1;
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
890 }
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
891
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
892 if(screen->damaged.start_row != -1) {
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
893 if(screen->callbacks && screen->callbacks->damage)
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
894 (*screen->callbacks->damage)(screen->damaged, screen->cbdata);
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
895
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
896 screen->damaged.start_row = -1;
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
897 }
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
898 }
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
899
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
900 void vterm_screen_set_damage_merge(VTermScreen *screen, VTermDamageSize size)
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
901 {
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
902 vterm_screen_flush_damage(screen);
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
903 screen->damage_merge = size;
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
904 }
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
905
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
906 static int attrs_differ(VTermAttrMask attrs, ScreenCell *a, ScreenCell *b)
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
907 {
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
908 if((attrs & VTERM_ATTR_BOLD_MASK) && (a->pen.bold != b->pen.bold))
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
909 return 1;
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
910 if((attrs & VTERM_ATTR_UNDERLINE_MASK) && (a->pen.underline != b->pen.underline))
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
911 return 1;
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
912 if((attrs & VTERM_ATTR_ITALIC_MASK) && (a->pen.italic != b->pen.italic))
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
913 return 1;
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
914 if((attrs & VTERM_ATTR_BLINK_MASK) && (a->pen.blink != b->pen.blink))
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
915 return 1;
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
916 if((attrs & VTERM_ATTR_REVERSE_MASK) && (a->pen.reverse != b->pen.reverse))
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
917 return 1;
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
918 if((attrs & VTERM_ATTR_STRIKE_MASK) && (a->pen.strike != b->pen.strike))
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
919 return 1;
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
920 if((attrs & VTERM_ATTR_FONT_MASK) && (a->pen.font != b->pen.font))
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
921 return 1;
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
922 if((attrs & VTERM_ATTR_FOREGROUND_MASK) && !vterm_color_equal(a->pen.fg, b->pen.fg))
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
923 return 1;
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
924 if((attrs & VTERM_ATTR_BACKGROUND_MASK) && !vterm_color_equal(a->pen.bg, b->pen.bg))
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
925 return 1;
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
926
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
927 return 0;
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
928 }
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
929
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
930 int vterm_screen_get_attrs_extent(const VTermScreen *screen, VTermRect *extent, VTermPos pos, VTermAttrMask attrs)
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
931 {
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
932 int col;
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
933
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
934 ScreenCell *target = getcell(screen, pos.row, pos.col);
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
935
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
936 // TODO: bounds check
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
937 extent->start_row = pos.row;
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
938 extent->end_row = pos.row + 1;
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
939
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
940 if(extent->start_col < 0)
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
941 extent->start_col = 0;
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
942 if(extent->end_col < 0)
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
943 extent->end_col = screen->cols;
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
944
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
945 for(col = pos.col - 1; col >= extent->start_col; col--)
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
946 if(attrs_differ(attrs, target, getcell(screen, pos.row, col)))
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
947 break;
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
948 extent->start_col = col + 1;
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
949
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
950 for(col = pos.col + 1; col < extent->end_col; col++)
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
951 if(attrs_differ(attrs, target, getcell(screen, pos.row, col)))
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
952 break;
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
953 extent->end_col = col - 1;
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
954
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
955 return 1;
2c72fa16aa70 patch 8.1.0379: build dependencies are incomplete
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
956 }