Skip to content

Commit

Permalink
Fix #75: Enhance popup window for auto completion
Browse files Browse the repository at this point in the history
  • Loading branch information
svrnm committed Oct 9, 2020
1 parent 138747c commit 6d9d415
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/components/options/editor/ace/autocomplete.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 6d9d415

Please sign in to comment.