Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

findText do not find text #223

Closed
MaDill opened this issue Feb 17, 2022 · 2 comments
Closed

findText do not find text #223

MaDill opened this issue Feb 17, 2022 · 2 comments
Milestone

Comments

@MaDill
Copy link

MaDill commented Feb 17, 2022

I can not get editor.findText working.

Configuration:

Notepad++ v8.3.1   (64-bit)
Build time : Feb 13 2022 - 15:41:12
Path : C:\_PortablePrograms\Notepad++\notepad++.exe
Command Line : 
Admin mode : OFF
Local Conf mode : ON
Cloud Config : OFF
OS Name : Windows 10 Pro (64-bit) 
OS Version : 2009
OS Build : 19044.1466
Current ANSI codepage : 1252
Plugins : DSpellCheck.dll HexEditor.dll mimeTools.dll NppConverter.dll NppExec.dll NppExport.dll PythonScript.dll XMLTools.dll 

PythonScript Version 1.5.4.0 64bit

Testfile:

test1
test2as
test 3
test4
teSt5
tast6
tes17
test8
tes9
test10

Console commands:

>>> matches = []
>>> editor.research(r'test\d$', lambda m: matches.append(m.span(0)), 0, 0, editor.getLength())
>>> print(matches)
[(0, 5), (24, 29), (52, 57)]
>>> findResult = editor.findText(FINDOPTION.REGEXP, 0, editor.getLength(), r'test\d$')
>>> print(findResult)
None

How to use editor.findText?

@alankilborn
Copy link

I put it in a script file and ran it that way, and it seems to work for me (N++ 8.2.1, PS 1.5.4.0, 64bit):

'''
test1
test2as
test 3
test4
teSt5
tast6
tes17
test8
tes9
test10
'''
matches = []
editor.research(r'test\d$', lambda m: matches.append(m.span(0)), 0, 0, editor.getLength())
print(matches)
findResult = editor.findText(FINDOPTION.REGEXP, 0, editor.getLength(), r'test\d$')
print(findResult)

image

chcg added a commit that referenced this issue Feb 17, 2022
expected to fix:
- editor.getTextRange crash notepad++ #224
- findText do not find text #223
- Notepad++ 8.3 builds change Sci_position leading to crash #218
@chcg chcg added this to the v2.0 milestone Feb 17, 2022
@chcg
Copy link
Collaborator

chcg commented Feb 17, 2022

Fixed with https://github.com/bruderstein/PythonScript/releases/tag/v2.0.0 and
https://github.com/bruderstein/PythonScript/releases/tag/v3.0.11

@chcg chcg closed this as completed Feb 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants