{{ message }}
gh-130693: Add options of the tkinter.Text.search method: -nolinestop -all -overlap -strictlimits#130848
Merged
Merged
Conversation
Wulian233
reviewed
Mar 5, 2025
Contributor
Author
|
@ZeroIntensity Could someone please review? I think the original reviewer forgot |
Wulian233
reviewed
May 5, 2025
Contributor
Author
|
@Wulian233 Please Review again |
Contributor
Author
|
I am currently pinging this PR as I have not seen a review in nearly a month. |
Contributor
Author
|
On it
…On Fri, May 30, 2025 at 13:22 Peter Bierma ***@***.***> wrote:
***@***.**** commented on this pull request.
------------------------------
In Misc/NEWS.d/next/Library/2025-03-04-17-19-26.gh-issue-130693.Kv01r8.rst
<#130848 (comment)>:
> @@ -0,0 +1,6 @@
+================
+Type: Enhancement
We don't need this metadata.
—
Reply to this email directly, view it on GitHub
<#130848 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/BNITW52CNI3C5F6RICJESQD3BCHTXAVCNFSM6AAAAABYKCKEFWVHI2DSMVQWIX3LMV43YUDVNRWFEZLROVSXG5CSMV3GSZLXHMZDQOBRHE2TMNRRHE>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
Contributor
Author
|
Done! |
Contributor
Author
|
It has been nearly a month. @ZeroIntensity Could you please review? |
ZeroIntensity
left a comment
Member
There was a problem hiding this comment.
All new features need tests. Please add one to test_tkinter.
Contributor
Author
|
Will do
…On Tue, Jun 17, 2025 at 19:07 Peter Bierma ***@***.***> wrote:
***@***.**** commented on this pull request.
All new features need tests. Please add one to test_tkinter.
------------------------------
In Misc/NEWS.d/next/Library/2025-03-04-17-19-26.gh-issue-130693.Kv01r8.rst
<#130848 (comment)>:
> @@ -0,0 +1,2 @@
+Add support for ``-nolinestop``, ``-all``, ``-overlap``, and ``-strictlimits`` options to ``tkinter.Text.search``
⬇️ Suggested change
-Add support for ``-nolinestop``, ``-all``, ``-overlap``, and ``-strictlimits`` options to ``tkinter.Text.search``
+Add support for ``-nolinestop``, ``-all``, ``-overlap``, and ``-strictlimits`` options to :meth:`tkinter.Text.search`
------------------------------
In Lib/tkinter/__init__.py
<#130848 (comment)>:
> @@ -4038,9 +4038,7 @@ def scan_dragto(self, x, y):
scan_mark."""
self.tk.call(self._w, 'scan', 'dragto', x, y)
- def search(self, pattern, index, stopindex=None,
- forwards=None, backwards=None, exact=None,
- regexp=None, nocase=None, count=None, elide=None):
+ def search(self, pattern, index, stopindex=None, forwards=None, backwards=None, exact=None, regexp=None, nocase=None, count=None, elide=None, nolinestop=None, all=None, overlap=None, strictlimits=None):
Please change it back to the old formatting.
------------------------------
In Lib/tkinter/__init__.py
<#130848 (comment)>:
> +
+
Stray newline changes:
⬇️ Suggested change
-
-
—
Reply to this email directly, view it on GitHub
<#130848 (review)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/BNITW5Z32DYZL5OQEMOCKLL3EAK2TAVCNFSM6AAAAABYKCKEFWVHI2DSMVQWIX3LMV43YUDVNRWFEZLROVSXG5CSMV3GSZLXHMZDSMZVG4YTGOBSG4>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
Contributor
Author
|
I updated the branch as it has been a while since this PR has been opened |
Contributor
Author
|
Gentle ping |
Added tests for text.search with and without regex.
Refactor test_search_all to simplify assertions and update overlap checks.
Contributor
Author
|
@serhiy-storchaka Ready for review |
serhiy-storchaka
pushed a commit
to serhiy-storchaka/cpython
that referenced
this pull request
Nov 17, 2025
|
GH-141669 is a backport of this pull request to the 3.14 branch. |
Member
serhiy-storchaka
added a commit
that referenced
this pull request
Nov 17, 2025
miss-islington
pushed a commit
to miss-islington/cpython
that referenced
this pull request
Nov 17, 2025
…honGH-130848) (pythonGH-141669) (cherry picked from commit 8db1aad) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
serhiy-storchaka
added a commit
that referenced
this pull request
Nov 17, 2025
StanFromIreland
pushed a commit
to StanFromIreland/cpython
that referenced
this pull request
Dec 6, 2025
…honGH-130848) * Add parameters nolinestop and strictlimits in the tkinter.Text.search() method. * Add the tkinter.Text.search_all() method. * Add more tests for tkinter.Text.search(). * stopindex is now only ignored if it is None.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Add options -nolinestop, -all, -overlap, and -strictlimits to the search function of the text class of tkinter.
Fixes #130693
Closes #130693
Tested against
And test passed. Result:
Also tested against a custom test file:
[EDITED for change to new search_all method for -all and -overlap]
Which returns:
Indicating that the new features are functioning correctly