Menu

#184 Option to disable drag/drop editing

Initial
open
3
2 days ago
2005-02-03
No

I couldn't find this option in the documentation, but
it seems like it should be pretty trivial to add. I
would like an option to disable drag/drop text editing
within the control.

Discussion

  • Neil Hodgson

    Neil Hodgson - 2005-02-04
    • assigned_to: nobody --> nyamatongwe
     
  • Neil Hodgson

    Neil Hodgson - 2007-11-23
    • priority: 5 --> 3
     
  • glenneroo

    glenneroo - 2021-09-17

    Will this ever be added? Since Notepad++ depends on this project, a lot of people would really love to have the option to disable drag and drop, as evidenced by multiple questions on StackOverflow as well as SuperUser (StackExchange sites).

     
    • Neil Hodgson

      Neil Hodgson - 2021-09-17

      I do not know if it will ever be added. Scintilla is an open source project and depends on people contributing implementations of new features.

       
  • Zufu Liu

    Zufu Liu - 2022-04-09
    • labels: --> Scintilla, drag-and-drop
    • Group: --> Initial
     
  • Nathaniel Braun

    Nathaniel Braun - 2025-11-18

    Hi all, I intend to implement a V0 of this feature. I built a working proof of concept it by making a change in Notepad++'s Scintilla version. It consists in removing the line of code setting inDragDrop to DragDrop::initial in src/Editor.cxx at line 4927. This flag can be a static flag passed to Scintilla when initializing it, and that flag would be read-only from initialization. This means that, in this V0, it will not be possible to enable or disable drag-and-drop on the fly, and it will require restarting the editor. We can tackle this in V1. Still worth it, in my opinion.

     

    Last edit: Nathaniel Braun 2025-11-18
    • Neil Hodgson

      Neil Hodgson - 2025-11-18

      This work appears to be at an early stage where it should not be included in Scintilla as yet.

      If this is to be included in Scintilla it should be modifiable after start. It should add to the normal API as a SCI_ message.

       

      Last edit: Neil Hodgson 2025-11-18
      • Nathaniel Braun

        Nathaniel Braun - 2025-11-19

        Thank you @nyamatongwe. Could you please point me towards an example of such a message so I can use that as a reference implementation? Thank you!

         
        • Neil Hodgson

          Neil Hodgson - 2025-11-20

          The UndoCollection property is a similar boolean feature. Search for 'UndoCollection' (case-insensitive) in all Scintilla files to find all the declarations, code, documentation, and tests related to this property.

           
          • Nathaniel Braun

            Nathaniel Braun - 2025-11-29

            Here is a first version of the patch. Not sure how to write unit tests, your help is very welcome there. Thank you!

             
            • Neil Hodgson

              Neil Hodgson - 7 days ago

              Its difficult to test interactive feature but the API can be checked to return a reasonable result with the setter changing this result. The testUndoCollection method can be used as an example.

              The patch blocks dragging from Scintilla but not dropping into Scintilla. It is still possible to drag from another application like Chrome into Scintilla.

              It would be better, but not essential, to use a selection I beam cursor over the selection when it can not be dragged instead of the arrow.

               
            • Neil Hodgson

              Neil Hodgson - 2 days ago

              With the current patch not blocking drags into Scintilla, there is an API policy choice. The API is currently a simple boolean but if drags from and to need to be independently blocked then the API will be more complex, perhaps a bit mask or multiple APIs.

               
          • Nathaniel Braun

            Nathaniel Braun - 2025-11-29

            And here is the patch to add the feature to SciTE.

             
            • Neil Hodgson

              Neil Hodgson - 7 days ago

              No real use case for this feature has been described so it is hard to understand the scope of control needed. The earlier post talked about Notepad++ and how they present the option is up to them. For SciTE, I'd either avoid it completely or make it a properties file setting instead of adding a menu item.

               
              • Nathaniel Braun

                Nathaniel Braun - 6 days ago

                No problem, let's avoid it completely in SciTE, then.

                 
  • Nathaniel Braun

    Nathaniel Braun - 2025-12-01

    @nyamatongwe could you please assign this feature request to me? Thank you.

     
    • Neil Hodgson

      Neil Hodgson - 7 days ago

      What would assigning the feature request do? It's not really a concept within this tracker or the project.

       

Log in to post a comment.