The attached patch fixes the problem, but I don't know what else it will
affect, and so I'm not absolutely certain it's the right solution.

Joris?

On Sat, Jul 23, 2016 at 2:14 PM Karl Hegbloom <[email protected]>
wrote:

> In my Zotero TeXmacs integration:
>
>     https://github.com/KarlHegbloom/zotero-texmacs-integration
>
> ... the zcite tags content is inaccessible unless you deactivate the tag.
> I don't want to change that, and don't know how... When the cursor is to
> the left of the tag, and I press the right-arrow, the cursor jumps to the
> right end of the tag, and then the tag is highlighted with the light-blue
> box. So far so good, because now I can use Backspace to deactivate it, or
> Tab to call the editCitation function...
>
> The problem is that when I push Ctrl-PageDown or use the toolbar icon to
> call traverse-next, TeXmacs bombs with an invalid cursor error. It's also
> broken whenever there are zcite tags in the document even when trying to
> traverse between other kinds of tags. In a document with nothing in it but
> a number of \strong{strong content} tags in it, I can traverse-next and
> traverse-previous with no problem. But when I insert any zcite tags between
> those, I can not traverse-next, but I can traverse-previous. I noticed that
> with the \strong{} tags, it leaves the cursor at the start of the tag's
> content when I traverse-next, and at the end of the content when I
> traverse-previous.
>
> So for the zcite, where the content is inaccessible, the
> traverse-previous, which leaves the cursor in a valid location, works fine,
> but the traverse-next is broken, because it produces an invalid cursor
> location.
>
> I tried to overload traverse-next for the (:require (in-zcite?))
> context... and have given up. It doesn't work. I think that the problem is
> at a lower level, in the C++ that I don't fully understand yet, and that
> what it needs is a check for when the cursor would be invalid, and to have
> it move it to a valid position instead of throwing the error. I don't know
> how to do that.
>
> Karl Hegbloom
>
>
diff --git a/src/src/Data/Tree/tree_traverse.cpp b/src/src/Data/Tree/tree_traverse.cpp
index 8b2e1de..6c98c5a 100644
--- a/src/src/Data/Tree/tree_traverse.cpp
+++ b/src/src/Data/Tree/tree_traverse.cpp
@@ -350,7 +350,8 @@ move_node (tree t, path p, bool forward) {
     if (forward) p= path_up (p) * N (st->label);
     else p= path_up (p) * 0;
   }
-  p= move_valid (t, p, forward);
+  // p= move_valid (t, p, forward);
+  p= move_accessible (t, p, forward);
   st= subtree (t, path_up (p));
   if (is_atomic (st) && last_item (p) > 0)
     p= path_up (p) * N (st->label);
_______________________________________________
Texmacs-dev mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/texmacs-dev

Reply via email to