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

Richard Kimberly Heck rikiheck at lyx.org
Wed Mar 11 19:48:04 UTC 2020


On 3/11/20 3:12 PM, Jean-Marc Lasgouttes wrote:
> Le 11/03/2020 à 19:14, Scott Kostyshak a écrit :
>> commit adb7283b69f5dddfabb8d807a432cd1e5e60b221
>> Author: Scott Kostyshak <skostysh at lyx.org>
>> Date:   Wed Mar 11 14:18:33 2020 -0400
>>
>>      outline-up/down: preserve cursor's position
>>           There is no need to change the cursor's position to the
>> beginning of
>>      the line.
>>           This change does not affect the behavior of using the
>> buttons in the
>>      Outliner pane, but is useful for using the keyboard shortcuts.
>
> What is the difference between the two code paths?

One has OutlineUp and one has OutlineDown?

Riki


> ---
>>   src/Text3.cpp |    4 ++--
>>   1 files changed, 2 insertions(+), 2 deletions(-)
>>
>> diff --git a/src/Text3.cpp b/src/Text3.cpp
>> index 81b0132..4a47556 100644
>> --- a/src/Text3.cpp
>> +++ b/src/Text3.cpp
>> @@ -2765,14 +2765,14 @@ void Text::dispatch(Cursor & cur, FuncRequest
>> & cmd)
>>         case LFUN_OUTLINE_UP:
>>           outline(OutlineUp, cur, this);
>> -        setCursor(cur, cur.pit(), 0);
>> +        setCursor(cur, cur.pit(), cur.pos());
>>           cur.forceBufferUpdate();
>>           needsUpdate = true;
>>           break;
>>         case LFUN_OUTLINE_DOWN:
>>           outline(OutlineDown, cur, this);
>> -        setCursor(cur, cur.pit(), 0);
>> +        setCursor(cur, cur.pit(), cur.pos());
>>           cur.forceBufferUpdate();
>>           needsUpdate = true;
>>           break;
>>
>



More information about the lyx-devel mailing list