1) Ensure that autocomplete does not appear when navigating code using arrow keys. Fixes #7573

2) Fixed an issue where autocomplete is not working after clearing the query editor. Fixes #7563
This commit is contained in:
Akshay Joshi
2022-08-01 14:38:32 +05:30
parent 6145dc76fc
commit 95312f2d14
3 changed files with 15 additions and 7 deletions

View File

@@ -423,7 +423,8 @@ export default function CodeMirror({currEditor, name, value, options, events, re
let pref = pgWindow?.pgAdmin?.Browser?.get_preferences_for_module('sqleditor') || {};
if (autocomplete && pref.autocomplete_on_key_press) {
editor.current.on('keyup', (cm, event)=>{
if (!cm.state.completionActive && event.key != 'Enter' && event.key != 'Escape') {
var pattern = new RegExp('^[ -~]{1}$');
if (!cm.state.completionActive && (event.key == 'Backspace' || pattern.test(event.key))) {
OrigCodeMirror.commands.autocomplete(cm, null, {completeSingle: false});
}
});