diff options
| author | Daniel Eklöf <daniel@ekloef.se> | 2019-11-16 09:56:10 +0000 |
|---|---|---|
| committer | Daniel Eklöf <daniel@ekloef.se> | 2019-11-16 09:56:10 +0000 |
| commit | b31c18c7413222480c6d33ee2aa5ee4025902a35 (patch) | |
| tree | 7bb5077f045eefcc16dfc39d9d6344a4ddfe2be6 /selection.c | |
| parent | csi: implement CSI 0g and CSI 3g (diff) | |
selection: buffer may be empty if only empty cells where selected
Diffstat (limited to 'selection.c')
| -rw-r--r-- | selection.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/selection.c b/selection.c index 2a05b853..23eb4450 100644 --- a/selection.c +++ b/selection.c @@ -108,6 +108,12 @@ extract_selection(const struct terminal *term) start_col = 0; } + if (idx == 0) { + /* Selection of empty cells only */ + buf[idx] = '\0'; + return buf; + } + assert(idx > 0); assert(idx < buf_size); if (buf[idx - 1] == '\n') |
