Git Product home page Git Product logo

akelpad_scripts's People

Contributors

infocatcher avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

akelpad_scripts's Issues

[toggleComments.js] supporting Lua and Powershell comments

To add Lua and Powershell support, the following modification is suggested:

Before (original code, line 108):

au3: [ ["#comments-start", "#cs"], ["#comments-end", "#ce"], [";"] ]

After (updated code):

au3: [ ["#comments-start", "#cs"], ["#comments-end", "#ce"], [";"] ],
lua: [ ["--[["], ["]]"], ["--"] ],
ps1: [ ["<#"], ["#>"], ["#"] ]

[toggleComments.js] fails on the lines that contain semicolon in the middle

Example:

0   "^\s*(((Try)|(Else))(?:\s*,\s*|\s+)|(.{0,38}(?=::))(?:::))?\s*(#IfWinActive)((?:\s*,\s*|\s+)([^;,]*?))?(\s+;.*$)?(\s*,\s*([^;,]+?))?(\s+;.*)?$" `\3=(4,${OP},0) \4=(4,${IF},0) \5=(2,${STR},0) \6=(0,${OP},0) \9=(0,${ATTR},0) \10=(3,${COMM},0)`

The bug is sensitive to caret's position: if you place it at the end: 3 first script calls will just remove one semicolon each from the line, and only on 4th call the line will get commented, but with 3 lost semicolons that were initially present.
The bug doesn't happen with the above example, if caret is placed anywhere before the first semicolon.

Баг чувствителен к позиции каретки: если каретку расположить в конце строки, то первые 3 вызова скрипта - удалят по одной точке с запятой каждый. И только на 4-ый вызов - строка закомментируется, но с тремя потерянными ";", которые изначально в ней присутствовали.
Бага с вышеприведённым примером не произойдёт, если расположить каретку до первой точки с запятой.

[autoSaveSession.js] [wine] The script fails to work

The script fails to work in a wine environment under FreeBSD:

Is there anything can be done about it?

Imported libs:
msls31 (MS Line Services)
riched20 (MS RichEdit Control 2.0 (riched.dll)
riched30 (MS RichEdit Control 3.0 (riched.dll, msls31.dll)
richtx32 (MS Rich TextBox Control 6.0)
wsh56vb (MS Windows Script Host 5.6, VBScript only, no CScript)
wsh57 (MS Windows Script Host 5.7)

Or the list of files:
cscript.exe
jscript.dll
riched20.dll
scrrun.dll
vbscript.dll
wscript.dll

jsBeautifier.js: new versions doesn't work correctly with WSH/JScript (not passes internal tests)

Updated version: https://github.com/Infocatcher/AkelPad_scripts/blob/jsBeautifier_new/jsBeautifier.js
Changes: https://github.com/Infocatcher/AkelPad_scripts/commits/jsBeautifier_new

Merged with master branch: 532e193

Tests:

==== Old tests ============================================================
---- input -------
#!
---- expected ----
#!
---- output ------
#!

---- expected-ws ------
#!
---- output-ws ------
#!\n

================================================================

==== Old tests ============================================================
---- input -------
#include
---- expected ----
#include
---- output ------
#include

---- expected-ws ------
#include
---- output-ws ------
#include\n

================================================================

==== Old tests ============================================================
---- input -------
#include "settings.jsxinc"
---- expected ----
#include "settings.jsxinc"
---- output ------
#include "settings.jsxinc"

---- expected-ws ------
#include_"settings.jsxinc"
---- output-ws ------
#include_"settings.jsxinc"\n

================================================================

==== Tests for script and style Commented and cdata wapping (#1641) ============================================================
---- input -------
<style><!----></style>
---- expected ----
<style>
    <!--
    -->
</style>
---- output ------
<style>
    < !---->
</style>
---- expected-ws ------
<style>\n
____<!--\n
____-->\n
</style>
---- output-ws ------
<style>\n
____<_!---->\n
</style>
================================================================

==== Tests for script and style Commented and cdata wapping (#1641) ============================================================
---- input -------
<style><!--
--></style>
---- expected ----
<style>
    <!--
    -->
</style>
---- output ------
<style>
    < !-- -->
</style>
---- expected-ws ------
<style>\n
____<!--\n
____-->\n
</style>
---- output-ws ------
<style>\n
____<_!--_-->\n
</style>
================================================================

==== Tests for script and style Commented and cdata wapping (#1641) ============================================================
---- input -------
<style><!-- the rest of this   line is   ignored



--></style>
---- expected ----
<style>
    <!-- the rest of this   line is   ignored
    -->
</style>
---- output ------
<style>
    < !-- the rest of this line is ignored -->
</style>
---- expected-ws ------
<style>\n
____<!--_the_rest_of_this___line_is___ignored\n
____-->\n
</style>
---- output-ws ------
<style>\n
____<_!--_the_rest_of_this_line_is_ignored_-->\n
</style>
================================================================

==== Tests for script and style Commented and cdata wapping (#1641) ============================================================
---- input -------
<style type="test/null"><!--

	  

--></style>
---- expected ----
<style type="test/null">
    <!--
    -->
</style>
---- output ------
<style type="test/null">
    <!--
    
    	  
    
    -->
</style>
---- expected-ws ------
<style_type="test/null">\n
____<!--\n
____-->\n
</style>
---- output-ws ------
<style_type="test/null">\n
____<!--\n
____\n
____===|__\n
____\n
____-->\n
</style>
================================================================

==== Tests for script and style Commented and cdata wapping (#1641) ============================================================
---- input -------
<div>
<script><!--
console.log("</script>" + "</style>");
 </script>
</div>
---- expected ----
<div>
    <script><!--
console.log("</script>" + "</style>");
 </script>
</div>
---- output ------
<div>
    <script>
        <!--
        console.log("</script>" + "</style>"); <
        /script> <
        /div>
---- expected-ws ------
<div>\n
____<script><!--\n
console.log("</script>"_+_"</style>");\n
_</script>\n
</div>
---- output-ws ------
<div>\n
____<script>\n
________<!--\n
________console.log("</script>"_+_"</style>");_<\n
________/script>_<\n
________/div>
================================================================

==== Tests for script and style Commented and cdata wapping (#1641) ============================================================
---- input -------
<style><!--
.selector {
    font-family: "</script></style>";
    }
--></style>
---- expected ----
<style>
    <!--
    .selector {
        font-family: "</script></style>";
    }
    -->
</style>
---- output ------
<style>
    < !-- .selector {
        font-family: "</script></style>";
    }

    -->
</style>
---- expected-ws ------
<style>\n
____<!--\n
____.selector_{\n
________font-family:_"</script></style>";\n
____}\n
____-->\n
</style>
---- output-ws ------
<style>\n
____<_!--_.selector_{\n
________font-family:_"</script></style>";\n
____}\n
\n
____-->\n
</style>
================================================================

==== Tests for script and style Commented and cdata wapping (#1641) ============================================================
---- input -------
<script type="test/null">
    <!--
   console.log("</script>" + "</style>");
    console.log("</script>" + "</style>");
--></script>
---- expected ----
<script type="test/null">
    <!--
    console.log("</script>" + "</style>");
     console.log("</script>" + "</style>");
    -->
</script>
---- output ------
<script type="test/null">
    <!--
       console.log("</script>" + "</style>");
    console.log("</script>" + "</style>");
    -->
</script>
---- expected-ws ------
<script_type="test/null">\n
____<!--\n
____console.log("</script>"_+_"</style>");\n
_____console.log("</script>"_+_"</style>");\n
____-->\n
</script>
---- output-ws ------
<script_type="test/null">\n
____<!--\n
_______console.log("</script>"_+_"</style>");\n
____console.log("</script>"_+_"</style>");\n
____-->\n
</script>
================================================================

==== Tests for script and style Commented and cdata wapping (#1641) ============================================================
---- input -------
<script type="test/null"><!--
 console.log("</script>" + "</style>");
      console.log("</script>" + "</style>");
--></script>
---- expected ----
<script type="test/null">
    <!--
    console.log("</script>" + "</style>");
         console.log("</script>" + "</style>");
    -->
</script>
---- output ------
<script type="test/null">
    <!--
     console.log("</script>" + "</style>");
          console.log("</script>" + "</style>");
    -->
</script>
---- expected-ws ------
<script_type="test/null">\n
____<!--\n
____console.log("</script>"_+_"</style>");\n
_________console.log("</script>"_+_"</style>");\n
____-->\n
</script>
---- output-ws ------
<script_type="test/null">\n
____<!--\n
_____console.log("</script>"_+_"</style>");\n
__________console.log("</script>"_+_"</style>");\n
____-->\n
</script>
================================================================

==== Tests for script and style Commented and cdata wapping (#1641) ============================================================
---- input -------
<script><![CDATA[
console.log("</script>" + "</style>");
]]></script>
---- expected ----
<script>
    <![CDATA[
    console.log("</script>" + "</style>");
    ]]>
</script>
---- output ------
<script>
    < ![CDATA[
        console.log("</script>" + "</style>");
    ]] >
</script>
---- expected-ws ------
<script>\n
____<![CDATA[\n
____console.log("</script>"_+_"</style>");\n
____]]>\n
</script>
---- output-ws ------
<script>\n
____<_![CDATA[\n
________console.log("</script>"_+_"</style>");\n
____]]_>\n
</script>
================================================================

==== Tests for script and style Commented and cdata wapping (#1641) ============================================================
---- input -------
<style><![CDATA[
.selector {
    font-family: "</script></style>";
    }
]]></style>
---- expected ----
<style>
    <![CDATA[
    .selector {
        font-family: "</script></style>";
    }
    ]]>
</style>
---- output ------
<style>
    < ![CDATA[ .selector {
        font-family: "</script></style>";
    }

    ]]>
</style>
---- expected-ws ------
<style>\n
____<![CDATA[\n
____.selector_{\n
________font-family:_"</script></style>";\n
____}\n
____]]>\n
</style>
---- output-ws ------
<style>\n
____<_![CDATA[_.selector_{\n
________font-family:_"</script></style>";\n
____}\n
\n
____]]>\n
</style>
================================================================

==== Tests for script and style Commented and cdata wapping (#1641) ============================================================
---- input -------
<script type="test/null">
    <![CDATA[
   console.log("</script>" + "</style>");
    console.log("</script>" + "</style>");
]]></script>
---- expected ----
<script type="test/null">
    <![CDATA[
    console.log("</script>" + "</style>");
     console.log("</script>" + "</style>");
    ]]>
</script>
---- output ------
<script type="test/null">
    <![CDATA[
       console.log("</script>" + "</style>");
    console.log("</script>" + "</style>");
    ]]>
</script>
---- expected-ws ------
<script_type="test/null">\n
____<![CDATA[\n
____console.log("</script>"_+_"</style>");\n
_____console.log("</script>"_+_"</style>");\n
____]]>\n
</script>
---- output-ws ------
<script_type="test/null">\n
____<![CDATA[\n
_______console.log("</script>"_+_"</style>");\n
____console.log("</script>"_+_"</style>");\n
____]]>\n
</script>
================================================================

==== Tests for script and style Commented and cdata wapping (#1641) ============================================================
---- input -------
<script type="test/null"><![CDATA[
 console.log("</script>" + "</style>");
      console.log("</script>" + "</style>");
]]></script>
---- expected ----
<script type="test/null">
    <![CDATA[
    console.log("</script>" + "</style>");
         console.log("</script>" + "</style>");
    ]]>
</script>
---- output ------
<script type="test/null">
    <![CDATA[
     console.log("</script>" + "</style>");
          console.log("</script>" + "</style>");
    ]]>
</script>
---- expected-ws ------
<script_type="test/null">\n
____<![CDATA[\n
____console.log("</script>"_+_"</style>");\n
_________console.log("</script>"_+_"</style>");\n
____]]>\n
</script>
---- output-ws ------
<script_type="test/null">\n
____<![CDATA[\n
_____console.log("</script>"_+_"</style>");\n
__________console.log("</script>"_+_"</style>");\n
____]]>\n
</script>
================================================================

==== unformatted_content_delimiter ^^ ============================================================
---- input -------
<span>0 0001 0002 0003 0004 0005 0006 0007 0008 ^^09 0010 0011 0012 0013 0014 0015 ^^16 0017 0018 0019 0020</span>
---- expected ----
<span>0 0001 0002 0003 0004 0005 0006 0007 0008
    ^^09 0010 0011 0012 0013 0014 0015 ^^16 0017 0018 0019 0020</span>
---- output ------
<span>0 0001 0002 0003 0004 0005 0006 0007 0008 ^^09 0010 0011 0012 0013 0014
    0015 ^^16 0017 0018 0019 0020</span>
---- expected-ws ------
<span>0_0001_0002_0003_0004_0005_0006_0007_0008\n
____^^09_0010_0011_0012_0013_0014_0015_^^16_0017_0018_0019_0020</span>
---- output-ws ------
<span>0_0001_0002_0003_0004_0005_0006_0007_0008_^^09_0010_0011_0012_0013_0014\n
____0015_^^16_0017_0018_0019_0020</span>
================================================================

==== unformatted_content_delimiter ^^ ============================================================
---- input -------
<span>0   0001   0002   0003   0004   0005   0006   0007   0008   0009   ^^10   0011   0012   0013   0014   0015   0016   0^^7   0018   0019   0020</span>
---- expected ----
<span>0 0001 0002 0003 0004 0005 0006 0007 0008 0009
    ^^10   0011   0012   0013   0014   0015   0016   0^^7 0018 0019 0020</span>
---- output ------
<span>0 0001 0002 0003 0004 0005 0006 0007 0008 0009 ^^10 0011 0012 0013 0014
    0015 0016 0^^7 0018 0019 0020</span>
---- expected-ws ------
<span>0_0001_0002_0003_0004_0005_0006_0007_0008_0009\n
____^^10___0011___0012___0013___0014___0015___0016___0^^7_0018_0019_0020</span>
---- output-ws ------
<span>0_0001_0002_0003_0004_0005_0006_0007_0008_0009_^^10_0011_0012_0013_0014\n
____0015_0016_0^^7_0018_0019_0020</span>
================================================================

17 tests failed.

[meta, x64] Use _PtrAdd() to calculate memory offsets

Example from SearchReplace.js:

function RectToArray(lpRect, rcRect)
{
  rcRect.left=AkelPad.MemRead(_PtrAdd(lpRect, 0) /*offsetof(RECT, left)*/, 3 /*DT_DWORD*/);
  rcRect.top=AkelPad.MemRead(_PtrAdd(lpRect, 4) /*offsetof(RECT, top)*/, 3 /*DT_DWORD*/);
  rcRect.right=AkelPad.MemRead(_PtrAdd(lpRect, 8) /*offsetof(RECT, right)*/, 3 /*DT_DWORD*/);
  rcRect.bottom=AkelPad.MemRead(_PtrAdd(lpRect, 12) /*offsetof(RECT, bottom)*/, 3 /*DT_DWORD*/);
  return rcRect;
}

[winMergeTabs.js] Error in the file path

Наверное, можно по-русски?
Пропущена буква r в \WinMege, 63 строка:
"%ProgramFiles%\WinMege\WinMergeU.exe",
Скрипт не нашел путь, как раз там программа и установлена.
А так всё работает. Отличное решение.
Большое спасибо.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.