Fix smart quote issue (#874)

This commit is contained in:
Veronica Berglyd Olsen
2021-08-30 23:23:47 +02:00
parent 62344376d7
commit bdef9a3955
4 changed files with 61 additions and 11 deletions
+10 -2
View File
@@ -1763,7 +1763,7 @@ class GuiDocEditor(QTextEdit):
nDelete = 0
tInsert = theOne
if self.mainConf.doReplaceDQuote and theTwo == ' "':
if self.mainConf.doReplaceDQuote and theTwo[:1].isspace() and theTwo.endswith('"'):
nDelete = 1
tInsert = self._typDQOpen
@@ -1771,10 +1771,14 @@ class GuiDocEditor(QTextEdit):
nDelete = 1
if thePos == 1:
tInsert = self._typDQOpen
elif thePos == 2 and theTwo == '>"':
tInsert = self._typDQOpen
elif thePos == 3 and theThree == '>>"':
tInsert = self._typDQOpen
else:
tInsert = self._typDQClose
elif self.mainConf.doReplaceSQuote and theTwo == " '":
elif self.mainConf.doReplaceSQuote and theTwo[:1].isspace() and theTwo.endswith("'"):
nDelete = 1
tInsert = self._typSQOpen
@@ -1782,6 +1786,10 @@ class GuiDocEditor(QTextEdit):
nDelete = 1
if thePos == 1:
tInsert = self._typSQOpen
elif thePos == 2 and theTwo == ">'":
tInsert = self._typSQOpen
elif thePos == 3 and theThree == ">>'":
tInsert = self._typSQOpen
else:
tInsert = self._typSQClose