Margin Click Notification Callback

  • Jim

    Jim - 2014-04-27


    My question is about the MARGINCLICK Notification. My basic callback works, and looks like this

    def toggle_breakpoint(args):
        console.write("margin click:\n")
    editor.callback(toggle_breakpoint, [SCINTILLANOTIFICATION.MARGINCLICK])

    This callback is being executed, and the output is:

    margin click:
    {'code': 2010, 'margin': 1}

    My question is - how do I get the line number of the click so I can add the marker to the clicked line? The Scintilla docs say there should be 3 fields returned by the notification[1]: the key modifiers, the position, and the margin number.

    This notification tells the container that the mouse was clicked inside a margin that was marked as sensitive (see SCI_SETMARGINSENSITIVEN). This can be used to perform folding or to place breakpoints. The following SCNotification fields are used:
    Field   Usage
    modifiers   The appropriate combination of SCI_SHIFT, SCI_CTRL and SCI_ALT to indicate the keys that were held down at the time of the margin click.
    position    The position of the start of the line in the document that corresponds to the margin click.
    margin  The margin number that was clicked.

    Thank you.


    Last edit: Jim 2014-04-27

Log in to post a comment.