From 6d9d415221e84ad64598b371d5e9dcf8225202c1 Mon Sep 17 00:00:00 2001 From: Severin Neumann Date: Fri, 9 Oct 2020 12:30:17 +0200 Subject: [PATCH] Fix #75: Enhance popup window for auto completion --- src/components/options/editor/ace/autocomplete.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/components/options/editor/ace/autocomplete.js b/src/components/options/editor/ace/autocomplete.js index 9445eee..c0e79e9 100644 --- a/src/components/options/editor/ace/autocomplete.js +++ b/src/components/options/editor/ace/autocomplete.js @@ -72,7 +72,14 @@ function autocomplete(getRepository, variables) { langTools.setCompleters([{ identifierRegexps: [/[a-zA-Z_0-9$!%/@+\-\u00A2-\uFFFF]/], getCompletions: function (editor, session, pos, prefix, callback) { - // console.log(prefix) + // This is a hack. it's not really easily possible to access the popup + // so we set this timeout to capture it when it is available and resize it then. + setTimeout(() => { + console.log(editor.completer.popup) + if (editor && editor.completer && editor.completer.popup) { + editor.completer.popup.container.style.width = '500px' + } + }, 50) if (prefix.startsWith('%') && pos.column - prefix.length === 0) { callback(null, getRepository().getNames().sort().map(c => { return {