diff options
author | Christian Persch <chpe@gnome.org> | 2015-01-21 17:10:54 +0100 |
---|---|---|
committer | Christian Persch <chpe@gnome.org> | 2015-01-21 17:10:54 +0100 |
commit | 1ab98077cadd4a54bb9f1f963690b4b1bda1ba7e (patch) | |
tree | cb1e740592d406d31f2b2ddbed05ff51e6ff14b5 | |
parent | 3e3e3fdec8302a04c400bc7fbfa1118dbf9cbccd (diff) | |
download | vte-1ab98077cadd4a54bb9f1f963690b4b1bda1ba7e.tar.gz |
Revert "Set the caret properly when the cursor is at the top left of the terminal."
This reverts commit 3e3e3fdec8302a04c400bc7fbfa1118dbf9cbccd.
Unauthorised commit.
-rw-r--r-- | src/vteaccess.c | 50 |
1 files changed, 18 insertions, 32 deletions
diff --git a/src/vteaccess.c b/src/vteaccess.c index 61d98adf..9cb1ed48 100644 --- a/src/vteaccess.c +++ b/src/vteaccess.c @@ -340,43 +340,29 @@ vte_terminal_accessible_update_private_data_if_needed(VteTerminalAccessible *acc _vte_debug_print(VTE_DEBUG_ALLY, "Cursor at (%ld, " "%ld).\n", ccol, crow); + /* Get the offsets to the beginnings of each line. */ caret = -1; - if (priv->snapshot_characters->len) { - /* If the cursor is at the top left of the screen, move the - * caret there. */ - /* Get the attributes of the first character in the buffer. */ - attrs = g_array_index(priv->snapshot_attributes, - struct _VteCharAttributes, - 0); - if ((crow == attrs.row) && - (ccol == 0)) { - caret = 0; - } + for (i = 0; i < priv->snapshot_characters->len; i++) { + /* Get the attributes for the current cell. */ + offset = g_array_index(priv->snapshot_characters, + int, i); + attrs = g_array_index(priv->snapshot_attributes, + struct _VteCharAttributes, + offset); + /* If this cell is "before" the cursor, move the + * caret to be "here". */ + if ((attrs.row < crow) || + ((attrs.row == crow) && (attrs.column < ccol))) { + caret = i + 1; + } } + /* If no cells are before the caret, then the caret must be + * at the end of the buffer. */ if (caret == -1) { - /* Get the offsets to the beginnings of each line. */ - for (i = 0; i < priv->snapshot_characters->len; i++) { - /* Get the attributes for the current cell. */ - offset = g_array_index(priv->snapshot_characters, - int, i); - attrs = g_array_index(priv->snapshot_attributes, - struct _VteCharAttributes, - offset); - /* If this cell is "before" the cursor, move the - * caret to be "here". */ - if ((attrs.row < crow) || - ((attrs.row == crow) && (attrs.column < ccol))) { - caret = i + 1; - } - } - - /* If no cells are before the caret, then the caret must be - * at the end of the buffer. */ - if (caret == -1) { - caret = priv->snapshot_characters->len; - } + caret = priv->snapshot_characters->len; } + /* Notify observers if the caret moved. */ if (caret != priv->snapshot_caret) { priv->snapshot_caret = caret; |