Menu

#497 auto scroll while dragging text

Committed
closed
3
2020-04-27
2008-05-15
McLoo
No

scrolling while having a selected text dragged
is not possible.
i.e. in MS Explorer or MS word you can move the mouse to to top or bottom text window to make it scroll while dragging a selection.
this is very useful if you want to edit something without changing the clipboard (or copy while pressing ctrl).
I orginally wanted this feature to be implemented in Notepad++ and Notepad 2 which both use Scintilla.

regards
McLoo

Discussion

  • Neil Hodgson

    Neil Hodgson - 2008-05-15

    Logged In: YES
    user_id=12579
    Originator: NO

    Acknowledged. It is unlikely I will work on this.

     
  • Neil Hodgson

    Neil Hodgson - 2008-05-15
    • priority: 5 --> 3
    • assigned_to: nobody --> nyamatongwe
     
  • Nobody/Anonymous

    hey Neil. Is there any chance for this feature to come? I can't imagine that people won't like this, as even Ultra Edit has implemented it.
    -Ben

     
  • Neil Hodgson

    Neil Hodgson - 2008-11-21

    As I said I probably won't work on it. Its just not a big issue to me. If someone else thinks its important enough they may work on it.

     
  • McLoo

    McLoo - 2020-02-21

    So, after nearly 12 years of waiting I decided to take a shot. It is an important feature to me.
    With this patch it works as desired.

     

    Last edit: McLoo 2020-02-21
  • Neil Hodgson

    Neil Hodgson - 2020-02-26

    The above patch saves, modifies, and restores global state which complicates with additional side-effects and can cause problems if the global state is changed by some other code, possibly by the application during a callback. There may be several notifications inside MovedCaret.

    The attached patch structures the caret policy state into new types then passes a specific policy down into the code that will decide the scrolling.

     
  • Neil Hodgson

    Neil Hodgson - 2020-02-28
    • labels: Scintilla --> Scintilla, drag-and-drop, scrolling
    • Group: --> Committed
     
  • Neil Hodgson

    Neil Hodgson - 2020-02-28

    Committed changes as [e98f67] and [971668].

     

    Related

    Commit: [971668]
    Commit: [e98f67]

  • McLoo

    McLoo - 2020-02-29

    Thanks for taking the time. I'm really happy with this!
    I wonder what you'll put in the Bugs Section on ScintillaToDo.html though? :)

     
    • Neil Hodgson

      Neil Hodgson - 2020-02-29

      Removed the section with [65e1f5].

       

      Related

      Commit: [65e1f5]

  • McLoo

    McLoo - 2020-03-01

    Just tested this feature in SciTe 4.3.1 with a larger test file.
    There seems to be one case, where XYScrollPosition should not scroll:

    Line 1 400 characters
    Line 2 400 characters
    Line 3 0 characters
    Line 4 400 characters

    • Scroll to the right
    • Try to drag a selection from line 1 to same position in line 4
    • When passing line 3 the window gets scrolled to the very left

    Other editors behave the same way, but it breaks the existing scintilla behavoir.
    I guess a good way, would be to take the virtual.space setting into account and don't scroll-by-drag when the caret is moved outside the unwanted zone, if either SCVS_RECTANGULARSELECTION or SCVS_NOWRAPLINESTART is set.
    Also on SCVS_RECTANGULARSELECTION because, when you have the virtual space while selecting you can assume to have it also when dragging.

     

    Last edit: McLoo 2020-03-01
    • Neil Hodgson

      Neil Hodgson - 2020-03-03

      I think the current implementation is OK for 4.3.1 release.

      Could only perform the MovedCaret when the caret is near the window edge - maybe within lineHeight pixels. May be possible to constrain direction of scrolling - don't scroll horizontally unless near left or right edge.

       
  • Neil Hodgson

    Neil Hodgson - 2020-04-27
    • status: open --> closed
     
  • Neil Hodgson

    Neil Hodgson - 2020-04-27

    Committed changes as [e98f67] and [971668].

     

    Related

    Commit: [971668]
    Commit: [e98f67]


Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.