[vte] Revert "Set the caret properly when the cursor is at the top left of the terminal."
- From: Christian Persch <chpe src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [vte] Revert "Set the caret properly when the cursor is at the top left of the terminal."
- Date: Wed, 21 Jan 2015 16:11:15 +0000 (UTC)
commit 1ab98077cadd4a54bb9f1f963690b4b1bda1ba7e
Author: Christian Persch <chpe gnome org>
Date: Wed Jan 21 17:10:54 2015 +0100
Revert "Set the caret properly when the cursor is at the top left of the terminal."
This reverts commit 3e3e3fdec8302a04c400bc7fbfa1118dbf9cbccd.
Unauthorised commit.
src/vteaccess.c | 50 ++++++++++++++++++--------------------------------
1 files changed, 18 insertions(+), 32 deletions(-)
---
diff --git a/src/vteaccess.c b/src/vteaccess.c
index 61d98ad..9cb1ed4 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;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]