Jean-Marc Lasgouttes wrote:
"Abdelrazak" == Abdelrazak Younes <[EMAIL PROTECTED]> writes:
Abdelrazak> FWIW I agree with Bo. The reason why I like it more is
Abdelrazak> that Bo's approach will allow us to remove some more code
Abdelrazak> (selHandle, etc).
I am not 100% sure with that.
I was talking about the removal of the lines of type:
needsUpdate |= cur.selHandle(cmd.action == LFUN_BUFFER_BEGIN_SELECT);
but maybe your patch can lead to that do.
In particular, one thing I would have
liked to do is merge things like char-forward and char-forward-select
into one lfun taking an argument (like "select"). The flag approach
would be problematic there.
I don't think so: we can augment Bo's patch in Text3.cpp like this:
+ // if this LFUN will clear selection, saveSelection for persistent
+ // selection
+ if (lyxaction.funcHasFlag(cmd.action, LyXAction::SaveSelection)
+ && cmd.argument() != "select")
+ saveSelection(cur.bv().cursor());
+
Also, something that is kind of broken right now, but would be nice to
fix is the persistent mark (a command that puts you in selection mode
and then keyboard extends selection). Again, this would be difficult
with the flag approach.
The same solution as above would be fine I think.
Actually, the strong point of the flag approach (all the information
is in one file) is also its weak spot: when changing the behaviour of
a lfun, it is very easy to forget to set/remove the SaveSelection
flag.
The same can be said about specific code in LFUNs.
Abdel.