Skip to content

Commit

Permalink
Merge from 5.x: PR #21085
Browse files Browse the repository at this point in the history
  • Loading branch information
ccordoba12 committed Jun 29, 2023
2 parents 3b23899 + 70f3065 commit 63f448f
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test-linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ jobs:
INSTALL_TYPE: ['pip', 'conda']
PYTHON_VERSION: ['3.8', '3.10']
TEST_TYPE: ['fast', 'slow']
timeout-minutes: 120
timeout-minutes: 90
steps:
- name: Checkout Pull Requests
if: github.event_name == 'pull_request'
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test-mac.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ jobs:
INSTALL_TYPE: ['conda']
PYTHON_VERSION: ['3.9']
TEST_TYPE: ['fast', 'slow']
timeout-minutes: 120
timeout-minutes: 90
steps:
- name: Checkout Pull Requests
if: github.event_name == 'pull_request'
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test-win.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ jobs:
INSTALL_TYPE: ['pip', 'conda']
PYTHON_VERSION: ['3.9']
TEST_TYPE: ['fast', 'slow']
timeout-minutes: 120
timeout-minutes: 90
steps:
- name: Checkout Pull Requests
if: github.event_name == 'pull_request'
Expand Down
3 changes: 2 additions & 1 deletion spyder/plugins/editor/widgets/editor.py
Original file line number Diff line number Diff line change
Expand Up @@ -2029,7 +2029,8 @@ def current_changed(self, index):
# See spyder-ide/spyder#9688.
self.find_widget.set_editor(editor, refresh=False)

# Update total number of matches when switching files.
# Update highlighted matches and its total number when switching files.
self.find_widget.highlight_matches()
self.find_widget.update_matches()

if editor is not None:
Expand Down
9 changes: 7 additions & 2 deletions spyder/plugins/editor/widgets/tests/test_editor.py
Original file line number Diff line number Diff line change
Expand Up @@ -681,13 +681,18 @@ def test_update_matches_in_find_replace(editor_find_replace_bot, qtbot):
# Open a new file and only write "spam" on it
editor_stack.new('foo.py', 'utf-8', 'spam')

# Focus new file and check the number of matches was updated
# Focus new file and check the number of matches and highlights was updated
editor_stack.set_stack_index(1)
codeeditor = editor_stack.get_current_editor()
assert finder.number_matches_text.text() == '1 matches'
assert len(codeeditor.decorations._decorations['find']) == 1
qtbot.wait(500)

# Focus initial file and check the number of matches was updated
# Focus initial file and check the number of matches and highlights was
# updated
editor_stack.set_stack_index(0)
codeeditor = editor_stack.get_current_editor()
assert len(codeeditor.decorations._decorations['find']) == 3
qtbot.wait(500)
assert finder.number_matches_text.text() == '3 matches'

Expand Down

0 comments on commit 63f448f

Please sign in to comment.