Hi all,
I cannot make ‘view.searchText’ works, using KatePart scripting feature.
Here is my current document tex :
aaaa
bbbbbbb
ccccccccc
dddddddddd
gggg family ggggggggg
xxxxxxxxxxxxxxx
zzzzzzzzzz
ooooooooo
pppppppppp
llllllllllllll
mmmmmmmmmmm
yyyyyyyyyy
tttttttttt
I want to find the first “empty” line (line with newline or space or tab only)
Here is my code:
var searchRange = new Range(view.cursorPosition(), document.documentEnd());
if (searchRange.isValid()){
var r = view.searchText(searchRange, "^\s*$");
if (r.isValid()){
// do something
} else {
// do something else
}
r.isValid() is returning false.
I don’t think the pattern is wrong as it even could not find more simple pattern like “family.*".
It seems it find only fixed string (if I place the cursor in the first paragraph before the family string , I can find the pattern “family” .)
Any idea or remark is welcome.
Jhoran