Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Michael Schwarz
CUP Eclipse Plugin
Commits
0027ef68
Commit
0027ef68
authored
Jan 27, 2016
by
Michael Schwarz
🤔
Browse files
if click is from action table, highlight prod but not newline
parent
6b3d65b5
Changes
1
Hide whitespace changes
Inline
Side-by-side
CupPlugin/src/de/tum/in/www2/cupplugin/editors/Jumper.java
View file @
0027ef68
package
de.tum.in.www2.cupplugin.editors
;
import
org.eclipse.jface.text.BadLocationException
;
import
org.eclipse.jface.text.IDocument
;
import
org.eclipse.jface.text.IRegion
;
...
...
@@ -44,12 +45,20 @@ public class Jumper {
// we currently only mark words if they are on the same line.
// otherwise we simply mark the whole line.
//TODO: Currently when clicking a reduce in action table, this highlights the line break as well
Position
end
=
range
.
getEnd
();
if
(
end
!=
null
&&
begin
.
getLine
()
==
end
.
getLine
())
{
from
+=
begin
.
getColumn
()
-
1
;
to
=
end
.
getColumn
()
-
(
begin
.
getColumn
()-
1
);
try
{
char
c
=
mpe
.
getEditor
().
getDocument
().
getChar
(
end
.
getOffsetFromStart
());
if
(
c
==
'\n'
){
to
--;
}
}
catch
(
BadLocationException
e
)
{
// TODO Auto-generated catch block
e
.
printStackTrace
();
}
}
if
(
lineInfo
!=
null
)
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment