From c9678ad69995dd904f13d2c7652ce8d835da0695 Mon Sep 17 00:00:00 2001 From: Shane Kilkelly Date: Wed, 28 Jun 2017 15:24:37 +0100 Subject: [PATCH 1/3] Trigger autocomplete with Shift-Space, in addition to existing triggers --- .../aceEditor/auto-complete/AutoCompleteManager.coffee | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/services/web/public/coffee/ide/editor/directives/aceEditor/auto-complete/AutoCompleteManager.coffee b/services/web/public/coffee/ide/editor/directives/aceEditor/auto-complete/AutoCompleteManager.coffee index cbcdc2eac7..45bb9d9b21 100644 --- a/services/web/public/coffee/ide/editor/directives/aceEditor/auto-complete/AutoCompleteManager.coffee +++ b/services/web/public/coffee/ide/editor/directives/aceEditor/auto-complete/AutoCompleteManager.coffee @@ -169,7 +169,7 @@ define [ $(editor.completer.popup?.container).css({'font-size': @$scope.fontSize + 'px'}) if editor.completer?.completions?.filtered?.length == 0 editor.completer.detach() - bindKey: "Ctrl-Space|Ctrl-Shift-Space|Alt-Space" + bindKey: "Ctrl-Space|Ctrl-Shift-Space|Alt-Space|Shift-Space" } Util.retrievePrecedingIdentifier = (text, pos, regex) -> From 69796bd8359f1690b0c9c0a99579a7e91e3fd81a Mon Sep 17 00:00:00 2001 From: Shane Kilkelly Date: Wed, 28 Jun 2017 15:48:21 +0100 Subject: [PATCH 2/3] also trigger autocomplete if last character is backslash --- .../aceEditor/auto-complete/AutoCompleteManager.coffee | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/services/web/public/coffee/ide/editor/directives/aceEditor/auto-complete/AutoCompleteManager.coffee b/services/web/public/coffee/ide/editor/directives/aceEditor/auto-complete/AutoCompleteManager.coffee index 45bb9d9b21..8637daf4ec 100644 --- a/services/web/public/coffee/ide/editor/directives/aceEditor/auto-complete/AutoCompleteManager.coffee +++ b/services/web/public/coffee/ide/editor/directives/aceEditor/auto-complete/AutoCompleteManager.coffee @@ -121,6 +121,7 @@ define [ end = change.end range = new Range(end.row, 0, end.row, end.column) lineUpToCursor = @editor.getSession().getTextRange(range) + lastCharIsBackslash = lineUpToCursor.slice(-1) == "\\" commandFragment = getLastCommandFragment(lineUpToCursor) # Check that this change was made by us, not a collaborator # (Cursor is still one place behind) @@ -130,7 +131,7 @@ define [ end.row == cursorPosition.row and end.column == cursorPosition.column + 1 ) - if commandFragment? and commandFragment.length > 2 + if (commandFragment? and commandFragment.length > 2) or lastCharIsBackslash setTimeout () => @editor.execCommand("startAutocomplete") , 0 From 1490b4a0da39c661feb47c671c30f739f8309ac9 Mon Sep 17 00:00:00 2001 From: Shane Kilkelly Date: Thu, 29 Jun 2017 10:02:49 +0100 Subject: [PATCH 3/3] Remove Shift-Space autocomplete trigger, far to easy to misfire --- .../aceEditor/auto-complete/AutoCompleteManager.coffee | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/services/web/public/coffee/ide/editor/directives/aceEditor/auto-complete/AutoCompleteManager.coffee b/services/web/public/coffee/ide/editor/directives/aceEditor/auto-complete/AutoCompleteManager.coffee index 8637daf4ec..42193c43d9 100644 --- a/services/web/public/coffee/ide/editor/directives/aceEditor/auto-complete/AutoCompleteManager.coffee +++ b/services/web/public/coffee/ide/editor/directives/aceEditor/auto-complete/AutoCompleteManager.coffee @@ -170,7 +170,7 @@ define [ $(editor.completer.popup?.container).css({'font-size': @$scope.fontSize + 'px'}) if editor.completer?.completions?.filtered?.length == 0 editor.completer.detach() - bindKey: "Ctrl-Space|Ctrl-Shift-Space|Alt-Space|Shift-Space" + bindKey: "Ctrl-Space|Ctrl-Shift-Space|Alt-Space" } Util.retrievePrecedingIdentifier = (text, pos, regex) ->