diff --git a/src/ExtendedScintilla.cpp b/src/ExtendedScintilla.cpp index 5e9e3aa1..266bddaf 100644 --- a/src/ExtendedScintilla.cpp +++ b/src/ExtendedScintilla.cpp @@ -111,7 +111,7 @@ void ExtendedScintilla::reloadSettings() if(Settings::getValue("editor", "auto_completion").toBool()) { setAutoCompletionThreshold(3); - setAutoCompletionCaseSensitivity(true); + setAutoCompletionCaseSensitivity(false); setAutoCompletionShowSingle(true); setAutoCompletionSource(QsciScintilla::AcsAPIs); } else { diff --git a/src/PreferencesDialog.cpp b/src/PreferencesDialog.cpp index a80edacf..003fcf03 100644 --- a/src/PreferencesDialog.cpp +++ b/src/PreferencesDialog.cpp @@ -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()); diff --git a/src/PreferencesDialog.ui b/src/PreferencesDialog.ui index bb2519f6..8f9f7736 100644 --- a/src/PreferencesDialog.ui +++ b/src/PreferencesDialog.ui @@ -960,46 +960,6 @@ - - - - Error indicators - - - checkErrorIndicators - - - - - - - When set, the SQL code lines that caused errors during the last execution are highlighted and the results frame indicates the error in the background - - - enabled - - - - - - - Hori&zontal tiling - - - checkHorizontalTiling - - - - - - - If enabled the SQL code editor and the result table view are shown side by side instead of one over the other. - - - enabled - - - @@ -1017,6 +977,66 @@ + + + + Keywords in &UPPER CASE + + + checkCompleteUpper + + + + + + + When set, the SQL keywords are completed in UPPER CASE letters. + + + enabled + + + + + + + Error indicators + + + checkErrorIndicators + + + + + + + When set, the SQL code lines that caused errors during the last execution are highlighted and the results frame indicates the error in the background + + + enabled + + + + + + + Hori&zontal tiling + + + checkHorizontalTiling + + + + + + + If enabled the SQL code editor and the result table view are shown side by side instead of one over the other. + + + enabled + + + @@ -1573,6 +1593,22 @@ + + checkAutoCompletion + toggled(bool) + checkCompleteUpper + setEnabled(bool) + + + 474 + 464 + + + 474 + 492 + + + saveSettings() diff --git a/src/Settings.cpp b/src/Settings.cpp index 6d6efbaa..dd8c4c88 100644 --- a/src/Settings.cpp +++ b/src/Settings.cpp @@ -260,6 +260,10 @@ QVariant Settings::getDefaultValue(const QString& group, const QString& name) if(group == "editor" && name == "auto_completion") return true; + // editor/upper_keywords? + if(group == "editor" && name == "upper_keywords") + return true; + // editor/error_indicators? if(group == "editor" && name == "error_indicators") return true; diff --git a/src/SqlUiLexer.cpp b/src/SqlUiLexer.cpp index 9e7fc6c9..c0884540 100644 --- a/src/SqlUiLexer.cpp +++ b/src/SqlUiLexer.cpp @@ -1,5 +1,6 @@ #include "SqlUiLexer.h" #include "Qsci/qsciapis.h" +#include "Settings.h" SqlUiLexer::SqlUiLexer(QObject* parent) : QsciLexerSQL(parent) @@ -47,10 +48,13 @@ void SqlUiLexer::setupAutoCompletion() << "WHERE" << "WITH" << "WITHOUT" // Data types << "INT" << "INTEGER" << "REAL" << "TEXT" << "BLOB" << "NUMERIC" << "CHAR"; + bool upperKeywords = Settings::getValue("editor", "upper_keywords").toBool(); for(const QString& keyword : keywordPatterns) { - autocompleteApi->add(keyword + "?" + QString::number(ApiCompleterIconIdKeyword)); - autocompleteApi->add(keyword.toLower() + "?" + QString::number(ApiCompleterIconIdKeyword)); + if (upperKeywords) + autocompleteApi->add(keyword + "?" + QString::number(ApiCompleterIconIdKeyword)); + else + autocompleteApi->add(keyword.toLower() + "?" + QString::number(ApiCompleterIconIdKeyword)); } // Functions