Skip to content

Commit

Permalink
Don't show keyword, etc. completions when in annotation.
Browse files Browse the repository at this point in the history
Belonging to [master]:
  - #115
  • Loading branch information
atrosinenko authored and OpenModelica-Hudson committed Apr 8, 2019
1 parent 0116bcc commit fdc07bf
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions OMEdit/OMEdit/OMEditGUI/Editors/ModelicaEditor.cpp
Expand Up @@ -73,7 +73,10 @@ void ModelicaEditor::popUpCompleter()
QString word = wordUnderCursor();
mpPlainTextEdit->clearCompleter();

if (!word.contains('.')) {
QList<CompleterItem> annotations;
getCompletionAnnotations(stringAfterWord("annotation"), annotations);

if (!word.contains('.') && annotations.empty()) {
QStringList keywords = ModelicaHighlighter::getKeywords();
mpPlainTextEdit->insertCompleterKeywords(keywords);
QStringList types = ModelicaHighlighter::getTypes();
Expand All @@ -93,8 +96,6 @@ void ModelicaEditor::popUpCompleter()
mpPlainTextEdit->insertCompleterSymbols(classes, ":/Resources/icons/completerClass.svg");
mpPlainTextEdit->insertCompleterSymbols(components, ":/Resources/icons/completerComponent.svg");

QList<CompleterItem> annotations;
getCompletionAnnotations(stringAfterWord("annotation"), annotations);
mpPlainTextEdit->insertCompleterSymbols(annotations, ":/Resources/icons/completerAnnotation.svg");

QCompleter *completer = mpPlainTextEdit->completer();
Expand Down

0 comments on commit fdc07bf

Please sign in to comment.