Automatic completion of SQL keywords in upper case

Added a new setting for completing the SQL keywords in upper case (default
being true).

Scintilla setAutoCompletionCaseSensitivity is set to false. Otherwise the
completion is only done in lowercase when both case versions are added,
or if only upper case version is added, writing lower case letters does
not use the upper case version of the word in the completion list. This
change doesn't have apparently any downside, since SQL is actually case
insensitive.

Consequently the list of keywords is only added in one of the two letter
case versions, depending on the new setting value.

The new preference check-box is only enabled when the auto-complete
check-box is checked.

See issues #1238 and #1287.
This commit is contained in:
mgrojo
2018-01-06 21:53:15 +01:00
parent cb98e29a7c
commit b99edacc9f
5 changed files with 90 additions and 43 deletions

View File

@@ -166,6 +166,8 @@ void PreferencesDialog::loadSettings()
ui->spinTabSize->setValue(Settings::getValue("editor", "tabsize").toInt());
ui->spinLogFontSize->setValue(Settings::getValue("log", "fontsize").toInt());
ui->checkAutoCompletion->setChecked(Settings::getValue("editor", "auto_completion").toBool());
ui->checkCompleteUpper->setEnabled(Settings::getValue("editor", "auto_completion").toBool());
ui->checkCompleteUpper->setChecked(Settings::getValue("editor", "upper_keywords").toBool());
ui->checkErrorIndicators->setChecked(Settings::getValue("editor", "error_indicators").toBool());
ui->checkHorizontalTiling->setChecked(Settings::getValue("editor", "horizontal_tiling").toBool());
@@ -216,6 +218,7 @@ void PreferencesDialog::saveSettings()
Settings::setValue("editor", "tabsize", ui->spinTabSize->value());
Settings::setValue("log", "fontsize", ui->spinLogFontSize->value());
Settings::setValue("editor", "auto_completion", ui->checkAutoCompletion->isChecked());
Settings::setValue("editor", "upper_keywords", ui->checkCompleteUpper->isChecked());
Settings::setValue("editor", "error_indicators", ui->checkErrorIndicators->isChecked());
Settings::setValue("editor", "horizontal_tiling", ui->checkHorizontalTiling->isChecked());