1
|
1 |
--- bluefish-1.0.5/src/highlight.c.orig 2006-02-10 16:32:16.264145000 +0000
|
|
2 |
+++ bluefish-1.0.5/src/highlight.c 2006-02-10 16:35:13.346604000 +0000
|
|
3 |
@@ -1258,8 +1258,10 @@
|
|
4 |
#endif
|
|
5 |
/* if the tags ends at itstart there is no need to search forward to the end */
|
|
6 |
if (!gtk_text_iter_ends_tag(&itstart, GTK_TEXT_TAG(slist->data))) {
|
|
7 |
+#ifdef DEBUG
|
|
8 |
DEBUG_MSG("doc_highlight_line, (1) forward looking for tag %p (%s) from so=%d to eo=%d\n", slist->data, get_metaname_from_tag(slist->data),
|
|
9 |
gtk_text_iter_get_offset(&itstart), gtk_text_iter_get_offset(&itend));
|
|
10 |
+#endif
|
|
11 |
tag_found = gtk_text_iter_forward_to_tag_toggle(&itsearch, GTK_TEXT_TAG(slist->data));
|
|
12 |
if (!tag_found) {
|
|
13 |
/* this happens with several gtk versions,
|
|
14 |
@@ -1281,7 +1283,9 @@
|
|
15 |
gtk_text_iter_forward_char(&itsearch);
|
|
16 |
}
|
|
17 |
}
|
|
18 |
+#ifdef DEBUG
|
|
19 |
DEBUG_MSG("doc_highlight_line, (1) tag %p (%s) ends at itsearch=%d\n", slist->data, get_metaname_from_tag(slist->data),gtk_text_iter_get_offset(&itsearch));
|
|
20 |
+#endif
|
|
21 |
if (gtk_text_iter_compare(&itsearch, &itend) > 0) {
|
|
22 |
/* both the start and endpoint are within this
|
|
23 |
tag --> pattern matching can start with this
|
|
24 |
@@ -1324,10 +1328,14 @@
|
|
25 |
itstart to the beginning of this tag,
|
|
26 |
there is also no need anymore to look further in slist, we have to start with this patternlist */
|
|
27 |
if (gtk_text_iter_begins_tag(&itstart, GTK_TEXT_TAG(slist->data))) {
|
|
28 |
+#ifdef DEBUG
|
|
29 |
DEBUG_MSG("doc_highlight_line, (1) itstart at %d is already at the beginning of tag %p (%s)\n",gtk_text_iter_get_offset(&itstart), slist->data, get_metaname_from_tag(slist->data));
|
|
30 |
+#endif
|
|
31 |
} else {
|
|
32 |
+#ifdef DEBUG
|
|
33 |
DEBUG_MSG("doc_highlight_line, (1) move itstart from %d to beginning of tag %p (%s)\n",
|
|
34 |
gtk_text_iter_get_offset(&itstart), slist->data, get_metaname_from_tag(slist->data));
|
|
35 |
+#endif
|
|
36 |
gtk_text_iter_backward_to_tag_toggle(&itstart, GTK_TEXT_TAG(slist->data));
|
|
37 |
DEBUG_MSG("doc_highlight_line, (1) itstart is set back to %d\n", gtk_text_iter_get_offset(&itstart));
|
|
38 |
}
|
|
39 |
@@ -1354,8 +1362,10 @@
|
|
40 |
gboolean tag_found;
|
|
41 |
/* if the tags starts at itend there is no need to search backward to the start */
|
|
42 |
if (!gtk_text_iter_begins_tag(&itend, GTK_TEXT_TAG(slist->data))) {
|
|
43 |
+#ifdef DEBUG
|
|
44 |
DEBUG_MSG("doc_highlight_line, (2) backwards looking for tag %p (%s) from eo=%d to so=%d, itsearch=%d\n", slist->data,
|
|
45 |
get_metaname_from_tag(slist->data), gtk_text_iter_get_offset(&itend),gtk_text_iter_get_offset(&itstart) ,gtk_text_iter_get_offset(&itsearch));
|
|
46 |
+#endif
|
|
47 |
#ifdef DEBUG
|
|
48 |
DEBUG_MSG("does the itsearch position (%d) toggle(%d), begin(%d) or end(%d) the tag %p (%s)?\n"
|
|
49 |
,gtk_text_iter_get_offset(&itsearch)
|
|
50 |
@@ -1386,7 +1396,9 @@
|
|
51 |
}
|
|
52 |
}
|
|
53 |
}
|
|
54 |
+#ifdef DEBUG
|
|
55 |
DEBUG_MSG("doc_highlight_line, (2) tag %p (%s) starts at itsearch=%d\n", slist->data,get_metaname_from_tag(slist->data),gtk_text_iter_get_offset(&itsearch));
|
|
56 |
+#endif
|
|
57 |
if (gtk_text_iter_compare(&itsearch, &itstart) <= 0) {
|
|
58 |
/* both the start and endpoint are within this
|
|
59 |
tag --> pattern matching can start with this
|
|
60 |
@@ -1395,10 +1407,14 @@
|
|
61 |
/* this tag starts somewhere in the middle of the line, move
|
|
62 |
itend to the end of this tag */
|
|
63 |
if (gtk_text_iter_ends_tag(&itend, GTK_TEXT_TAG(slist->data))) {
|
|
64 |
+#ifdef DEBUG
|
|
65 |
DEBUG_MSG("doc_highlight_line, (2) itend at %d is already at the end of tag %p (%s)\n",
|
|
66 |
gtk_text_iter_get_offset(&itend), slist->data,get_metaname_from_tag(slist->data));
|
|
67 |
+#endif
|
|
68 |
} else {
|
|
69 |
+#ifdef DEBUG
|
|
70 |
DEBUG_MSG("doc_highlight_line, (2) move itend from %d to end of tag %p (%s)\n",gtk_text_iter_get_offset(&itend), slist->data, get_metaname_from_tag(slist->data));
|
|
71 |
+#endif
|
|
72 |
gtk_text_iter_forward_to_tag_toggle(&itend, GTK_TEXT_TAG(slist->data));
|
|
73 |
DEBUG_MSG("doc_highlight_line, (2) itend is set forward to %d\n", gtk_text_iter_get_offset(&itend));
|
|
74 |
}
|