AkelPad Forum Index AkelPad
Support forum
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Search does not work with "in selection"

 
Post new topic   Reply to topic    AkelPad Forum Index -> Discussion (English)
View previous topic :: View next topic  
Author Message
sexy96



Joined: 10 Sep 2015
Posts: 218
Location: Deutschland

PostPosted: Wed Nov 22, 2017 6:07 pm    Post subject: Search does not work with "in selection" Reply with quote

Szukaj, nie wczytuje zaznaczonego textu przy aktywnym "w zaznaczeniu"

Back to top
View user's profile Send private message
opk44



Joined: 16 Jan 2010
Posts: 615

PostPosted: Thu Nov 23, 2017 9:47 am    Post subject: Reply with quote

sexy96
Selecting text + "In selection" = limits the scope of the search.
What you would expect to see in the search string, if it is selected, for example, a few paragraphs?
Back to top
View user's profile Send private message
sexy96



Joined: 10 Sep 2015
Posts: 218
Location: Deutschland

PostPosted: Thu Nov 23, 2017 11:11 am    Post subject: Reply with quote

marked "from the beginning"



"test" is loaded into the window.
Back to top
View user's profile Send private message
opk44



Joined: 16 Jan 2010
Posts: 615

PostPosted: Thu Nov 23, 2017 12:56 pm    Post subject: Reply with quote

sexy96
Clearly. In this case you do a search in the entire (whole) text. And there is not a zero probability of finding the highlighted word again and again. But narrowing the search down to "In selection", trying to look for the selected text becomes meaningless, since you "already found" it.
Back to top
View user's profile Send private message
sexy96



Joined: 10 Sep 2015
Posts: 218
Location: Deutschland

PostPosted: Fri Nov 24, 2017 6:07 pm    Post subject: Reply with quote

I want to convert: (Chcę zamienić)
ascii->ascii
Windows->WINDOWS

I replaced it (tu zamieniłem) ascii->ascii



now i want to swap (teraz chcę zamienić) Windows->WINDOWS

1.but to load "WINDOWS" to "what?", I need to change direction in the table
"In the selection" for another example on "From the beginning" and just click on the icon "Replace ..."
and again mark the direction "In selection."

(1.aby wczytać "WINDOWS" do "Co:", muszę w tabeli kierunek zmienić
"W zaznaczeniu" na inne np. na "Od początku" i dopiero kliknąć na ikonę "Zamień..."
i ponownie zaznaczyć kierunek "W zaznaczeniu.")

Back to top
View user's profile Send private message
opk44



Joined: 16 Jan 2010
Posts: 615

PostPosted: Fri Nov 24, 2017 7:51 pm    Post subject: Reply with quote

sexy96 wrote:
I want to convert: (Chcę zamienić)
ascii->ascii
Windows->WINDOWS

1. ascii->ASCII ???
You want convert some words in uppercase?

In SearchReplace.js you can to do that in one pass

What: (ascii|Windows)
With: return $1.toUpperCase()
Options:
[*] Regular expressions
[*] Replace with function
Button: Replace all


notes:
a. List all the words in parentheses, separating them with "|" (pipe, vertical bar)
b. The option "Multiline" (on the screenshot) in fact do not need.


2.
sexy96 wrote:
1.but to load "WINDOWS" to "what?", I need to change direction in the table
You can type, not load.
Back to top
View user's profile Send private message
sexy96



Joined: 10 Sep 2015
Posts: 218
Location: Deutschland

PostPosted: Sat Nov 25, 2017 7:25 am    Post subject: Reply with quote

And when will I want to change the order?
(A gdy będę chciał zmienić kolejność?)
3->1(4x) and 4->2(4x)

It's easier to "mark the ascii" and click on the icon
"Replace ..." in the Toolbar, instead of writing it below
(Nie łatwiej "zaznaczyć ascii" i klinąć na ikonę
"Zamień..." w Toolbar, zamiast wypisywać to poniżej)

What: (ascii|Windows)
With: return $1.toUpperCase()


I do not have:
Replace with function
and
Multiline

I have x86, because I am using: Aspell
(Mam x86, ponieważ używam: Aspell)
Back to top
View user's profile Send private message
opk44



Joined: 16 Jan 2010
Posts: 615

PostPosted: Sat Nov 25, 2017 6:12 pm    Post subject: Reply with quote

begin with the end (zacznę od końca)
1.
sexy96 wrote:
I have x86...
I'm too. So what?

2.
sexy96 wrote:
I do not have:
Replace with function...
Pay attention to detail! I use in the example standard script "SearchReplace.js" (with Scripts Plugin). See text and screenshot. This script is more powerful than the standard comand "Replace".

3.
sexy96 wrote:
3->1(4x) and 4->2(4x)

If you want to do that: "button31=..." -->> "button29=..."
In "SearchReplace.js" you can use some arithmetic (31-2=29, 3-2=1, 4-2=2)

What: (\d+)(=)
With: return $1-2+$2
Options:
[*] Regular expressions
[*] Replace with function
Button: Replace all

notes:
1) In "With:" we take the first reference back and subtract from it two - [$1-2...]. Then "glue" the second reference back - [...+$2].
2) If you have only short (single digits) numbers [0-9], you can use (\d)(=) instead (\d+)(=)
3) We need second group (=) to identify strings like "\SysWOW64\" in text and ignore them.

4.
sexy96 wrote:
It's easier to "mark the ascii" and click on the icon...
I do not persuade, but only to inform about the other options.
Back to top
View user's profile Send private message
sexy96



Joined: 10 Sep 2015
Posts: 218
Location: Deutschland

PostPosted: Sun Nov 26, 2017 11:07 am    Post subject: Reply with quote

Thanks, interesting proposition.

1.
It works great:
What: (\d+)(=)
With: return $1-2+$2



but it does not work
What: (\d+)(=)
With: return $1+2+$2

2.
"Delete empty lines";
"Delete leading and trailing spaces";
"Zap symbols with spaces";

How to change it to polish?

change here, causes the subtitles to disappear completely
if (nStringID == STRID_TEMPLATE1)
return "Delete empty lines";
if (nStringID == STRID_TEMPLATE2)
return "Delete leading and trailing spaces";
if (nStringID == STRID_TEMPLATE3)
return "Zap symbols with spaces";
Back to top
View user's profile Send private message
opk44



Joined: 16 Jan 2010
Posts: 615

PostPosted: Sun Nov 26, 2017 4:32 pm    Post subject: Reply with quote

1.
sexy96 wrote:
but it does not work
What: (\d+)(=)
With: return $1+2+$2

1) "return" is missing on your screenshot
2) JScript operator "-" has only one meaning: operation of subtraction.
But JScript operator "+" has two functions: the operation of addition and string concatenation.
JScript does not know what is our reference back ($1) and uses the "+" sign to mean "concatenation".
To avoid this, we will have to explain JScript that $1 is a number and that we need to do addition:

What: (\d+)(=)
With: return parseInt($1)+2+$2

...and "yes", [ return parseInt($1)-2+$2 ] would work too, but I was too lazy to make a universal solution.

2.
sexy96 wrote:
How to change it to polish?
Two ways:
1) Hard and dangerous: You can modify "SearchReplace.ini" (not "SearchReplace.js" !!!)
2) A simple and safe: After any template selection in the same menu will appear additional item "rename...". Select it and replace the text you need.
Repeat this procedure for each of the three templates.
Back to top
View user's profile Send private message
sexy96



Joined: 10 Sep 2015
Posts: 218
Location: Deutschland

PostPosted: Sun Nov 26, 2017 5:25 pm    Post subject: Reply with quote

Thanks, it's universal
parseInt($1)+2+$2
parseInt($1)-2+$2
parseInt($1)*2+$2
works without "return"

I changed into ini polish, thanks.

1."Zamień..." Call("Scripts::Main", 1, "SearchReplace.js") Icon(13)
2."Zamień..." Call("Scripts::Main", 1, "SearchReplace.js", `-DefButtonID=1019 /*IDC_REPLACEALL_BUTTON*/`) Icon(13)

What is the difference between 1 and 2?
They look and act the same.

and what does "Zap" mean?
return "Zap symbols with spaces";
Back to top
View user's profile Send private message
opk44



Joined: 16 Jan 2010
Posts: 615

PostPosted: Sun Nov 26, 2017 7:25 pm    Post subject: Reply with quote

1.
sexy96 wrote:
I changed into ini polish, thanks.

Only the hard way? Very Happy

2.
sexy96 wrote:
What is the difference between 1 and 2?
They look and act the same.

Not the same. ("1") is equivalent to
Call("Scripts::Main", 1, "SearchReplace.js", `-DefButtonID=1016 /*IDC_FIND_BUTTON*/`) Icon(13)
in other words:
(1) press {ENTER} = press button "Find next"
(2) press {ENTER} = press button "Replace all"
But if you press buttons with the mouse only (not keyboard), then, indeed, there is no difference (for you).

3.
sexy96 wrote:
and what does "Zap" mean?
"Zap" is slang ~ shoot, kill, to erase.
In russian version used verb "заменить" ("replace").
You can see the RegExp in that template. In "What:" we have [^\n] (A negative character set. Matches any character exept "any newline"). In "With:" we have one space character.
Back to top
View user's profile Send private message
sexy96



Joined: 10 Sep 2015
Posts: 218
Location: Deutschland

PostPosted: Sun Nov 26, 2017 8:12 pm    Post subject: Reply with quote

1.It works very well
2.I usually use a mouse and an icon.
3. "Zap", I do not see the practical application.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    AkelPad Forum Index -> Discussion (English) All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


SourceForge.net Logo Powered by phpBB © 2001, 2005 phpBB Group