T O P I C R E V I E W |
Steven |
Posted - Dec 14 2006 : 7:22:38 PM I updated to 1541 and now get a strange bug when using 'surround selection on *'.
If I have a line (or more) of code commented as such:
/* // some code */
and use the mouse in the selection area to select all three lines, then press '*' and the selection is replaced with a '*' (instead of removing the /* and */).
This only happens if the selection is made with the mouse in the left margin selection area. If I make the selection using keys, or don't select the final 'new line' it works fine.
Thanks, Steve |
3 L A T E S T R E P L I E S (Newest First) |
feline |
Posted - Dec 18 2006 : 1:02:02 PM very easy to reproduce, turning on line numbers seems to be the magic trigger. thank you for the clear description
case=4152 |
Steven |
Posted - Dec 17 2006 : 5:36:09 PM Using Visual Studio .NET (C++) with service pack 1 (SP1 was installed around the same time as I upgraded VAX).
I just started up today and the problem was not present. After a little bit of navigating around the project (Alt+O, Alt+G) the problem re-appeared. I've also tested on a different PC (same IDE but different configurations, and the same problem exists).
The actual caret position does not matter, but the manner in which the text is selected (and it's not entirely predictable)
Screen shots are hard because you need to see the mouse in action so I'll try to detail the steps involved. The first step would be to turn on line numbers (this gives a large margin in which to select lines of text - probably should have mentioned this before :-) )
1. comment out a line of code to look like such:
/* // A nested comment */
2. click somewhere else in the text to change the selection.
3. Select the three line of text using only the margin where the line number are (mouse should be a pointer, not a 'I' symbol). The cursor should end up on the line below the final '*/' in column 1
4. press '*' and selection is replaced with a '*' (instead of removing the outer comments).
That method is the most consistent way to reproduce the problem. Sometimes the problem occurs when the selection is made in other ways (although when using the keyboard only I have never seen it).
Sometimes, making the selection within the text area (not using the line number margin area) also has a problem, but this seems inconsistent to me.
The problem still occurs if there is more text on the line below the comment: eg
/* // A nested comment */ //More stuff here
Select the top three lines using the method above, caret is at the start of line 4
Press * and you end up with:
*//More stuff here
Anyway, I hope you can reproduce it cause otherwise I know how hard it'll be to fix ;)
|
feline |
Posted - Dec 15 2006 : 09:10:55 AM so far I cannot reproduce this problem. Can you post a screen shot showing the selected text, preferably with view white space turned on and the caret visible, or indicated.
which IDE are you using? |
|
|