Remove the duplicate code for tab indent and add the logic into codemirror.

This commit is contained in:
Nikhil Mohite
2020-07-03 10:47:39 +05:30
committed by Akshay Joshi
parent ec30e6ace7
commit 2ec8051303
4 changed files with 18 additions and 49 deletions

View File

@@ -200,22 +200,6 @@ function initFilterDialog(alertify, pgBrowser) {
$(this.filter_obj.getWrapperElement()).css('font-size', sql_font_size);
setTimeout(function() {
// Added extra logic to handel tab indent and use space setting.
that.filter_obj.setOption('extraKeys', {
Tab: (cm) => {
if(cm.somethingSelected()){
cm.execCommand('indentMore');
} else {
if (!that.preferences.use_spaces) {
cm.replaceSelection('\t', 'end', '+input');
}
else {
cm.execCommand('insertSoftTab');
}
}
},
'Shift-Tab': (cm) => cm.execCommand('indentLess'),
});
// Set focus on editor
that.filter_obj.refresh();
that.filter_obj.focus();