111 @param encString string to use to enclose the selection |
111 @param encString string to use to enclose the selection |
112 (one or two characters) |
112 (one or two characters) |
113 @type str |
113 @type str |
114 """ |
114 """ |
115 startChar = encString[0] |
115 startChar = encString[0] |
116 if len(encString) == 2: |
116 endChar = encString[1] if len(encString) == 2 else startChar |
117 endChar = encString[1] |
|
118 else: |
|
119 endChar = startChar |
|
120 |
117 |
121 sline, sindex, eline, eindex = self.getSelection() |
118 sline, sindex, eline, eindex = self.getSelection() |
122 replaceText = startChar + self.selectedText() + endChar |
119 replaceText = startChar + self.selectedText() + endChar |
123 self.beginUndoAction() |
120 self.beginUndoAction() |
124 self.replaceSelectedText(replaceText) |
121 self.replaceSelectedText(replaceText) |