feat(editor): Allow tab to accept completion (#5855)

 Allow `tab` to accept completion
This commit is contained in:
Iván Ovejero
2023-03-31 11:23:16 +02:00
committed by GitHub
parent f7f9d915b1
commit 1b8c35ab87
2 changed files with 4 additions and 2 deletions

View File

@@ -16,7 +16,7 @@ import { n8nLang } from '@/plugins/codemirror/n8nLang';
import { highlighter } from '@/plugins/codemirror/resolvableHighlighter';
import { inputTheme } from './theme';
import { forceParse } from '@/utils/forceParse';
import { autocompletion } from '@codemirror/autocomplete';
import { acceptCompletion, autocompletion } from '@codemirror/autocomplete';
import type { IVariableItemSelected } from '@/Interface';
@@ -44,6 +44,7 @@ export default mixins(expressionManager, completionManager, workflowHelpers).ext
autocompletion(),
Prec.highest(
keymap.of([
{ key: 'Tab', run: acceptCompletion },
{
any: (_: EditorView, event: KeyboardEvent) => {
if (event.key === 'Escape') {