127 |
127 |
128 txt = ev.text() |
128 txt = ev.text() |
129 |
129 |
130 # See it is text to insert. |
130 # See it is text to insert. |
131 if len(txt) and txt >= " ": |
131 if len(txt) and txt >= " ": |
132 if self.hasSelectedText(): |
132 if ( |
133 if txt in MiniScintilla.EncloseChars: |
133 self.hasSelectedText() and |
134 encloseSelectedText(MiniScintilla.EncloseChars[txt]) |
134 txt in MiniScintilla.EncloseChars |
135 ev.accept() |
135 ): |
136 return |
136 encloseSelectedText(MiniScintilla.EncloseChars[txt]) |
|
137 ev.accept() |
|
138 return |
137 |
139 |
138 super().keyPressEvent(ev) |
140 super().keyPressEvent(ev) |
139 else: |
141 else: |
140 ev.ignore() |
142 ev.ignore() |
141 |
143 |