SharpDevelop Community

Get your problems solved!
Welcome to SharpDevelop Community Sign in | Join | Help
in Search

bug: CodeCompletionWindow, when open, does not handle overwriting of highlighted text correctly.

Last post 11-09-2006 9:32 AM by BernhardSpuida. 4 replies.
Page 1 of 1 (5 items)
Sort Posts: Previous Next
  • 10-31-2006 9:44 PM

    bug: CodeCompletionWindow, when open, does not handle overwriting of highlighted text correctly.

    Type the following:

    Console.WriteLine<shift + back, back, back, back>Line<enter>

    When you do this, you'll notice characters following the caret are erased.

     

    The reason why it doesn't work is because the CodeCompletionWindow's endOffset private variable is not updated when selected text is overwritten. Thus, pressing enter to complete the word will cause a text replacement call with the wrong ending offset.

    Probably the way to fix is to update CodeCompletionWindow's ProcessKeyEvent() so that it correctly updates the endOffset private variable when a selection is overwritten.
     

  • 11-01-2006 7:50 PM In reply to

    Re: bug: CodeCompletionWindow, when open, does not handle overwriting of highlighted text correctly.

    Added bug report.
  • 11-02-2006 8:12 PM In reply to

    Re: bug: CodeCompletionWindow, when open, does not handle overwriting of highlighted text correctly.

    I think instead of letting CodeCompletionWindow handle the text changing keystrokes (via the ProcessTextAreaKey method), modify CodeCompletionWindow so that it listens and handles the IDocument's DocumentChanged event and appropriately update internal endOffset value. This way, the key handlers like (CTRL+Left, CTRL+Backspace, etc) do not need to be replicated in the code completion window code.

    Of course, you guys are the expert... just my 2 cents. 

  • 11-08-2006 9:07 PM In reply to

    Re: bug: CodeCompletionWindow, when open, does not handle overwriting of highlighted text correctly.

    Okay... I fixed it.

    I pasted the code here: http://www.rafb.net/paste/results/6meYuW68.html

    This code modifies the CodeCompletionWindow to listen for IDocument's DocumentAboutToBeChanged events. This basically reliefs CodeCompletionWindow from the need to replicate the key handling code from the text editor control (etc, backspace, delete, deleteword, wordbackspace, ctrl+backspace, and etc). In addition, using the mouse to highlight and delete the text within the offset window will also trigger and update to the endOffset appropriately.

    Note: rafb.net is a public code pasting service.

     Sorry for not generating a svn diff file. I'm not familiar with it yet.
     

    Regards,

    David 

  • 11-09-2006 9:32 AM In reply to

    Re: bug: CodeCompletionWindow, when open, does not handle overwriting of highlighted text correctly.

    Great!

    To have your fix incorporated in #develop, please follow the instructions in the wiki.

    Filed under:
Page 1 of 1 (5 items)
Powered by Community Server (Commercial Edition), by Telligent Systems
Don't contact us via this (fleischfalle@alphasierrapapa.com) email address.