Skip to content

Commit 104b54d

Browse files
committed
Removed unused code
1 parent 7407ea5 commit 104b54d

File tree

2 files changed

+23
-6
lines changed

2 files changed

+23
-6
lines changed

cq_editor/widgets/editor.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -173,12 +173,6 @@ def eventFilter(self, watched, event):
173173
# Let the event propagate to the editor
174174
return False
175175

176-
def hide_completion_list(self):
177-
"""
178-
Hide the completion list.
179-
"""
180-
if self.completion_list and self.completion_list.isVisible():
181-
self.completion_list.hide()
182176

183177
def _fixContextMenu(self):
184178

tests/test_app.py

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1747,6 +1747,19 @@ def test_autocomplete(main):
17471747
editor.get_text_with_eol() == r"""import cadquery as cq\nres = cq.Workplane"""
17481748
)
17491749

1750+
# Set some text that should give a couple of auto-complete options
1751+
editor.set_text(r"""import cadquery as cq\nres = cq.Workplane()""")
1752+
1753+
# Set the cursor position to the end of the text
1754+
editor.set_cursor_position(len(editor.get_text_with_eol()))
1755+
1756+
# Trigger auto-complete
1757+
editor._trigger_autocomplete()
1758+
qtbot.wait(100)
1759+
1760+
# Check to make sure that the auto-complete trigger removed the last ")"
1761+
assert editor.get_text_with_eol() == r"""import cadquery as cq\nres = cq.Workplane("""
1762+
17501763

17511764
# Skip this test on Linux due to a known issue with Qt and keystrokes
17521765
@pytest.mark.skipif(
@@ -1821,3 +1834,13 @@ def test_autocomplete_keystrokes(main):
18211834
qtbot.keyClick(editor.completion_list, Qt.Key_Escape)
18221835
qtbot.wait(250)
18231836
assert not editor.completion_list.isVisible()
1837+
1838+
# Trigger autocomplete again
1839+
qtbot.keyClick(editor, Qt.Key_Slash, modifier=Qt.AltModifier)
1840+
qtbot.wait(250)
1841+
1842+
# Trigger a key press that is not handled by the completion list
1843+
qtbot.keyClick(editor.completion_list, Qt.Key_A)
1844+
qtbot.wait(250)
1845+
# Check that the completion list is still visible
1846+
assert editor.completion_list.isVisible()

0 commit comments

Comments
 (0)