summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEgmont Koblinger <egmont@gmail.com>2016-04-06 10:55:57 +0200
committerEgmont Koblinger <egmont@gmail.com>2016-04-06 10:55:57 +0200
commit30a7c0b7f75fc72703e700838db1d831e90430c4 (patch)
tree57d17d6cdff72280bec6c31e7ff6631700d82b0f
parentf5452acf78a105466157a540beadd5dd2ced9efc (diff)
downloadvte-30a7c0b7f75fc72703e700838db1d831e90430c4.tar.gz
emulation: Don't use smart tabs if the cells are already in use
https://bugzilla.gnome.org/show_bug.cgi?id=764330#c3
-rw-r--r--src/vteseq.cc44
1 files changed, 16 insertions, 28 deletions
diff --git a/src/vteseq.cc b/src/vteseq.cc
index 5c22b291..6223ddc2 100644
--- a/src/vteseq.cc
+++ b/src/vteseq.cc
@@ -1928,36 +1928,24 @@ VteTerminalPrivate::seq_tab()
_vte_row_data_fill (rowdata, &basic_cell.cell, newcol);
/* Insert smart tab if there's nothing in the line after
- * us. Though, there may be empty cells (with non-default
- * background color for example.
+ * us, not even empty cells (with non-default background
+ * color for example).
*
- * Notable bugs here: 545924 and 597242 */
- {
+ * Notable bugs here: 545924, 597242, 764330 */
+ if (col >= old_len && newcol - col <= VTE_TAB_WIDTH_MAX) {
glong i;
- gboolean found = FALSE;
- for (i = old_len; i > col; i--) {
- const VteCell *cell = _vte_row_data_get (rowdata, i - 1);
- if (cell->attr.fragment || cell->c != 0) {
- found = TRUE;
- break;
- }
- }
- /* Nothing found on the line after us, turn this into
- * a smart tab */
- if (!found && newcol - col <= VTE_TAB_WIDTH_MAX) {
- VteCell *cell = _vte_row_data_get_writable (rowdata, col);
- VteCell tab = *cell;
- tab.attr.columns = newcol - col;
- tab.c = '\t';
- /* Save tab char */
- *cell = tab;
- /* And adjust the fragments */
- for (i = col + 1; i < newcol; i++) {
- cell = _vte_row_data_get_writable (rowdata, i);
- cell->c = '\t';
- cell->attr.columns = 1;
- cell->attr.fragment = 1;
- }
+ VteCell *cell = _vte_row_data_get_writable (rowdata, col);
+ VteCell tab = *cell;
+ tab.attr.columns = newcol - col;
+ tab.c = '\t';
+ /* Save tab char */
+ *cell = tab;
+ /* And adjust the fragments */
+ for (i = col + 1; i < newcol; i++) {
+ cell = _vte_row_data_get_writable (rowdata, i);
+ cell->c = '\t';
+ cell->attr.columns = 1;
+ cell->attr.fragment = 1;
}
}