aboutsummaryrefslogtreecommitdiff
path: root/src/console/completion
diff options
context:
space:
mode:
authorShin'ya Ueoka <ueokande@i-beam.org>2021-07-04 13:29:42 +0900
committerShin'ya Ueoka <ueokande@i-beam.org>2021-07-04 13:29:42 +0900
commit6b88c15d1a6193cd090c5a1ae9b6ea06a467e171 (patch)
treee1b78080d8e10477007c9379b57a6213e6f72c6a /src/console/completion
parent5904eeff1a75dcf83bcef7d5666a7473cc5b77de (diff)
yarn lint:fix
Diffstat (limited to 'src/console/completion')
-rw-r--r--src/console/completion/hooks.ts53
1 files changed, 18 insertions, 35 deletions
diff --git a/src/console/completion/hooks.ts b/src/console/completion/hooks.ts
index c3940c7..4402b70 100644
--- a/src/console/completion/hooks.ts
+++ b/src/console/completion/hooks.ts
@@ -246,49 +246,30 @@ export const useCompletions = () => {
return;
}
- getOpenCompletions(
- cmd.command,
- cmd.args,
- completionTypes
- ).then((completions) =>
- dispatch(actions.setCompletions(completions))
+ getOpenCompletions(cmd.command, cmd.args, completionTypes).then(
+ (completions) => dispatch(actions.setCompletions(completions))
);
break;
case Command.Buffer:
- getTabCompletions(
- cmd.command,
- cmd.args,
- false
- ).then((completions) =>
- dispatch(actions.setCompletions(completions))
+ getTabCompletions(cmd.command, cmd.args, false).then(
+ (completions) => dispatch(actions.setCompletions(completions))
);
break;
case Command.BufferDelete:
case Command.BuffersDelete:
- getTabCompletions(
- cmd.command,
- cmd.args,
- true
- ).then((completions) =>
- dispatch(actions.setCompletions(completions))
+ getTabCompletions(cmd.command, cmd.args, true).then(
+ (completions) => dispatch(actions.setCompletions(completions))
);
break;
case Command.BufferDeleteForce:
case Command.BuffersDeleteForce:
- getTabCompletions(
- cmd.command,
- cmd.args,
- false
- ).then((completions) =>
- dispatch(actions.setCompletions(completions))
+ getTabCompletions(cmd.command, cmd.args, false).then(
+ (completions) => dispatch(actions.setCompletions(completions))
);
break;
case Command.Set:
- getPropertyCompletions(
- cmd.command,
- cmd.args
- ).then((completions) =>
- dispatch(actions.setCompletions(completions))
+ getPropertyCompletions(cmd.command, cmd.args).then(
+ (completions) => dispatch(actions.setCompletions(completions))
);
break;
}
@@ -314,12 +295,14 @@ export const useCompletions = () => {
export const useSelectCompletion = () => {
const state = React.useContext(CompletionStateContext);
const dispatch = React.useContext(CompletionDispatchContext);
- const next = React.useCallback(() => dispatch(actions.selectNext()), [
- dispatch,
- ]);
- const prev = React.useCallback(() => dispatch(actions.selectPrev()), [
- dispatch,
- ]);
+ const next = React.useCallback(
+ () => dispatch(actions.selectNext()),
+ [dispatch]
+ );
+ const prev = React.useCallback(
+ () => dispatch(actions.selectPrev()),
+ [dispatch]
+ );
const currentValue = React.useMemo(() => {
if (state.select < 0) {
return state.completionSource;