Skip to content

Commit 1d56127

Browse files
committed
fix #278 Problem with editor.research() taking None for maxCount parameter
- made docu for maxCount parameter clear - updated link to boost regex version - added hint that startPosition < endPosition, if not -1 is used
1 parent a413afe commit 1d56127

1 file changed

Lines changed: 7 additions & 7 deletions

File tree

docs/source/scintilla.rst

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5062,7 +5062,7 @@ Helper Methods
50625062
.. method:: editor.rereplace(search, replace[, flags[, startPosition[, endPosition[, maxCount]]]])
50635063

50645064
The main search and replace method, using regular expressions. The regular expression syntax in use is
5065-
that from Notepad++, which is actually the `Boost::Regex <https://www.boost.org/doc/libs/1_55_0/libs/regex/doc/html/index.html>`_
5065+
that from Notepad++, which is actually the `Boost::Regex <https://www.boost.org/doc/libs/1_80_0/libs/regex/doc/html/index.html>`_
50665066
implementation (specifically the Perl regular expression syntax).
50675067

50685068

@@ -5098,12 +5098,12 @@ Helper Methods
50985098
editor.rereplace('X([0-9]+)', add_1);
50995099

51005100
``startPosition`` is the binary position to start the search. Use :meth:`editor.positionFromLine`
5101-
to get the binary position from the (zero indexed) line number.
5101+
to get the binary position from the (zero indexed) line number. The startPosition needs to be smaller than the endPosition.
51025102

51035103
``endPosition`` is the binary position to end the search. Use :meth:`editor.positionFromLine`
51045104
to get the binary position from the (zero indexed) line number.
51055105

5106-
A maximum of ``count`` replacements are made, if zero or None, then all replacements are made.
5106+
If ``maxCount`` is a positive integer number then a maximum of ``maxCount`` replacements are made. Otherwise all replacements are made.
51075107

51085108

51095109
An small point to note, is that the replacements are first searched, and then all replacements are made.
@@ -5114,7 +5114,7 @@ Helper Methods
51145114
.. method:: editor.research(search, matchFunction[, flags[, startPosition[, endPosition[, maxCount]]]])
51155115

51165116
The main search method, using regular expressions. The regular expression syntax in use is
5117-
that from Notepad++, which is actually the `Boost::Regex <https://www.boost.org/doc/libs/1_55_0/libs/regex/doc/html/index.html>`_
5117+
that from Notepad++, which is actually the `Boost::Regex <https://www.boost.org/doc/libs/1_80_0/libs/regex/doc/html/index.html>`_
51185118
implementation (specifically the Perl regular expression syntax).
51195119

51205120
``flags`` are from the re module (e.g. ``re.IGNORECASE``), so ``import re`` if you use the flags.
@@ -5130,7 +5130,7 @@ Helper Methods
51305130
successfully performed, an error occurs. When a standard Python string is used, no conversion takes place. If you need to replace
51315131
strings in documents in both UTF-8 and ANSI (or other single byte encodings), then it's best to pass unicode strings.
51325132

5133-
``matchFunction`` is a function that gets callled with each match. This function receives a single parameter, which is an object resembling a re.MatchObject instance.
5133+
``matchFunction`` is a function that gets called with each match. This function receives a single parameter, which is an object resembling a re.MatchObject instance.
51345134
It only resembles an re.MatchObject because it doesn't support all the methods. Specifically, ``groupdict()``, ``pos``, ``endpos``, ``re`` and ``string``
51355135
methods and properties are not supported. ``expand()``, ``group()`` and ``groups()`` (for example) all work identically. The function should
51365136
return the string to use as the replacement.
@@ -5157,12 +5157,12 @@ Helper Methods
51575157

51585158

51595159
``startPosition`` is the binary position to start the search. Use :meth:`editor.positionFromLine`
5160-
to get the binary position from the (zero indexed) line number.
5160+
to get the binary position from the (zero indexed) line number. The startPosition needs to be smaller than the endPosition.
51615161

51625162
``endPosition`` is the binary position to end the search. Use :meth:`editor.positionFromLine`
51635163
to get the binary position from the (zero indexed) line number.
51645164

5165-
If ``maxCount`` is not zero or None, then the search stops as soon as ``maxCount`` matches have been found.
5165+
If ``maxCount`` is a positive integer number, then the search stops as soon as ``maxCount`` matches have been found. Otherwise all matches that could be found.
51665166

51675167

51685168
.. method:: editor.getCurrentWord()

0 commit comments

Comments
 (0)