[vte] emulation: Don't use smart tabs if the cells are already in use
- From: Egmont Koblinger <egmontkob src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [vte] emulation: Don't use smart tabs if the cells are already in use
- Date: Wed, 6 Apr 2016 08:58:05 +0000 (UTC)
commit 30a7c0b7f75fc72703e700838db1d831e90430c4
Author: Egmont Koblinger <egmont gmail com>
Date: Wed Apr 6 10:55:57 2016 +0200
emulation: Don't use smart tabs if the cells are already in use
https://bugzilla.gnome.org/show_bug.cgi?id=764330#c3
src/vteseq.cc | 44 ++++++++++++++++----------------------------
1 files changed, 16 insertions(+), 28 deletions(-)
---
diff --git a/src/vteseq.cc b/src/vteseq.cc
index 5c22b29..6223ddc 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;
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]