Menu

npp and scintilla notifications issues

CFrank
2014-11-11
2014-11-11
  • CFrank

    CFrank - 2014-11-11

    Hi Dave,
    I did some tests with the npp and scintilla notifications, maybe you are interested in the results.
    All in all minor issues except for the NOTIFICATION.READONLYCHANGED issue.

    OS: Win 7
    Python script: 1.0.8.0

    In general, I discovered that each of the tested notification callbacks, scintilla as well as npp,
    has, at least, one argument which is named code. Document isn't that clear in this case.

    Scintilla issues:

    1. SCINTILLANOTIFICATION.FOCUSIN and SCINTILLANOTIFICATION.FOCUSOUT aren't used at all.
    2. SCINTILLANOTIFICATION.HOTSPOTRELEASECLICK has not been implemented
    3. Using SCINTILLANOTIFICATION.CALLTIPCLICK throws the execption

    Traceback (most recent call last):
    File "D:\ProgramData\Notepad++\plugins\Config\PythonScript\scripts\nppIDE\nppCallbackDebugging.py", line 77, in sci_callback_CHARADDED
    editor.callTipShow(editor.getCurrentPos, 'hallo')
    Boost.Python.ArgumentError: Python argument types in
    Editor.callTipShow(Editor, instancemethod, str)
    did not match C++ signature:
    callTipShow(class NppPythonScript::ScintillaWrapper {lvalue}, int pos, class boost::python::api::object definition)

    Npp issues:

    1. NOTIFICATION.DOCORDERCHANGED and NOTIFICATION.SNAPSHOTDIRTYFILELOADED not implemented

    2. and most important using NOTIFICATION.READONLYCHANGED leeds to a npp crash.

    Two open tests:

    NOTIFICATION.TBMODIFICATION and NOTIFICATION.SHUTDOWN
    actually, I don't have an idea how to test these two notifications. Do you have an idea?

    If there is anything I can do please let me know.

    Thank you
    Claudia

     
  • Dave Brotherstone

    Wow, many many thanks for the detailed report. I've not got the code in front of me, but I think focusin and focusout are very new, and possibly newer than the current scintilla in N++. The unimplemented ones should be easy to add in.

    I'll fix the crashes and implement the missing ones as soon as I can.

    TBMODIFICATION is tricky, because it comes very easly in the process, and possibly earlier than we've initialised python. I can take a look though.

    SHUTDOWN is a nightmare - this really is chicken and egg, we need to stop everything, but if there's a shutdown callback registered, we could be starting new things, and that could easily cause a freeze, or mean that n++ can never be closed. I've looked at this before and come to the conclusion that it's best left unsupported, as I don't trust myself to implement it such that it wouldn't be problematic in a large number of cases!

    Thanks again for the great report - I'm away for the next couple of weeks, but I'll try and get these implemented in December.

    Cheers,
    Dave.

     
  • CFrank

    CFrank - 2014-11-11

    Hi Dave,
    no problem - just for completeness, you've implemented

    SCINTILLANOTIFICATION.URIDROPPED and SCINTILLANOTIFICATION.KEY

    but the website states that

    SCN_URIDROPPED
    Only on the GTK+ version. Indicates that the user has dragged a URI such as a file name or Web address onto Scintilla. The container could interpret this as a request to open the file. The text field of SCNotification points at the URI text.

    and

    SCN_KEY
    Reports all keys pressed but not consumed by Scintilla. Used on GTK+ because of some problems with keyboard focus and is not sent by the Windows version. SCNotification.ch holds the key code and SCNotification.modifiers holds the modifiers. This notification is sent if the modifiers include SCMOD_ALT or SCMOD_CTRL and the key code is less than 256.

    Maybe worth to give a hint in the documentation !?

    Thanks again for looking into it and for this great plugin.

    Cheers
    Claudia

     

Log in to post a comment.