Fixed hopefully every bug concerning "enter to send" ability #36

Merged
delvh merged 5 commits from b/message-text-area into develop 2020-09-21 20:21:47 +02:00
2 changed files with 5 additions and 5 deletions
Showing only changes of commit 3cd9d76d2c - Show all commits

View File

@ -1,4 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE xml>
<projectDescription> <projectDescription>
<name>client</name> <name>client</name>
<comment></comment> <comment></comment>

View File

@ -1,9 +1,8 @@
package envoy.client.data.commands; package envoy.client.data.commands;
import java.util.*; import java.util.*;
import java.util.function.Function; import java.util.function.Consumer;
import java.util.logging.Level; import java.util.logging.*;
import java.util.logging.Logger;
import java.util.regex.Pattern; import java.util.regex.Pattern;
import java.util.stream.Collectors; import java.util.stream.Collectors;
@ -198,13 +197,13 @@ public final class SystemCommandsMap {
* are present * are present
* @since Envoy Client v0.2-beta * @since Envoy Client v0.2-beta
*/ */
public void requestRecommendations(String input, Function<Set<String>, Void> action) { public void requestRecommendations(String input, Consumer<Set<String>> action) {
final var partialCommand = getCommand(input); final var partialCommand = getCommand(input);
// Get the expected commands // Get the expected commands
final var recommendations = recommendCommands(partialCommand); final var recommendations = recommendCommands(partialCommand);
if (recommendations.isEmpty()) return; if (recommendations.isEmpty()) return;
// Execute the given action // Execute the given action
else action.apply(recommendations); else action.accept(recommendations);
} }
/** /**