Menu

#1958 doCommandBySelector: bug

Bug
closed-fixed
5
2017-08-16
2017-07-11
No

There's a bug in the doCommandBySelector: method for ScintillaView.mm. The selector passed in is already
a SEL so @selector() is not necessary and respondsToSelector: will always return false.

I didn't provide a patch because in correcting this problem, pressing the delete key now deletes two characters instead of one. That's because doCommandBySelector: will now properly perform the selector for deleteBackward: and I'm assuming the keyboard handler for Scintilla also processed the delete key.

Discussion

  • Neil Hodgson

    Neil Hodgson - 2017-07-12

    This could be improved by not calling interpretKeyEvents when the key has already been handled by Scintilla.

    - (void) keyDown: (NSEvent *) theEvent {
        bool handled = false;
        if (mMarkedTextRange.length == 0)
            handled = mOwner.backend->KeyboardInput(theEvent);
        if (!handled) {
            NSArray *events = @[theEvent];
            [self interpretKeyEvents: events];
        }
    }
    
     
  • Chinh Nguyen

    Chinh Nguyen - 2017-07-12

    Seems to work just fine. No problem with simple test case of entering Japanese characters provided by a user. No deleting of two characters per key press of delete key either. I'll let you know if anything comes up during testing. Thank you.

     
  • Neil Hodgson

    Neil Hodgson - 2017-07-18

    Fix committed as [852686].

     

    Related

    Commit: [852686]

  • Neil Hodgson

    Neil Hodgson - 2017-07-21
    • labels: cocoa --> cocoa, scintilla
    • status: open --> open-fixed
    • assigned_to: Neil Hodgson
     
  • Neil Hodgson

    Neil Hodgson - 2017-08-16
    • status: open-fixed --> closed-fixed
     

Log in to post a comment.