Community
Participate
Working Groups
Build ID: M20070921-1145 Steps To Reproduce: 1. Create a breakpoint using the Ruler double click 2. The ITextSelection will have a length of 0. More information: The call to the ITextSelection constructor has 0 hard-coded for the length. The 0 should be replaced with a call to region.getLength(). This matters for languages that are able to set breakpoints by source position, in addition to by line number. A patch fixing this is attached.
Created attachment 88839 [details] Patch replacing hardcoded 0 with region.getLength() Patch didn't add when opening item.
On further inspection, the patch I provided doesn't actually fix the problem - it now provides the length of the line, rather than the text selection. I'll dig into it further.
Created attachment 88945 [details] Second attempt at fixing the problem. The problem was a little more complex then I first thought, but it breaks down into a couple of cases: 1. No text is currently selected: >Create a TextSelection with 0 length based at an offset equal to the start of the line. (Original behaviour) 2. Text is selected: A) Clicking on line outside the selection (ie: highlight lines 2-3, but click on line 1) >Create a TextSelection with 0 length based at an offset equal to the start of the line. (Original behaviour) B) Clicking on line inside the selection (ie: highlight lines 2-3, and click on either line 2 or 3) >Use the ISelection from the fPart's selectionProvider. (New Behaviour) The line number will be the starting line of the selection (ITextSelection.getStartLine()) Does this seem reasonable?
Dan, could you remake the patch for HEAD, as it is now it does not apply. Looking at the patch itself, it seems reasonable, as there is really only one change to an outlier case (when we actually have text selected on the current line).
Created attachment 89441 [details] Same as R3_3_maintenance_ToggleBreakpointAction2.patch except against head This is the same patch as R3_3_maintenance_ToggleBreakpointAction2.patch except this is against HEAD.
applied patch, thanks Dan
verified