[BRLTTY] Prompt matching, again

Dave Mielke Dave at mielke.cc
Fri Sep 18 10:49:17 EDT 2020


[quoted lines by Aura Kelloniemi on 2020/09/10 at 17:05 +0300]

> > There are problems in the current prompt matching implementation.
>[--]
> >         while (length < scr.cols) {
> >             if (characters[length].text == WC_C(' ')) break;
> >             length += 1;
> >         }
>
> > This code essentially defeats all my attempts to match against a prompt which
> > contains spaces. This code should be disabled, when the regex matching feature
> > is in use.
>
>I am actually wrong here. This code just finds the first word on the currently
>selected line so that it can be used by the old prompt matching algorithm. So
>it does not do any harm in the regex matching case, and my problem is not
>about matching spaces. It wouldn't hurt though to make this code conditional.

When prompt patterns are being used, should it match the whole line? That can
be done.

> > Also, it seems that BRLTTY still falls back to the original prompt matching
> > strategy when I use the PRPROMPT command (but not when I use NXPROMPT). When
> > at least one prompt pattern is defined, PRPROMPT moves the braille window to
> > the previous line which either matches a prompt pattern or matches the first
> > word on the cursor line. For me this is highly undesirable. This prevented me
> > from noticing for a long time that my patterns don't actually work correctly.
>
>This point remains valid though. In cmd_navigation.c on line 224, there is
>this code:
>
>    if (rgxMatchTextCharacters(promptPatterns, text, length, NULL, NULL)) return 1;
>
>It clearly implements the fallback to the original algorithm, which confuses
>me and makes it difficult to debug the problem that I'm having with my prompt
>patterns.

This has now been fixed. This fix makes the previous issue - matching prompt
patterns against the whole line - easy to do.

-- 
I believe the Bible to be the very Word of God: http://Mielke.cc/bible/
Dave Mielke            | 2213 Fox Crescent | WebHome: http://Mielke.cc/
EMail: Dave at Mielke.cc  | Ottawa, Ontario   | Twitter: @Dave_Mielke
Phone: +1 613 726 0014 | Canada  K2A 1H7   |


More information about the BRLTTY mailing list