326 |
|
|
327 |
Element line = root.getElement(lineClicked); |
Element line = root.getElement(lineClicked); |
328 |
Segment s = getLineBuffer(); |
Segment s = getLineBuffer(); |
|
|
|
329 |
int start = line.getStartOffset(); |
int start = line.getStartOffset(); |
330 |
int end = line.getEndOffset(); |
// We don't want the \n at the end of the line. |
331 |
|
int end = line.getEndOffset() - 1; |
332 |
try |
try |
333 |
{ |
{ |
334 |
doc.getText(start, end - start, s); |
doc.getText(start, end - start, s); |
|
|
|
|
// The end of line symbol (0xA), if being the last member in the |
|
|
// obtained text, should not be counted. |
|
|
if (s.last()==0xA && end>start) |
|
|
s.count--; |
|
335 |
} |
} |
336 |
catch (BadLocationException ble) |
catch (BadLocationException ble) |
337 |
{ |
{ |