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 plugin
Goto page Previous  1, 2, 3 ... 69, 70, 71
 
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: 6250

PostPosted: Sun Feb 12, 2017 6:20 am    Post subject: Reply with quote

F. Phoenix
Вставляете в тексте скрипта "debugger" или "AkelPad.DebugJIT();".
Back to top
View user's profile Send private message Send e-mail
Instructor
Site Admin


Joined: 06 Jul 2006
Posts: 6250

PostPosted: Sun Feb 12, 2017 6:23 am    Post subject: Reply with quote

Изменено: для методов AkelPad.Call*, если был вызван скрипт, возвращается результат AkelPad.ScriptExitCode.

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


Scripts plugin v18.6
Back to top
View user's profile Send private message Send e-mail
Diamen



Joined: 15 Aug 2008
Posts: 61

PostPosted: Mon Mar 19, 2018 7:51 pm    Post subject: SetClipboardText not respect carriage return Reply with quote

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);
Back to top
View user's profile Send private message
DV



Joined: 16 Nov 2006
Posts: 1015
Location: Kyiv, Ukraine

PostPosted: Tue Mar 20, 2018 10:48 am    Post subject: Re: SetClipboardText not respect carriage return Reply with quote

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.
Back to top
View user's profile Send private message
Instructor
Site Admin


Joined: 06 Jul 2006
Posts: 6250

PostPosted: Fri Mar 30, 2018 11:11 pm    Post subject: Reply with quote

Diamen
AkelPad.GetSelText(3 /*\r\n*/)
Back to top
View user's profile Send private message Send e-mail
Diamen



Joined: 15 Aug 2008
Posts: 61

PostPosted: Sat Mar 31, 2018 5:33 am    Post subject: Reply with quote

Instructor
It fix, ty.

Do exist a same option for copy from menu and context menu?
Back to top
View user's profile Send private message
Instructor
Site Admin


Joined: 06 Jul 2006
Posts: 6250

PostPosted: Sat Mar 31, 2018 3:11 pm    Post subject: Reply with quote

Diamen
Now only as script: CopyAsRN.js

Code:
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.
Back to top
View user's profile Send private message Send e-mail
Diamen



Joined: 15 Aug 2008
Posts: 61

PostPosted: Mon Apr 02, 2018 12:05 pm    Post subject: Reply with quote

Do you can share the x64 test version?
Back to top
View user's profile Send private message
Skif_off



Joined: 20 Oct 2013
Posts: 1115

PostPosted: Mon Apr 02, 2018 2:32 pm    Post subject: Reply with quote

Diamen
AkelPad.zip & AkelPad-x64.zip
Back to top
View user's profile Send private message
KDJ



Joined: 06 Mar 2010
Posts: 1932
Location: Poland

PostPosted: Mon Apr 02, 2018 2:52 pm    Post subject: Reply with quote

But these test versions are dated 03 November 2017.
Back to top
View user's profile Send private message
Instructor
Site Admin


Joined: 06 Jul 2006
Posts: 6250

PostPosted: Mon Apr 02, 2018 3:34 pm    Post subject: Reply with quote

KDJ
Forgot to upload Smile Done.
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic   Reply to topic    AkelPad Forum Index -> Plugins All times are GMT
Goto page Previous  1, 2, 3 ... 69, 70, 71
Page 71 of 71

 
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