Community
Participate
Working Groups
Build Identifier: M20090917-0800 Sometimes the "backspace" key does not delete intended text. This happens only when some of the code previous to the current line has been collapsed. Once we "un-collapse" the code block the backspace works fine. This, I have seen it happen in PERL & Python plugin on Windows XP SP3 and C++ plugin on Linux and Windows XP SP3 Reproducible: Always Steps to Reproduce: 1. Write some dummy cone in Python or C++ on Win XP or Linux(Ubuntu) 2. With respect to the current line collapse some part of the code that is before the current line 3.Try deleting some of the code on the current line using the backspace key. (It will delete some of the code in the collapsed part)
Seems to be an issue in the CDT Editor.
I see this behavior when pressing backspace (or delete) in an empty line following the last folded section. + folded code[...] <Backspace> <EOF> This is probably due to bug 165298.
I am moving this back to platform. Projections which include the last char of the document are not handled correctly. In other words: The exclusive end offset of the last segment maps to the exclusive end offset of the corresponding fragment. I.e. if the last segment does not represent the end of the master document, this mapping is wrong. A potential solution is to maintain a 0-length segment representing the end of the master document. This would also fix the problem mentioned in bug 165298 comment 3.
Created attachment 161284 [details] Suggested fix + testcase adjustment This patch implements the suggested solution to maintain a master-slave mapping for the end-of-master-document offset. It is quite simple, but I had to adjust the assertions in ProjectDocumentTest wrt. well-formed segmentation and fragmentation to allow a zero length segment as last segment.
Created attachment 161291 [details] Previous fix + additional tests I have added 2 tests which fail without the fix.
Re comment 2: I cannot reproduce this example in the Java editor. Anton, can you provide more detailed example/steps?
(In reply to comment #6) > Re comment 2: I cannot reproduce this example in the Java editor. Anton, can > you provide more detailed example/steps? It cannot reproduce with the Java editor either, because there is no way to create a projection at the end of the document (at least I cannot find a way), but it is reproducible with the C/C++ editor: - Install CDT or use the CPP package - Create a sample Hello World C project - Enable Folding (Ctrl+Numpad_Divide) in the editor - Collapse the main function - Put cursor on last line - Press backspace or try to insert a char
>It cannot reproduce with the Java editor either, because there is no way to >create a projection at the end of the document (at least I cannot find a way), Here are the steps: 1. add new class 2. remove the class declaration + body 2. add some imports and collapse them Now having said that and testing a bit more I can also see strangeness but not when pressing the backspace: when I type a char on the last line after the collapsed imports, it inserts that character at the wrong place. Actually, pressing Backspace is also a bit weird: it moves the caret.
Thanks Anton for the patch! Committed to HEAD. Available in builds > N20100321-2000.
This patch triggered bug 313972, which we're going to fix for 3.6RC4. Steps from comment 8 still work after the fix for bug 313972, and also shouldn't affect the other cases.