On Mon, Mar 13, 2017 at 10:56:10AM +0100, Jean-Marc Lasgouttes wrote:
> Le 13/03/2017 à 04:37, Scott Kostyshak a écrit :
> > On Sat, Dec 10, 2016 at 12:56:43AM -0500, Scott Kostyshak wrote:
> > > Regarding the comment "This is done unless explicitly requested", is it
> > > still possible to request that a redraw not be done and if so how? Or is
> > > this comment left-over from how things were previously (e.g. a3aad45f)?
> > > I don't see how the screen flags can be modified after FitCursor is set.
> 
> Dear Scott,
> 
> I failed to answer at the time, you are right to be persistent. Did you try
> to use Cursor::screenUpdateFlags(Update::None) to reset the flags?

Thanks. It seems it is impossible to control locally in LFUN_COPY (which
is what my goal was), because of the following in Text3.cpp. Basically,
no matter what, the Update::FitCursor flag will be set. I could add a
bool that allows for LFUNS to set an exception (e.g. reallyDoNotUpdate),
but the issue I wanted to improve is minor and the code is already
complex enough:

        if (!needsUpdate
            && &oldTopSlice.inset() == &cur.inset()
            && oldTopSlice.idx() == cur.idx()
            && !oldSelection // oldSelection is a backup of cur.selection() at 
the beginning of the function.
            && !cur.selection())
                // FIXME: it would be better if we could just do this
                //
                //if (cur.result().update() != Update::FitCursor)
                //      cur.noScreenUpdate();
                //
                // But some LFUNs do not set Update::FitCursor when needed, so 
we
                // do it for all. This is not very harmfull as FitCursor will 
provoke
                // a full redraw only if needed but still, a proper review of 
all LFUN
                // should be done and this needsUpdate boolean can then be 
removed.
                cur.screenUpdateFlags(Update::FitCursor);
        else
                cur.screenUpdateFlags(Update::Force | Update::FitCursor);

I created trac ticket #10597. I will push a comment that LFUN_COPY
should not cause an update, and then I'll probably forget about this
issue.

Scott

p.s.: The following is a note to myself if I am flag hunting in the future and
search for this email: to find out where the flag was set, I used gdb to
break in LFUN_COPY and then I did

  watch cur.disp_.update_

Attachment: signature.asc
Description: PGP signature

Reply via email to