@settings->@shortcuts:previous-or-beginning-of-line ! text = Upnext-or-end-of-line ! text = Downprevious-or-beginning-of-line-extend-selection ! text = Shift-Upnext-or-end-of-line-extend-selection ! text = Shift-Down
@script
def lineScrollHelper(c, prefix1, prefix2, suffix):w = c.frame.body.wrapperins = w.getInsertPoint()c.inCommand = Falsec.executeMinibufferCommand(prefix1 + 'line' + suffix)ins2 = w.getInsertPoint()
# If the cursor didn't change, then go to beginning/end of line
if ins == ins2:c.executeMinibufferCommand(prefix2 + 'of-line' + suffix)@g.command('next-or-end-of-line')def nextOrEndOfLine(event):lineScrollHelper(event['c'], 'next-', 'end-', '')@g.command('previous-or-beginning-of-line')def previousOrBeginningOfLine(event):lineScrollHelper(event['c'], 'previous-', 'beginning-', '')@g.command('next-or-end-of-line-extend-selection')def nextOrEndOfLineExtendSelection(event):lineScrollHelper(event['c'], 'next-', 'end-', '-extend-selection')@g.command('previous-or-beginning-of-line-extend-selection')def previousOrBeginningOfLineExtendSelection(event):lineScrollHelper(event['c'], 'previous-', 'beginning-', '-extend-selection')
--
You received this message because you are subscribed to the Google Groups "leo-editor" group.
To unsubscribe from this group and stop receiving emails from it, send an email to leo-editor+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/leo-editor/CAO5X8CyVRMJ%2BO0tU%3D-7MAm6qhsELhj3kV4N8X33YOh2EL%3DuhEg%40mail.gmail.com.
Thanks for that, Brian! Exactly what is required!By the way, recently I discovered another oddness.When you select several lines at the moment and try to ident/deident them by a single 'tab' or 'ctrl->` - the line above/below the cursor is also affected.
--
You received this message because you are subscribed to the Google Groups "leo-editor" group.
To unsubscribe from this group and stop receiving emails from it, send an email to leo-editor+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/leo-editor/CAMF8tS2E238cHxtThs0%2B-K3yWCSAr9Xa-9BOUx6BhXw7tsYh_g%40mail.gmail.com.
When moving down a text editor line-by-line, I rely on the common behavior of automatically moving to the end of the line when trying to scroll down past the last line. Similar for when scrolling up past the first line. Leo doesn't have this behavior, so I wrote the below script. Thought I'd share in case anyone else finds it useful.
To view this discussion on the web visit https://groups.google.com/d/msgid/leo-editor/CAC%2B8SVxOTcDNY0_eGo4P_nRZahOhCe9fQ0AQyA8uMshoZx5s2Q%40mail.gmail.com.
--
You received this message because you are subscribed to the Google Groups "leo-editor" group.
To unsubscribe from this group and stop receiving emails from it, send an email to leo-editor+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/leo-editor/dbc6a4ca-848d-4093-8016-e0a0dbdaa742%40googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/leo-editor/CAO5X8CxsRiEFB4BOHuLX2byMPVyMvguBqSjo6mf6TL2TXJ_2cg%40mail.gmail.com.