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 

Scripts discussion (4)
Goto page 1, 2, 3  Next
 
Post new topic   Reply to topic    AkelPad Forum Index -> Plugins
View previous topic :: View next topic  
Author Message
Instructor
Site Admin


Joined: 06 Jul 2006
Posts: 6188

PostPosted: Mon Oct 17, 2016 3:46 pm    Post subject: Scripts discussion (4) Reply with quote

RUS: Обсуждение скриптов.

ENG: Scripts discussion.


Scripts discussion (1) 07.07.2007 - 08.09.2011
Scripts discussion (2) 08.09.2011 - 17.04.2014
Scripts discussion (3) 17.04.2014 - 20.09.2016
Scripts discussion (4)
Back to top
View user's profile Send private message Send e-mail
Instructor
Site Admin


Joined: 06 Jul 2006
Posts: 6188

PostPosted: Mon Oct 17, 2016 3:53 pm    Post subject: Reply with quote

Drugmix wrote:
KDJ,
Could you, please, mute FindReplaceEx.js when a user performs an erroneous search query by searching something up in selection when nothing is actually selected?
By muting I mean suppress the 'Search finished' popup.
Thanks in advance.
Back to top
View user's profile Send private message Send e-mail
KDJ



Joined: 06 Mar 2010
Posts: 1907
Location: Poland

PostPosted: Mon Oct 17, 2016 7:58 pm    Post subject: Reply with quote

Instructor, Drugmix

In KDJ.zip is test version: FindReplaceEx_test.js. Please check how it works.
Back to top
View user's profile Send private message
Drugmix



Joined: 08 Apr 2013
Posts: 573
Location: Win7SP1x64, APx64

PostPosted: Wed Oct 19, 2016 10:37 am    Post subject: Reply with quote

KDJ, thanks!
It seems to work fine, but the checkbox 'Check "in selection" if selection not empty' seems to do nothing.

I've got a few other ideas for FindReplaceEx.js that you might find interesting:
1. I hate alerts, especially non-modal windows
(such windows may be a huge PitA because they may get lost behind non-movable windows, like other non-modal windows that also block user's interaction with their parental windows until you close those non-modal ones)
, they are very annoying. It would be nice to get away from alerting user via modal-windows to alerting him by displaying that text right in the FindReplaceEx.js's window.

2. I don't know if that is fixable, but I believe that there should at least be an option to make replace all keep lines folding intact (currently, when executing 'replace all' - some folded items get unfolded).

3. I use the function that applies partial opacity to FindReplaceEx.js's window when it's not active. With high opacity level - it usually still annoys the view, so I use low level of opacity (high transparency) and when I click back to that window - sometimes I accidentally hit a button/checkbox/radiobutton/link/slider, which is annoying, because the first click is made blindly: I see the position of the window, but I don't really see its contents.
There are two ways to solve this problem:
a. make the window get full opacity when cursor hovers it (this may lead to annoyance caused by unintentional cursor moves triggering the blinking of that window, but adding a delay (like the window shouldn't appear if it was hovered for less than 1 sec) would solve this issue);
b. make the window ignore the first click if it was inactive when the click occurred: such a click should just activate the window and do just that and nothing else.

4. I believe it makes sense to make this window resizable, along with 'What' and 'With' input fields (make them multiline), because it is PitA to work with long and complex regex replacements when you can't see the whole expression with one glance.

p.s.: thanks for that script!
Back to top
View user's profile Send private message
KDJ



Joined: 06 Mar 2010
Posts: 1907
Location: Poland

PostPosted: Wed Oct 19, 2016 5:20 pm    Post subject: Reply with quote

Drugmix wrote:
... the checkbox 'Check "in selection" if selection not empty' seems to do nothing.

This CheckBox has the same effect as:
Options -> Settings -> Advanced -> Check "in selection" if selection not empty
And it works the same as in standard Find/Replace dialog.
To see the effect, you need to select more than one line.
Back to top
View user's profile Send private message
Drugmix



Joined: 08 Apr 2013
Posts: 573
Location: Win7SP1x64, APx64

PostPosted: Wed Oct 19, 2016 8:16 pm    Post subject: Reply with quote

KDJ wrote:
This CheckBox has the same effect as:
Options -> Settings -> Advanced -> Check "in selection" if selection not empty
And it works the same as in standard Find/Replace dialog.
To see the effect, you need to select more than one line.

Oh, I probably misunderstood what it does.
I thought it was supposed to alert the user that selection was empty if the user decided to search or search&replace something 'in selection'.
But now I realize it would be a quite useless thing to do and that setting probably makes the SearchReplaceEx.js ignore the selected search scope completely if there is anything selected and instead search in selection in that case.
Back to top
View user's profile Send private message
Sticher78



Joined: 30 Jul 2016
Posts: 22

PostPosted: Tue Nov 01, 2016 6:08 pm    Post subject: Reply with quote

Вопрос по SelectionOpenInTab.js.

К примеру, я выделяю код в css-файле и жму "Скопировать в новый таб".

Как автоматом попросить его определять "Тему"?
Я про подсветку кода,типа "Html", "PhP", "CSS" и т.п..
Back to top
View user's profile Send private message
Skif_off



Joined: 20 Oct 2013
Posts: 1028

PostPosted: Tue Nov 01, 2016 6:36 pm    Post subject: Reply with quote

Sticher78
Посмотрите NewFilebyRecent.js: будет включена подсветка кода файла, из которого копируете.
Back to top
View user's profile Send private message
Sticher78



Joined: 30 Jul 2016
Posts: 22

PostPosted: Tue Nov 01, 2016 6:42 pm    Post subject: Reply with quote

А как этот скрипт прикрутить к SelectionOpenInTab.js в вызове?

У меня вот так вызывается:

Code:
"Копировать в новый таб" Call("Scripts::Main", 1, "SelectionOpenInTab.js") Icon("%a\AkelFiles\Icons\synchro.ico")


Я просто не особо шарю в программинге, простите, если задаю нубские вопросы.
Back to top
View user's profile Send private message
KDJ



Joined: 06 Mar 2010
Posts: 1907
Location: Poland

PostPosted: Tue Nov 01, 2016 9:43 pm    Post subject: Reply with quote

SelectionOpenInTab.js
Added: in new tab, syntax theme is set as in source tab.

Sticher78
Try new version of the script.
Back to top
View user's profile Send private message
Skif_off



Joined: 20 Oct 2013
Posts: 1028

PostPosted: Tue Nov 01, 2016 10:04 pm    Post subject: Reply with quote

Sticher78
Я тоже не программист Smile Хотя KDJ и добавил фичу, отвечу: прикручивать к SelectionOpenInTab.js не нужно, это независимый скрипт, запуск аналогичен
Code:
"Копировать в новый таб" Call("Scripts::Main", 1, "NewFilebyRecent.js") Icon("%a\AkelFiles\Icons\synchro.ico")


См. FAQ: Как пользоваться скриптами?
Традиционно в начале скриптов идёт комментарий с более-менее подробным описанием (в т.ч. поддерживаемых аргументов) и один или несколько примеров.
Back to top
View user's profile Send private message
Sticher78



Joined: 30 Jul 2016
Posts: 22

PostPosted: Wed Nov 02, 2016 8:39 am    Post subject: Reply with quote

О! Збс) Работает как я и спрашивал.

Спс за подсказку Smile

А может ещё вот это подскажете? ))

Исчо один траббл
Back to top
View user's profile Send private message
Sticher78



Joined: 30 Jul 2016
Posts: 22

PostPosted: Fri Nov 04, 2016 11:22 pm    Post subject: Reply with quote

Уже сам решил. В той же теме код
Back to top
View user's profile Send private message
Sticher78



Joined: 30 Jul 2016
Posts: 22

PostPosted: Fri Nov 04, 2016 11:26 pm    Post subject: Reply with quote

Возник еще вопрос.

Как закрыть файл без сохранения?

Чтобы не вылазило диалоговое окно.
Back to top
View user's profile Send private message
FeyFre



Joined: 07 Aug 2007
Posts: 2209
Location: Vinnitsa, Ukraine

PostPosted: Sat Nov 05, 2016 12:22 am    Post subject: Reply with quote

Code:
AkelPad.SendMessage(AkelPad.GetMainWnd(), AKD_SETMODIFY, hEditWnd, 0);
Back to top
View user's profile Send private message AIM Address Yahoo Messenger MSN Messenger
Display posts from previous:   
Post new topic   Reply to topic    AkelPad Forum Index -> Plugins All times are GMT
Goto page 1, 2, 3  Next
Page 1 of 3

 
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