Author Topic: [C::B svn 11712] Problem when scrolling with the mouse wheel in the editor  (Read 8277 times)

Offline tomay3000

  • Multiple posting newcomer
  • *
  • Posts: 58
Hello,
It happens many times, when scrolling with the mouse wheel in the editor and some data has been copied to the clipboard, then this data will be pasted while scrolling at the current position, and I wont notice it unless I get compiler errors.

This is becoming very annoying, because it happens that the clipboard content data may be pasted in a comment and this wont be notices at all.

Any body please confirm this problem if it is really happening and has been fixed (maybe) in the svn versions after this one!

TIA.

Offline Miguel Gimenez

  • Developer
  • Lives here!
  • *****
  • Posts: 1553
Re: [C::B svn 11712] Problem when scrolling with the mouse wheel in the editor
« Reply #1 on: September 21, 2019, 08:51:31 pm »
Do you have the MouseSap plugin enabled? It adds pasting with middle button to the editor, so if you press the wheel when turning it you will get what you describe.

Offline tomay3000

  • Multiple posting newcomer
  • *
  • Posts: 58
Re: [C::B svn 11712] Problem when scrolling with the mouse wheel in the editor
« Reply #2 on: September 21, 2019, 09:59:46 pm »
Do you have the MouseSap plugin enabled? It adds pasting with middle button to the editor, so if you press the wheel when turning it you will get what you describe.
I believe YES.

So MouseSap plugin is my nightmare :(
I thought for a moment that it something related to scintilla.

I have disabled it for now.
Thank you.

EDIT: After disabling it and even Uninstalling it, the middle-mouse click still working :(
« Last Edit: September 21, 2019, 10:18:28 pm by tomay3000 »

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: [C::B svn 11712] Problem when scrolling with the mouse wheel in the editor
« Reply #3 on: September 22, 2019, 01:48:19 am »
Do you click on the scroll wheel while scrolling in the first place?
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline tomay3000

  • Multiple posting newcomer
  • *
  • Posts: 58
Re: [C::B svn 11712] Problem when scrolling with the mouse wheel in the editor
« Reply #4 on: September 22, 2019, 02:01:48 am »
Do you click on the scroll wheel while scrolling in the first place?
Quite possible, because I can't feel my index finger while doing it or hear the TICK sound.

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: [C::B svn 11712] Problem when scrolling with the mouse wheel in the editor
« Reply #5 on: September 22, 2019, 02:10:03 pm »
Do you see text pasted if you deliberately click the scroll wheel?
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline tomay3000

  • Multiple posting newcomer
  • *
  • Posts: 58
Re: [C::B svn 11712] Problem when scrolling with the mouse wheel in the editor
« Reply #6 on: September 22, 2019, 08:20:35 pm »
Do you see text pasted if you deliberately click the scroll wheel?
YES, sure.
But I fixed the problem, by going to "Settings" -> "Editor..." -> "Mouse Drag Scrolling" -> "Mouse Key To Use" -> Set to "Middle" instead of "Right".

Apparently I was accidentally clicking the wheel while scrolling.

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: [C::B svn 11712] Problem when scrolling with the mouse wheel in the editor
« Reply #7 on: September 22, 2019, 08:25:29 pm »
This is from the drag scroll plugin.
OK, this was reported already, but I don't know what happened with this.
I guess it is still a problem... :(
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline tomay3000

  • Multiple posting newcomer
  • *
  • Posts: 58
Re: [C::B svn 11712] Problem when scrolling with the mouse wheel in the editor
« Reply #8 on: September 22, 2019, 08:32:10 pm »
This is from the drag scroll plugin.
OK, this was reported already, but I don't know what happened with this.
I guess it is still a problem... :(
Do you mean that I just workaround it!?
Do you mean that I should also disable DragScroll plugin?

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: [C::B svn 11712] Problem when scrolling with the mouse wheel in the editor
« Reply #9 on: September 23, 2019, 12:58:36 am »
I don't know, I have to investigate, but I don't have time now.
If someone is interested in this then go on. :)
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline Pecan

  • Plugin developer
  • Lives here!
  • ****
  • Posts: 2750
Re: [C::B svn 11712] Problem when scrolling with the mouse wheel in the editor
« Reply #10 on: September 23, 2019, 06:22:37 pm »
Pasting happens with the middle mouse click when any word is marked before the click. This happens with both the Nightly and all the way back to my oldest CB version svn10542. (Both Windows and Linux.)

This happens with no contrib plugins loaded.
It has nothing to do with BrowseTracker or DragScroll.

I quite like it.

The original poster was successful stopping the paste because DragScroll captured the middle mouse to use as the drag key.

I don't see a problem here.
« Last Edit: September 23, 2019, 06:29:50 pm by Pecan »

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: [C::B svn 11712] Problem when scrolling with the mouse wheel in the editor
« Reply #11 on: September 23, 2019, 08:48:03 pm »
I don't see a problem here.
For windows people it might seem unexpected. Do you know where in the source this pasting happens?
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline Pecan

  • Plugin developer
  • Lives here!
  • ****
  • Posts: 2750
Re: [C::B svn 11712] Problem when scrolling with the mouse wheel in the editor
« Reply #12 on: September 24, 2019, 07:56:32 am »
Do you know where in the source this pasting happens?

cbstyledtextctrl.cpp:116

I hope those of us who use this feature regularly will be able to keep it.
It's been in CB for a very long time.

Code

void cbStyledTextCtrl::OnMouseMiddleDown(wxMouseEvent& event)
{
    if (platform::gtk == false) // only if OnMouseMiddleDown is not already implemented by the OS
    {
        int pos = PositionFromPoint(wxPoint(event.GetX(), event.GetY()));

        if (pos == wxSCI_INVALID_POSITION)
            return;

        int start = GetSelectionStart();
        int end   = GetSelectionEnd();

        const wxString s = GetSelectedText();

        if (pos < GetCurrentPos())
        {
            start += s.length();
            end += s.length();
        }

        InsertText(pos, s);
        SetSelectionVoid(start, end);
    }
}
« Last Edit: September 24, 2019, 08:01:33 am by Pecan »

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: [C::B svn 11712] Problem when scrolling with the mouse wheel in the editor
« Reply #13 on: September 24, 2019, 07:45:02 pm »
I think it should not be on by default on platforms which don't have it natively (on linux I use this feature all the time, but there it is sort of integrated in everything). I'm fine if it is an option you could enable.

But if we have this here, what is the purpose of the mousesap plugin? Doing copy on selection change? Isn't this a duplication of features? Shouldn't this be moved to the mouse-sap plugins (which btw fails to compile with wxgtk + gtk3 :( )
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline Pecan

  • Plugin developer
  • Lives here!
  • ****
  • Posts: 2750
Re: [C::B svn 11712] Problem when scrolling with the mouse wheel in the editor
« Reply #14 on: September 25, 2019, 07:29:11 am »
I'm fine if it is an option you could enable.
...
But if we have this here, what is the purpose of the mousesap plugin?

I'll look at it.