Skip to content
Snippets Groups Projects
Commit f4c66837 authored by dgelessus's avatar dgelessus
Browse files

Remove unnecessary special case in inspection/completion

If the cursor is after the command name, but before the start of the
argument string, it makes more sense from a user perspective to treat
it as if it was at the start of the argument string. This way if there
are multiple spaces between the command name and argument, the user can
still use code completion inside this whitespace and get completions
for the first parameter of the command.
parent dda24329
No related branches found
No related tags found
No related merge requests found
...@@ -443,9 +443,6 @@ public final class ProBKernel extends BaseKernel { ...@@ -443,9 +443,6 @@ public final class ProBKernel extends BaseKernel {
if (at <= split.getName().getEndPosition()) { if (at <= split.getName().getEndPosition()) {
// The cursor is somewhere in the command name, show help text for the command. // The cursor is somewhere in the command name, show help text for the command.
return command.renderHelp(); return command.renderHelp();
} else if (at < split.getArgString().getStartPosition()) {
// The cursor is in the whitespace between the command name and arguments, don't show anything.
return null;
} else { } else {
// The cursor is somewhere in the command arguments, ask the command to inspect. // The cursor is somewhere in the command arguments, ask the command to inspect.
return inspectCommandArguments(command, split.getArgString(), at); return inspectCommandArguments(command, split.getArgString(), at);
...@@ -513,9 +510,6 @@ public final class ProBKernel extends BaseKernel { ...@@ -513,9 +510,6 @@ public final class ProBKernel extends BaseKernel {
split.getName().getStartPosition(), split.getName().getStartPosition(),
split.getName().getEndPosition() split.getName().getEndPosition()
); );
} else if (at < split.getArgString().getStartPosition()) {
// The cursor is in the whitespace between the command name and arguments, don't show anything.
return null;
} else { } else {
// The cursor is somewhere in the command arguments, ask the command to provide completions. // The cursor is somewhere in the command arguments, ask the command to provide completions.
if (this.getCommands().containsKey(split.getName().getValue())) { if (this.getCommands().containsKey(split.getName().getValue())) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment