texinfo-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[5256] Restore the cursor position when going to the Up node.


From: Sergey Poznyakoff
Subject: [5256] Restore the cursor position when going to the Up node.
Date: Mon, 15 Apr 2013 21:49:21 +0000

Revision: 5256
          http://svn.sv.gnu.org/viewvc/?view=rev&root=texinfo&revision=5256
Author:   gray
Date:     2013-04-15 21:49:21 +0000 (Mon, 15 Apr 2013)
Log Message:
-----------
Restore the cursor position when going to the Up node.

* info/session.c (info_win_find_node): New static.
(info_handle_pointer): When handling Up pointer,
restore the point (cursor position) as well.

Modified Paths:
--------------
    trunk/ChangeLog
    trunk/info/session.c

Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog     2013-04-15 21:39:09 UTC (rev 5255)
+++ trunk/ChangeLog     2013-04-15 21:49:21 UTC (rev 5256)
@@ -1,5 +1,13 @@
 2013-04-16  Sergey Poznyakoff  <address@hidden>
 
+       Restore the cursor position when going to the Up node.
+
+       * info/session.c (info_win_find_node): New static.
+       (info_handle_pointer): When handling Up pointer,
+       restore the point (cursor position) as well.
+
+2013-04-16  Sergey Poznyakoff  <address@hidden>
+
        Implement the --all (-a) option as per bug #38168.
 
        * info/infopath.c: New file.

Modified: trunk/info/session.c
===================================================================
--- trunk/info/session.c        2013-04-15 21:39:09 UTC (rev 5255)
+++ trunk/info/session.c        2013-04-15 21:49:21 UTC (rev 5256)
@@ -2106,6 +2106,22 @@
   info_select_reference (window, &entry);
 }
 
+static int
+info_win_find_node (INFO_WINDOW *win, NODE *node)
+{
+  int i;
+
+  for (i = win->nodes_index - 1; i >= 0; i--)
+    {
+      NODE *p = win->nodes[i];
+
+      if (strcmp (p->filename, node->filename) == 0 &&
+         strcmp (p->nodename, node->nodename) == 0)
+       break;
+    }
+  return i;
+}        
+
 /* Given that the values of INFO_PARSED_FILENAME and INFO_PARSED_NODENAME
    are previously filled, try to get the node represented by them into
    WINDOW.  The node should have been pointed to by the LABEL pointer of
@@ -2144,7 +2160,13 @@
           info_win = get_info_window_of_window (window);
           if (info_win)
             {
-              info_win->pagetops[info_win->current] = window->pagetop;
+             if (strcmp (label, "Up") == 0)
+               {
+                 int i = info_win_find_node (info_win, node);
+                 if (i >= 0)
+                   node->display_pos = info_win->points[i];
+               }
+             info_win->pagetops[info_win->current] = window->pagetop;
               info_win->points[info_win->current] = window->point;
             }
           info_set_node_of_window (1, window, node);




reply via email to

[Prev in Thread] Current Thread [Next in Thread]