Skip to content

Commit

Permalink
Fixed typo in enum
Browse files Browse the repository at this point in the history
  • Loading branch information
vkbo committed Jun 27, 2020
1 parent 9f8963d commit dad4677
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion nw/constants/enum.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ class nwDocAction(Enum):
CUT = 3
COPY = 4
PASTE = 5
ENPH = 6
EMPH = 6
STRONG = 7
STRONGEMPH = 8
STRIKE = 9
Expand Down
2 changes: 1 addition & 1 deletion nw/gui/doceditor.py
Original file line number Diff line number Diff line change
Expand Up @@ -514,7 +514,7 @@ def docAction(self, theAction):
self.copy()
elif theAction == nwDocAction.PASTE:
self.paste()
elif theAction == nwDocAction.ENPH:
elif theAction == nwDocAction.EMPH:
self._toggleEmph(1)
elif theAction == nwDocAction.STRONG:
self._toggleEmph(2)
Expand Down
2 changes: 1 addition & 1 deletion nw/gui/mainmenu.py
Original file line number Diff line number Diff line change
Expand Up @@ -530,7 +530,7 @@ def _buildFormatMenu(self):
self.aFmtEmph = QAction("Emphasis", self)
self.aFmtEmph.setStatusTip("Add emphasis to selected text (italic)")
self.aFmtEmph.setShortcut("Ctrl+I")
self.aFmtEmph.triggered.connect(lambda: self._docAction(nwDocAction.ENPH))
self.aFmtEmph.triggered.connect(lambda: self._docAction(nwDocAction.EMPH))
self.fmtMenu.addAction(self.aFmtEmph)

# Format > Strong Emphasis
Expand Down
10 changes: 5 additions & 5 deletions tests/test_gui.py
Original file line number Diff line number Diff line change
Expand Up @@ -772,10 +772,10 @@ def testDocAction(qtbot, nwTempGUI, nwLipsum, nwRef, nwTemp):
qtbot.wait(stepDelay)

# Italic
assert nwGUI.passDocumentAction(nwDocAction.ENPH)
assert nwGUI.passDocumentAction(nwDocAction.EMPH)
assert nwGUI.docEditor.getText()[27:76] == "*Pellentesque* nec erat ut nulla posuere commodo."
qtbot.wait(stepDelay)
assert nwGUI.passDocumentAction(nwDocAction.ENPH)
assert nwGUI.passDocumentAction(nwDocAction.EMPH)
assert nwGUI.docEditor.getText()[27:74] == cleanText
qtbot.wait(stepDelay)

Expand All @@ -798,9 +798,9 @@ def testDocAction(qtbot, nwTempGUI, nwLipsum, nwRef, nwTemp):
# Should get us back to plain
assert nwGUI.passDocumentAction(nwDocAction.STRONG)
qtbot.wait(stepDelay)
assert nwGUI.passDocumentAction(nwDocAction.ENPH)
assert nwGUI.passDocumentAction(nwDocAction.EMPH)
qtbot.wait(stepDelay)
assert nwGUI.passDocumentAction(nwDocAction.ENPH)
assert nwGUI.passDocumentAction(nwDocAction.EMPH)
qtbot.wait(stepDelay)
assert nwGUI.passDocumentAction(nwDocAction.STRONG)
assert nwGUI.docEditor.getText()[27:74] == cleanText
Expand All @@ -809,7 +809,7 @@ def testDocAction(qtbot, nwTempGUI, nwLipsum, nwRef, nwTemp):
# Equivalent of the above
assert nwGUI.passDocumentAction(nwDocAction.STRONGEMPH)
qtbot.wait(stepDelay)
assert nwGUI.passDocumentAction(nwDocAction.ENPH)
assert nwGUI.passDocumentAction(nwDocAction.EMPH)
qtbot.wait(stepDelay)
assert nwGUI.passDocumentAction(nwDocAction.STRONG)
assert nwGUI.docEditor.getText()[27:74] == cleanText
Expand Down

0 comments on commit dad4677

Please sign in to comment.