[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[5563] fix line offset for index entries
From: |
Gavin D. Smith |
Subject: |
[5563] fix line offset for index entries |
Date: |
Wed, 14 May 2014 06:23:40 +0000 |
Revision: 5563
http://svn.sv.gnu.org/viewvc/?view=rev&root=texinfo&revision=5563
Author: gavin
Date: 2014-05-14 06:23:39 +0000 (Wed, 14 May 2014)
Log Message:
-----------
fix line offset for index entries
Modified Paths:
--------------
trunk/ChangeLog
trunk/info/Makefile.am
trunk/info/indices.c
trunk/info/session.c
trunk/info/t/infodir/split.info-2
Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog 2014-05-13 07:25:31 UTC (rev 5562)
+++ trunk/ChangeLog 2014-05-14 06:23:39 UTC (rev 5563)
@@ -1,3 +1,11 @@
+2014-05-14 Gavin Smith <address@hidden>
+
+ * info/session.c (info_select_reference): Code merged from
+ info_next_index_match: Call window_log_to_phys_line.
+ * info/indices.c (info_next_index_match): Call info_select_reference.
+
+ * info/Makefile.am: Remove index-long-nodeline.sh from XFAIL_TESTS.
+
2014-05-13 Gavin Smith <address@hidden>
* info/info-utils.c (scan_node_contents, scan_reference_label):
Modified: trunk/info/Makefile.am
===================================================================
--- trunk/info/Makefile.am 2014-05-13 07:25:31 UTC (rev 5562)
+++ trunk/info/Makefile.am 2014-05-14 06:23:39 UTC (rev 5563)
@@ -125,7 +125,6 @@
t/help.sh
XFAIL_TESTS = \
- t/index-long-nodeline.sh \
t/quoted-label-as-target.sh \
t/quoted-target.sh \
t/quoted-label-and-target.sh \
Modified: trunk/info/indices.c
===================================================================
--- trunk/info/indices.c 2014-05-13 07:25:31 UTC (rev 5562)
+++ trunk/info/indices.c 2014-05-14 06:23:39 UTC (rev 5563)
@@ -489,42 +489,7 @@
free (match);
}
- /* Select the node corresponding to this index entry. */
- node = info_get_node (index_index[i]->filename, index_index[i]->nodename,
- PARSE_NODE_DFLT);
-
- if (!node)
- {
- info_error (msg_cant_file_node,
- index_index[i]->filename, index_index[i]->nodename);
- return;
- }
-
- info_set_node_of_window (window, node);
-
- {
- long loc;
- long line = window_log_to_phys_line (window,
- index_index[i]->line_number - 1);
-
- if (line >= 0 && line < window->line_count)
- {
- /* Jump to the line number specified in the index entry. */
- loc = window->line_starts[line] - window->node->contents;
- }
- else
- {
- /* Try to find an occurence of LABEL in this node. */
- long start = window->line_starts[1] - window->node->contents;
- loc = info_target_search_node (node, index_index[i]->label, start, 1);
- }
-
- if (loc != -1)
- {
- window->point = loc;
- window_adjust_pagetop (window);
- }
- }
+ info_select_reference (window, index_index[i]);
}
/* **************************************************************** */
Modified: trunk/info/session.c
===================================================================
--- trunk/info/session.c 2014-05-13 07:25:31 UTC (rev 5562)
+++ trunk/info/session.c 2014-05-14 06:23:39 UTC (rev 5563)
@@ -1780,11 +1780,31 @@
if (node)
{
+ long loc, line;
+
info_set_node_of_window (window, node);
if (entry->line_number > 0)
- /* Third argument doesn't matter. */
- internal_next_line (window, entry->line_number - 1, '1');
+ {
+ /* Go to the line given by entry->line_number. */
+ line = window_log_to_phys_line (window, entry->line_number - 1);
+
+ if (line >= 0 && line < window->line_count)
+ loc = window->line_starts[line] - window->node->contents;
+ else
+ {
+ /* Try to find an occurence of LABEL in this node. This
+ could be useful for following index entries. */
+ long start = window->line_starts[1] - window->node->contents;
+ loc = info_target_search_node (node, entry->label, start, 1);
+ }
+
+ if (loc != -1)
+ {
+ window->point = loc;
+ window_adjust_pagetop (window);
+ }
+ }
}
}
Modified: trunk/info/t/infodir/split.info-2
===================================================================
(Binary files differ)
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [5563] fix line offset for index entries,
Gavin D. Smith <=