Scripts discussion (4)

Discuss and announce AkelPad plugins
Post Reply
  • Author
  • Message
Offline
Site Admin
Posts: 6311
Joined: Thu Jul 06, 2006 7:20 am

Scripts discussion (4)

Post 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)

Offline
Site Admin
Posts: 6311
Joined: Thu Jul 06, 2006 7:20 am

Post 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.

KDJ
Offline
Posts: 1949
Joined: Sat Mar 06, 2010 7:40 pm
Location: Poland

Post by KDJ »

Instructor, Drugmix

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

Offline
Posts: 582
Joined: Mon Apr 08, 2013 9:50 pm
Location: Win7SP1x64, APx64

Post 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!

KDJ
Offline
Posts: 1949
Joined: Sat Mar 06, 2010 7:40 pm
Location: Poland

Post 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.

Offline
Posts: 582
Joined: Mon Apr 08, 2013 9:50 pm
Location: Win7SP1x64, APx64

Post 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.

Offline
Posts: 24
Joined: Sat Jul 30, 2016 9:39 am

Post by Sticher78 »

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

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

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

Offline
Posts: 1161
Joined: Sun Oct 20, 2013 11:44 am

Post by Skif_off »

Sticher78
Посмотрите NewFilebyRecent.js: будет включена подсветка кода файла, из которого копируете.

Offline
Posts: 24
Joined: Sat Jul 30, 2016 9:39 am

Post by Sticher78 »

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

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

Code: Select all

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

KDJ
Offline
Posts: 1949
Joined: Sat Mar 06, 2010 7:40 pm
Location: Poland

Post by KDJ »

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

Sticher78
Try new version of the script.

Offline
Posts: 1161
Joined: Sun Oct 20, 2013 11:44 am

Post by Skif_off »

Sticher78
Я тоже не программист :) Хотя KDJ и добавил фичу, отвечу: прикручивать к SelectionOpenInTab.js не нужно, это независимый скрипт, запуск аналогичен

Code: Select all

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

Offline
Posts: 24
Joined: Sat Jul 30, 2016 9:39 am

Post by Sticher78 »

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

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

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

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

Offline
Posts: 24
Joined: Sat Jul 30, 2016 9:39 am

Post by Sticher78 »

Уже сам решил. В той же теме код

Offline
Posts: 24
Joined: Sat Jul 30, 2016 9:39 am

Post by Sticher78 »

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

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

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

Offline
Posts: 2247
Joined: Tue Aug 07, 2007 2:03 pm
Location: Vinnitsa, Ukraine

Post by FeyFre »

Code: Select all

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