Page 71 of 74

Posted: Sun Feb 12, 2017 6:20 am
by Instructor
F. Phoenix
Вставляете в тексте скрипта "debugger" или "AkelPad.DebugJIT();".

Posted: Sun Feb 12, 2017 6:23 am
by Instructor
Изменено: для методов AkelPad.Call*, если был вызван скрипт, возвращается результат AkelPad.ScriptExitCode.

Changed: for AkelPad.Call* methods, if script was called, then result of AkelPad.ScriptExitCode returns.


Scripts plugin v18.6

SetClipboardText not respect carriage return

Posted: Mon Mar 19, 2018 7:51 pm
by Diamen
When i use SetClipboardText to copy a text block that have carriage returns and past in other tab it work.
But if i paste it to other software, f.e. notepad.exe, it remove all carriage return.
I think that this happens because SetClipboardText does not take into consideration the set carriage return (unix, window, mac).
Not problem if use copy to clipboard from contextual menu.
Do it is possible to fix it?
my workaround use
var clp=AkelPad.GetSelText().replace(/[\r\n]/g, "\r\n");
before of
AkelPad.SetClipboardText(clp);

Re: SetClipboardText not respect carriage return

Posted: Tue Mar 20, 2018 10:48 am
by DV
Diamen wrote:var clp=AkelPad.GetSelText().replace(/[\r\n]/g, "\r\n");
This is a good solution. Many editors do support different line ending characters (unlike the standard Notepad), so in general it's OK to set the clipboard text as is.
However, an optional parameter nNewLine for SetClipboardText (similar to the one in GetSelText and GetTextRange) would indeed make sense.

Posted: Fri Mar 30, 2018 11:11 pm
by Instructor
Diamen
AkelPad.GetSelText(3 /*\r\n*/)

Posted: Sat Mar 31, 2018 5:33 am
by Diamen
Instructor
It fix, ty.

Do exist a same option for copy from menu and context menu?

Posted: Sat Mar 31, 2018 3:11 pm
by Instructor
Diamen
Now only as script:

Code: Select all

var hWndEdit=AkelPad.GetEditWnd();
var dwNewLine=AkelPad.SendMessage(hWndEdit, 3229 /*AEM_GETNEWLINE*/, 0, 0);

AkelPad.SendMessage(hWndEdit, 3230 /*AEM_SETNEWLINE*/, 0x2 /*AENL_OUTPUT*/, MAKELONG(0, 7 /*AELB_RN*/));
AkelPad.SendMessage(hWndEdit, 3038 /*AEM_COPY*/, 0, 0);
AkelPad.SendMessage(hWndEdit, 3230 /*AEM_SETNEWLINE*/, 0x2 /*AENL_OUTPUT*/, dwNewLine);

function MAKELONG(a, b)
{
  return (a & 0xffff) | ((b & 0xffff) << 16);
}



Update:
With test version you can copy, cut, paste with specified new line. See documentation.

Posted: Mon Apr 02, 2018 12:05 pm
by Diamen
Do you can share the x64 test version?

Posted: Mon Apr 02, 2018 2:32 pm
by Skif_off

Posted: Mon Apr 02, 2018 2:52 pm
by KDJ
But these test versions are dated 03 November 2017.

Posted: Mon Apr 02, 2018 3:34 pm
by Instructor
KDJ
Forgot to upload :) Done.

Posted: Thu Jul 25, 2019 7:39 am
by Diamen
when i try to use:
"" Command(4154,10) Icon(8)
in toolbar:
1 - copy word under caret, if no selection
is not usable why button is disabled
how to enable it also without selection?

Posted: Thu Jul 25, 2019 9:42 am
by opk44
Diamen
how to enable it also without selection?

Code: Select all

-"" Command(4154,10) Icon(8) 
See "\AkelFiles\Docs\ToolBar-Eng.txt" Lines 122-133
...at presence of a minus sign the button status will not change somehow (become inactive, be pressed)...

Posted: Thu Jul 25, 2019 3:01 pm
by VladSh
Diamen
You can to use the Hotkeys-plugin, also.

Posted: Thu Jul 25, 2019 5:07 pm
by Diamen
opk44 wrote: ...at presence of a minus sign the button status will not change somehow (become inactive, be pressed)...
ty.