Skip to content

Commit

Permalink
Quotes handler takes codeStyle settings into account
Browse files Browse the repository at this point in the history
Fixes #1697
  • Loading branch information
hurricup committed Dec 30, 2017
1 parent c1d6dd7 commit 053e99a
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
package com.perl5.lang.perl.idea.editor.smartkeys;

import com.intellij.codeInsight.AutoPopupController;
import com.intellij.codeInsight.CodeInsightSettings;
import com.intellij.codeInsight.completion.CompletionType;
import com.intellij.codeInsight.editorActions.TypedHandlerDelegate;
import com.intellij.openapi.editor.CaretModel;
Expand Down Expand Up @@ -95,7 +96,7 @@ public Result charTyped(char typedChar, Project project, @NotNull Editor editor,
HighlighterIterator iterator = highlighter.createIterator(offset);
IElementType elementTokenType = iterator.getTokenType();
Document document = editor.getDocument();
if (QUOTE_OPEN_ANY.contains(elementTokenType)) {
if (QUOTE_OPEN_ANY.contains(elementTokenType) && CodeInsightSettings.getInstance().AUTOINSERT_PAIR_QUOTE) {
IElementType quotePrefixType = offset > 0 ? PerlEditorUtil.getPreviousTokenType(highlighter.createIterator(offset - 1)) : null;
CharSequence text = document.getCharsSequence();
if (offset > text.length() - 1 || text.charAt(offset) != typedChar) {
Expand Down

0 comments on commit 053e99a

Please sign in to comment.