[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[6647] inc-sea-bs-after-strip-cr.sh test
From: |
Gavin D. Smith |
Subject: |
[6647] inc-sea-bs-after-strip-cr.sh test |
Date: |
Fri, 25 Sep 2015 16:30:29 +0000 |
Revision: 6647
http://svn.sv.gnu.org/viewvc/?view=rev&root=texinfo&revision=6647
Author: gavin
Date: 2015-09-25 16:30:28 +0000 (Fri, 25 Sep 2015)
Log Message:
-----------
inc-sea-bs-after-strip-cr.sh test
Modified Paths:
--------------
trunk/ChangeLog
trunk/info/Makefile.am
trunk/info/session.c
Added Paths:
-----------
trunk/info/t/inc-sea-bs-after-strip-cr.sh
trunk/info/t/infodir/inc-sea-bs-after-strip-cr.info
Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog 2015-09-24 11:30:32 UTC (rev 6646)
+++ trunk/ChangeLog 2015-09-25 16:30:28 UTC (rev 6647)
@@ -1,3 +1,17 @@
+2015-09-25 Gavin Smith <address@hidden>
+
+ * info/session.c (incremental_search)
+ (window_set_state, window_get_state): Refer to nodes by their
+ filename and nodename instead of with a NODE object.
+ (window_set_state): Use info_set_node_of_window instead of
+ window_set_node_of_window, in order to put the node in the
+ window history.
+ (incremental_search): Call cleanup_history to adjust the
+ window's history at the end of the incremental search.
+ (cleanup_history): Null final entry in history array.
+
+ * info/t/inc-sea-bs-after-strip-cr.sh: New test.
+
2015-09-24 Vincent Belaïche <address@hidden>
* util/texi2dvi: Exempt msys as well as cygwin from using
Modified: trunk/info/Makefile.am
===================================================================
--- trunk/info/Makefile.am 2015-09-24 11:30:32 UTC (rev 6646)
+++ trunk/info/Makefile.am 2015-09-25 16:30:28 UTC (rev 6647)
@@ -115,6 +115,7 @@
t/all-only.sh \
t/empty.sh \
t/cr-tag-table.sh \
+ t/inc-sea-bs-after-strip-cr.sh \
t/tab.sh \
t/tab-argument.sh \
t/tab-no-xref.sh \
Modified: trunk/info/session.c
===================================================================
--- trunk/info/session.c 2015-09-24 11:30:32 UTC (rev 6646)
+++ trunk/info/session.c 2015-09-25 16:30:28 UTC (rev 6647)
@@ -2585,6 +2585,7 @@
memmove (&window->hist[start], &window->hist[end],
(window->hist_index - end) * sizeof (WINDOW_STATE *));
window->hist_index -= end - start;
+ window->hist[window->hist_index] = 0;
}
DECLARE_INFO_COMMAND (info_move_to_prev_xref,
@@ -4794,7 +4795,8 @@
/* Structure defining the current state of an incremental search. */
typedef struct {
- NODE *node; /* The node displayed in this window. */
+ char *fullpath;
+ char *nodename;
long pagetop; /* LINE_STARTS[PAGETOP] is first line in WINDOW. */
long point; /* Point in window. */
long start; /* Offset in node contents where search started. */
@@ -4821,7 +4823,8 @@
static void
window_get_state (WINDOW *window, SEARCH_STATE *state)
{
- state->node = window->node;
+ state->fullpath = window->node->fullpath;
+ state->nodename = window->node->nodename;
state->pagetop = window->pagetop;
state->point = window->point;
}
@@ -4830,8 +4833,12 @@
static void
window_set_state (WINDOW *window, SEARCH_STATE *state)
{
- if (window->node != state->node)
- window_set_node_of_window (window, state->node);
+ if (strcmp(window->node->fullpath, state->fullpath)
+ || strcmp(window->node->nodename, state->nodename))
+ {
+ NODE *n = info_get_node (state->fullpath, state->nodename);
+ info_set_node_of_window (window, n);
+ }
window->pagetop = state->pagetop;
window->point = state->point;
}
@@ -5238,7 +5245,8 @@
{
/* Make sure the match is visible, and update the display. */
- if (mystate.node == window->node
+ if (!strcmp(window->node->fullpath, mystate.fullpath)
+ && !strcmp(window->node->nodename, mystate.nodename)
&& mystate.pagetop != window->pagetop)
{
int newtop = window->pagetop;
@@ -5262,32 +5270,24 @@
started the incremental search if the match was in a different node. */
{
int i = window->hist_index - 1;
- while (i >= starting_history_entry
- && window->node != window->hist[i]->node)
- {
- free_history_node (window->hist[i]->node);
- free (window->hist[i]);
- i--;
- }
+ int j = starting_history_entry;
- if (i > starting_history_entry)
+ if (i > j)
{
- /* History entry i is the only one we want to keep. */
- int i2 = i - 1;
- while (i2 > starting_history_entry)
+ if (!strcmp(window->hist[i]->node->nodename,
+ window->hist[j]->node->nodename)
+ && !strcmp(window->hist[j]->node->fullpath,
+ window->hist[i]->node->fullpath))
{
- free_history_node (window->hist[i2]->node);
- free (window->hist[i2]);
- i2--;
+ /* If we end up at the same node we started at, don't extend
+ the history at all. */
+ cleanup_history (window, j, i);
}
- window->hist[starting_history_entry + 1] = window->hist[i];
- window->hist_index = starting_history_entry + 2;
+ else
+ {
+ cleanup_history (window, j + 1, i);
+ }
}
- else
- /* The match was in the first node checked. No extra history entries
- are needed. */
- window->hist_index = starting_history_entry + 1;
- window->hist[window->hist_index] = 0;
}
/* Perhaps GC some file buffers. */
Added: trunk/info/t/inc-sea-bs-after-strip-cr.sh
===================================================================
--- trunk/info/t/inc-sea-bs-after-strip-cr.sh (rev 0)
+++ trunk/info/t/inc-sea-bs-after-strip-cr.sh 2015-09-25 16:30:28 UTC (rev
6647)
@@ -0,0 +1,30 @@
+#!/bin/sh
+# Copyright (C) 2015 Free Software Foundation, Inc.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+srcdir=${srcdir:-.}
+. $srcdir/t/Init-test.inc
+. $t/Init-inter.inc
+
+# Test going back to an earlier node in an incremental search using
+# backspace, when going to later node caused CR-LF line endings to be
+# stripped from the file. This is the case for the test file because
+# the tag table entry is incorrect for the second node.
+run_ginfo -f inc-sea-bs-after-strip-cr
+printf '\023xxy\010\r' >$PTY_TYPE
+printf q >$PTY_TYPE
+. $t/Timeout-test.inc
+
+cleanup
Property changes on: trunk/info/t/inc-sea-bs-after-strip-cr.sh
___________________________________________________________________
Added: svn:executable
+ *
Added: trunk/info/t/infodir/inc-sea-bs-after-strip-cr.info
===================================================================
(Binary files differ)
Property changes on: trunk/info/t/infodir/inc-sea-bs-after-strip-cr.info
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [6647] inc-sea-bs-after-strip-cr.sh test,
Gavin D. Smith <=