91 txt = self.editor.text(line) |
91 txt = self.editor.text(line) |
92 if col < len(txt) and char == txt[col] and self.__skipBrace: |
92 if col < len(txt) and char == txt[col] and self.__skipBrace: |
93 self.editor.setSelection(line, col, line, col + 1) |
93 self.editor.setSelection(line, col, line, col + 1) |
94 self.editor.removeSelectedText() |
94 self.editor.removeSelectedText() |
95 |
95 |
96 # dash |
|
97 # insert blank |
|
98 elif char == '-' and self.__insertBlankDash: |
|
99 self.editor.insert(' ') |
|
100 self.editor.setCursorPosition(line, col + 1) |
|
101 |
|
102 # colon |
96 # colon |
103 # 1. skip colon if not last character |
97 # 1. skip colon if not last character |
104 # 2. insert blank if last character |
98 # 2. insert blank if last character |
105 elif char == ':': |
99 elif char == ':': |
106 text = self.editor.text(line) |
100 text = self.editor.text(line) |
110 self.editor.removeSelectedText() |
104 self.editor.removeSelectedText() |
111 elif self.__insertBlankColon and col == len(text.rstrip()): |
105 elif self.__insertBlankColon and col == len(text.rstrip()): |
112 self.editor.insert(' ') |
106 self.editor.insert(' ') |
113 self.editor.setCursorPosition(line, col + 1) |
107 self.editor.setCursorPosition(line, col + 1) |
114 |
108 |
115 # question mark |
109 # dash, question mark or comma |
116 # insert blank |
110 # insert blank |
117 elif char == '?' and self.__insertBlankQuestion: |
111 elif ( |
118 self.editor.insert(' ') |
112 (char == '-' and self.__insertBlankDash) or |
119 self.editor.setCursorPosition(line, col + 1) |
113 (char == '?' and self.__insertBlankQuestion) or |
120 |
114 (char == ',' and self.__insertBlankComma) |
121 # comma |
115 ): |
122 # insert blank |
|
123 elif char == ',' and self.__insertBlankComma: |
|
124 self.editor.insert(' ') |
116 self.editor.insert(' ') |
125 self.editor.setCursorPosition(line, col + 1) |
117 self.editor.setCursorPosition(line, col + 1) |
126 |
118 |
127 # double quote |
119 # double quote |
128 # insert double quote |
120 # insert double quote |