From f6efdbced839f96f9685640345b2e4eee30f61b6 Mon Sep 17 00:00:00 2001 From: Reinhard Pointner Date: Sun, 2 Dec 2018 01:48:10 +0700 Subject: [PATCH] Keyboard navigation doesn't work right unless there's a null token to end the line. https://www.filebot.net/forums/viewtopic.php?f=6&t=9511&p=40230#p40230 --- .../net/filebot/ui/rename/FormatExpressionTokenMaker.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/source/net/filebot/ui/rename/FormatExpressionTokenMaker.java b/source/net/filebot/ui/rename/FormatExpressionTokenMaker.java index c7206be7..02583838 100644 --- a/source/net/filebot/ui/rename/FormatExpressionTokenMaker.java +++ b/source/net/filebot/ui/rename/FormatExpressionTokenMaker.java @@ -66,15 +66,15 @@ public class FormatExpressionTokenMaker extends TokenMakerBase { switch (getLanguageIndex()) { case LANGUAGE_GROOVY: - if (start != end) { + // keyboard navigation doesn't work right unless there's a null token to end the line + if (start <= end) { Segment groovySegment = new Segment(segment.array, segment.getBeginIndex() + start, end - start); addToken(groovyTokenMaker.getTokenList(groovySegment, initialTokenType, startOffset + start)); } - addNullToken(); // keyboard navigation doesn't work right unless there's a null token to end the line addLevelToken(level); break; default: - if (start != end) { + if (start < end) { addToken(segment, segment.getBeginIndex() + start, segment.getBeginIndex() + end - 1, Token.MARKUP_CDATA, startOffset + start); } addNullToken();