[LyX/master] outline-up/down: preserve cursor's position

Scott Kostyshak skostysh at lyx.org
Thu Mar 12 02:24:48 UTC 2020


On Wed, Mar 11, 2020 at 07:56:02PM -0400, Scott Kostyshak wrote:
> On Wed, Mar 11, 2020 at 10:16:10PM +0100, Jean-Marc Lasgouttes wrote:
> > Le 11/03/2020 à 21:03, Scott Kostyshak a écrit :
> > > I'm glad I'm not the only one that originally interpretted JMarc's
> > > comment like that. I made a patch thinking he was hinting that I should
> > > combine the code to reduce duplication. See attached. Now I realize
> > > that's not what he was trying to say, and I'm not sure the patch
> > > actually makes things more clear.
> > 
> > Indeed my point is that the icons should do the same think as the key
> > bindings. Unless one has a pretty good reason. The best way to do it is to
> > have the buttons call the lfuns.
> 
> OK I'll take a look at the buttons. They do call the LFUNs but I think
> they do something before/after.

The cursor move happens because of the commented out call to goTo() in
the following TocWidget::outline() chunk:

  diff --git a/src/frontends/qt/TocWidget.cpp b/src/frontends/qt/TocWidget.cpp
  index 4c69aa3ba5..d0de03fadc 100644
  --- a/src/frontends/qt/TocWidget.cpp
  +++ b/src/frontends/qt/TocWidget.cpp
  @@ -350,7 +350,7 @@ void TocWidget::outline(FuncCode func_code)
          gui_view_.activateWindow();
  
          enableControls(false);
  -       goTo(list[0]);
  +//     goTo(list[0]);
          sendDispatch(FuncRequest(func_code));
          enableControls(true);
          gui_view_.setFocus();

I don't understand this code so I'm not sure what to do.

Scott
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: not available
URL: <http://lists.lyx.org/pipermail/lyx-devel/attachments/20200311/aaed1480/attachment.asc>


More information about the lyx-devel mailing list