Daniel Sun created GROOVY-12429:
-----------------------------------

             Summary: GroovyConsole error link does not place the caret on the 
reported column
                 Key: GROOVY-12429
                 URL: https://issues.apache.org/jira/browse/GROOVY-12429
             Project: Groovy
          Issue Type: Bug
            Reporter: Daniel Sun


h2. Problem

A compilation error in GroovyConsole prints a location such as {{line: 1, 
column: 9}}. Activating that link selects the whole line and leaves the caret 
after the last character. The status bar shows the end of the line, not the 
column named in the message, so the link does not show where the error is.

On a later line the selection also starts at the newline that ends the previous 
line.

h2. Steps to reproduce

Run this script in GroovyConsole. The opening quote is not closed.

{noformat}
println '123
{noformat}

In the output pane, activate {{line: 1, column: 9}}.

h2. Actual result

The whole line is selected. The script is 12 characters long, the caret is left 
after the last character, and the status bar reads {{1:13}}.

h2. Expected result

The caret is on the opening quote, that character is selected, and the status 
bar reads {{1:9}}.

When an error spans more than one character, the span is selected and the caret 
stays on the column named in the message. The status bar uses the same 
character columns as that message.

h2. Other cases covered by the same defect

* A location on a later line starts at the first character of that line.
* A stack-trace link that names only a line still selects that whole line, from 
its first character. The status bar shows column 1 of that line.
* A column past the end of the line stays on that line.
* Activating the link from the keyboard moves the caret to the same place as a 
mouse click.




--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to