Page 1 of 31

Scripts discussion (4)

Posted: Mon Oct 17, 2016 3:46 pm
by Instructor
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)

Posted: Mon Oct 17, 2016 3:53 pm
by Instructor
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.

Posted: Mon Oct 17, 2016 7:58 pm
by KDJ
Instructor, Drugmix

In KDJ.zip is test version: FindReplaceEx_test.js. Please check how it works.

Posted: Wed Oct 19, 2016 10:37 am
by Drugmix
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
(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!

Posted: Wed Oct 19, 2016 5:20 pm
by KDJ
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.

Posted: Wed Oct 19, 2016 8:16 pm
by Drugmix
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.

Posted: Tue Nov 01, 2016 6:08 pm
by Sticher78
Вопрос по SelectionOpenInTab.js.

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

Как автоматом попросить его определять "Тему"?
Я про подсветку кода,типа "Html", "PhP", "CSS" и т.п..

Posted: Tue Nov 01, 2016 6:36 pm
by Skif_off
Sticher78
Посмотрите NewFilebyRecent.js: будет включена подсветка кода файла, из которого копируете.

Posted: Tue Nov 01, 2016 6:42 pm
by Sticher78
А как этот скрипт прикрутить к SelectionOpenInTab.js в вызове?

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

Code: Select all

"Копировать в новый таб" Call("Scripts::Main", 1, "SelectionOpenInTab.js") Icon("%a\AkelFiles\Icons\synchro.ico")
Я просто не особо шарю в программинге, простите, если задаю нубские вопросы.

Posted: Tue Nov 01, 2016 9:43 pm
by KDJ
SelectionOpenInTab.js
Added: in new tab, syntax theme is set as in source tab.

Sticher78
Try new version of the script.

Posted: Tue Nov 01, 2016 10:04 pm
by Skif_off
Sticher78
Я тоже не программист :) Хотя KDJ и добавил фичу, отвечу: прикручивать к SelectionOpenInTab.js не нужно, это независимый скрипт, запуск аналогичен

Code: Select all

"Копировать в новый таб" Call("Scripts::Main", 1, "NewFilebyRecent.js") Icon("%a\AkelFiles\Icons\synchro.ico")
См. FAQ: Как пользоваться скриптами?
Традиционно в начале скриптов идёт комментарий с более-менее подробным описанием (в т.ч. поддерживаемых аргументов) и один или несколько примеров.

Posted: Wed Nov 02, 2016 8:39 am
by Sticher78
О! Збс) Работает как я и спрашивал.

Спс за подсказку :)

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

Исчо один траббл

Posted: Fri Nov 04, 2016 11:22 pm
by Sticher78
Уже сам решил. В той же теме код

Posted: Fri Nov 04, 2016 11:26 pm
by Sticher78
Возник еще вопрос.

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

Чтобы не вылазило диалоговое окно.

Posted: Sat Nov 05, 2016 12:22 am
by FeyFre

Code: Select all

AkelPad.SendMessage(AkelPad.GetMainWnd(), AKD_SETMODIFY, hEditWnd, 0);