Improve Command Parsing?

Jean-Marc Lasgouttes lasgouttes at lyx.org
Sat Oct 17 18:39:43 UTC 2020


Le 10/10/2020 à 23:12, Richard Kimberly Heck a écrit :
>> I think it is safe. Check maybe things like self-insert that may want to insert a string starting with a space.
> 
> Hmm, probably not safe, actually. Something like "self-insert  a" would,
> as things are, insert " a"; with my patch, it just inserts "a". Probably
> unicode-insert has the same problem. That's probably not a big deal in
> the command buffer, but LyXAction::lookupFunc is called from a lot of
> places.

We could first change the syntax of self-insert to honor quotes and have 
a lfun2lfun step that leaves {self-insert a} alone, and replaces 
{self-insert  a} with {self-insert " a"}

> The obvious thing to do is to require the argument to be quoted if it
> whitespace is to be preserved. Doing that in lookupFunc could cause
> problems, though, again since it is called from so many places. What if
> I just did that in the command buffer stuff?

Updating lfun version is better IMO. The command buffer should not be 
tampered with IMO.

JMarc


More information about the lyx-devel mailing list