From d5d2619012a3b65cc478f2d68ed1ac4db9537f8c Mon Sep 17 00:00:00 2001 From: dgelessus <dgelessus@users.noreply.github.com> Date: Tue, 16 Jun 2020 22:04:54 +0200 Subject: [PATCH] Fix a fencepost error in CommandUtils.matchBIdentifierAt This makes it possible to inspect B variables when the cursor is right before the first character of the identifier. --- src/main/java/de/prob2/jupyter/CommandUtils.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/de/prob2/jupyter/CommandUtils.java b/src/main/java/de/prob2/jupyter/CommandUtils.java index e7de84b..212d82d 100644 --- a/src/main/java/de/prob2/jupyter/CommandUtils.java +++ b/src/main/java/de/prob2/jupyter/CommandUtils.java @@ -350,7 +350,7 @@ public final class CommandUtils { public static @Nullable Matcher matchBIdentifierAt(final @NotNull String code, final int at) { final Matcher identifierMatcher = B_IDENTIFIER_PATTERN.matcher(code); - while (identifierMatcher.find() && identifierMatcher.start() < at) { + while (identifierMatcher.find() && identifierMatcher.start() <= at) { if (identifierMatcher.end() >= at) { return identifierMatcher; } -- GitLab