eric6/QScintilla/TypingCompleters/CompleterYaml.py

changeset 8228
772103b14c18
parent 8222
5994b80b8760
--- a/eric6/QScintilla/TypingCompleters/CompleterYaml.py	Mon Apr 12 19:05:23 2021 +0200
+++ b/eric6/QScintilla/TypingCompleters/CompleterYaml.py	Mon Apr 12 19:21:40 2021 +0200
@@ -93,12 +93,6 @@
                 self.editor.setSelection(line, col, line, col + 1)
                 self.editor.removeSelectedText()
         
-        # dash
-        # insert blank
-        elif char == '-' and self.__insertBlankDash:
-            self.editor.insert(' ')
-            self.editor.setCursorPosition(line, col + 1)
-        
         # colon
         # 1. skip colon if not last character
         # 2. insert blank if last character
@@ -112,15 +106,13 @@
                 self.editor.insert(' ')
                 self.editor.setCursorPosition(line, col + 1)
         
-        # question mark
+        # dash, question mark or comma
         # insert blank
-        elif char == '?' and self.__insertBlankQuestion:
-            self.editor.insert(' ')
-            self.editor.setCursorPosition(line, col + 1)
-        
-        # comma
-        # insert blank
-        elif char == ',' and self.__insertBlankComma:
+        elif (
+            (char == '-' and self.__insertBlankDash) or
+            (char == '?' and self.__insertBlankQuestion) or
+            (char == ',' and self.__insertBlankComma)
+        ):
             self.editor.insert(' ')
             self.editor.setCursorPosition(line, col + 1)
         

eric ide

mercurial