Added all files in the installer to maybe help others.
|
@ -0,0 +1,578 @@
|
||||||
|
;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
; File: LuaForWindows.iss
|
||||||
|
; Author: Ryan Pusztai <rpusztai@gmail.com>
|
||||||
|
; Date: 05/13/2008
|
||||||
|
; License:
|
||||||
|
; Copyright (C) 2008-2012 Ryan Pusztai.
|
||||||
|
;
|
||||||
|
; Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
|
; of this software and associated documentation files (the "Software"), to deal
|
||||||
|
; in the Software without restriction, including without limitation the rights
|
||||||
|
; to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||||
|
; copies of the Software, and to permit persons to whom the Software is
|
||||||
|
; furnished to do so, subject to the following conditions:
|
||||||
|
;
|
||||||
|
; The above copyright notice and this permission notice shall be included in
|
||||||
|
; all copies or substantial portions of the Software.
|
||||||
|
;
|
||||||
|
; THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
; IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
; FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
|
; AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
|
; LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
|
; OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||||
|
; THE SOFTWARE.
|
||||||
|
;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
|
; -- General Installer configuration
|
||||||
|
#define MyAppVer "5.1.4.46"
|
||||||
|
#define MyAppDisplayVer "5.1.4-46"
|
||||||
|
#define MyAppName "Lua"
|
||||||
|
#define MyAppDisplayName "Lua for Windows"
|
||||||
|
#define MyAppPublisher "The Lua for Windows Project and Lua and Tecgraf, PUC-Rio"
|
||||||
|
#define MyAppURL "http://luaforwindows.googlecode.com"
|
||||||
|
#define MyAppExeName "lua.exe"
|
||||||
|
#define AppMinVer "5.1.3.21"
|
||||||
|
|
||||||
|
; -- Dependancy handling configuration
|
||||||
|
; Comment out the #define DOWNLOAD_FILES if you want to build the
|
||||||
|
; dependencies into the installer.
|
||||||
|
#define DOWNLOAD_FILES
|
||||||
|
#define vcRedistURL "http://luaforwindows.googlecode.com/files/vcredist_x86.4053.exe"
|
||||||
|
|
||||||
|
; -- Pre-Build Step.
|
||||||
|
;#expr Exec( "create_install_files_pkg.bat", NULL, ".", 1, SW_SHOWMINIMIZED )
|
||||||
|
|
||||||
|
[Setup]
|
||||||
|
AppName={#MyAppName}
|
||||||
|
AppVerName={#MyAppDisplayName} {#MyAppDisplayVer}
|
||||||
|
AppPublisher={#MyAppPublisher}
|
||||||
|
AppPublisherURL={#MyAppURL}
|
||||||
|
AppSupportURL={#MyAppURL}
|
||||||
|
AppUpdatesURL={#MyAppURL}
|
||||||
|
DefaultDirName={pf}\{#MyAppName}\5.1
|
||||||
|
DisableDirPage=false
|
||||||
|
DefaultGroupName={#MyAppName}
|
||||||
|
DisableProgramGroupPage=false
|
||||||
|
AllowNoIcons=true
|
||||||
|
OutputBaseFilename=LuaForWindows_v{#MyAppDisplayVer}
|
||||||
|
Compression=lzma/ultra
|
||||||
|
SolidCompression=true
|
||||||
|
InternalCompressLevel=ultra
|
||||||
|
OutputDir=.
|
||||||
|
ShowLanguageDialog=yes
|
||||||
|
AppVersion={#MyAppVer}
|
||||||
|
WizardImageFile=compiler:WizModernImage-IS.bmp
|
||||||
|
WizardSmallImageFile=compiler:WizModernSmallImage-IS.bmp
|
||||||
|
VersionInfoVersion={#MyAppVer}
|
||||||
|
VersionInfoDescription={#MyAppName}
|
||||||
|
ChangesAssociations=true
|
||||||
|
ChangesEnvironment=true
|
||||||
|
LicenseFile=files/LICENSE.txt
|
||||||
|
MinVersion=0,5.0.2195
|
||||||
|
PrivilegesRequired=none
|
||||||
|
UninstallFilesDir={app}\uninstall
|
||||||
|
UninstallDisplayIcon={app}\lua.exe
|
||||||
|
|
||||||
|
[Messages]
|
||||||
|
BeveledLabel={#MyAppDisplayName} v{#MyAppDisplayVer}
|
||||||
|
|
||||||
|
[Tasks]
|
||||||
|
Name: desktopicon; Description: {cm:CreateDesktopIcon}; GroupDescription: {cm:AdditionalIcons}; Flags: unchecked
|
||||||
|
Name: blackscheme; Description: Use a black background syntax highlight theme for script editor; GroupDescription: Additional schemes:; Flags: unchecked
|
||||||
|
|
||||||
|
[Files]
|
||||||
|
; -- Main Lua files.
|
||||||
|
Source: files\bin2c5.1.exe; DestDir: {app}; DestName: bin2c.exe; Flags: ignoreversion
|
||||||
|
Source: files\LICENSE.txt; DestDir: {app}; Flags: ignoreversion
|
||||||
|
Source: files\lua5.1.dll; DestDir: {app}; Flags: ignoreversion
|
||||||
|
Source: files\lua5.1.exe; DestDir: {app}; DestName: lua.exe; Flags: ignoreversion
|
||||||
|
Source: files\lua51.dll; DestDir: {app}; Flags: ignoreversion
|
||||||
|
Source: files\luac5.1.exe; DestDir: {app}; DestName: luac.exe; Flags: ignoreversion
|
||||||
|
Source: files\wlua5.1.exe; DestDir: {app}; DestName: wlua.exe; Flags: ignoreversion
|
||||||
|
Source: files\metalua.bat; DestDir: {app}; Flags: ignoreversion
|
||||||
|
Source: files\luadoc_start.bat; DestDir: {app}; Flags: ignoreversion
|
||||||
|
Source: files\lExecutor.wlua; DestDir: {app}; Flags: ignoreversion
|
||||||
|
Source: files\ilua.cmd; DestDir: {app}; Flags: ignoreversion
|
||||||
|
; -- LuaRocks files
|
||||||
|
Source: files\luarocks.bat; DestDir: {app}; Flags: ignoreversion; Components: luarocks
|
||||||
|
Source: files\luarocks-admin.bat; DestDir: {app}; Flags: ignoreversion; Components: luarocks
|
||||||
|
Source: files\7z.dll; DestDir: {app}; Flags: ignoreversion; Components: luarocks
|
||||||
|
Source: files\7z.exe; DestDir: {app}; Flags: ignoreversion; Components: luarocks
|
||||||
|
Source: files\luarocks.lua; DestDir: {app}; Flags: ignoreversion; Components: luarocks
|
||||||
|
Source: files\luarocks_config.lua; DestDir: {app}; Flags: ignoreversion; Components: luarocks
|
||||||
|
Source: files\luarocks-admin.lua; DestDir: {app}; Flags: ignoreversion; Components: luarocks
|
||||||
|
Source: files\rclauncher.o; DestDir: {app}; Flags: ignoreversion; Components: luarocks
|
||||||
|
Source: files\rclauncher.obj; DestDir: {app}; Flags: ignoreversion; Components: luarocks
|
||||||
|
Source: files\rocks\*; DestDir: {app}\rocks; Flags: ignoreversion recursesubdirs createallsubdirs; Excludes: .svn\; Components: luarocks
|
||||||
|
Source: files\lua\luarocks\*; DestDir: {app}\lua\luarocks; Flags: ignoreversion recursesubdirs createallsubdirs; Excludes: .svn\; Components: luarocks
|
||||||
|
; -- Other files and modules.
|
||||||
|
Source: files\clibs\*; DestDir: {app}\clibs; Flags: ignoreversion recursesubdirs createallsubdirs; Excludes: .svn\; Components: modules
|
||||||
|
Source: files\docs\*; DestDir: {app}\docs; Flags: ignoreversion recursesubdirs createallsubdirs; Excludes: .svn\; Components: docs
|
||||||
|
Source: files\examples\*; DestDir: {app}\examples; Flags: ignoreversion recursesubdirs createallsubdirs; Excludes: .svn\; Components: examples
|
||||||
|
Source: files\include\*; DestDir: {app}\include; Flags: ignoreversion recursesubdirs createallsubdirs; Excludes: .svn\; Components: moduledevel
|
||||||
|
Source: files\lib\*; DestDir: {app}\lib; Flags: ignoreversion recursesubdirs createallsubdirs; Excludes: .svn\; Components: moduledevel
|
||||||
|
Source: files\lua\*; DestDir: {app}\lua; Flags: ignoreversion recursesubdirs createallsubdirs; Excludes: .svn\, luarocks\*; Components: modules
|
||||||
|
Source: files\utils\*; DestDir: {app}\utils; Flags: ignoreversion recursesubdirs createallsubdirs; Excludes: .svn\; Components: modules
|
||||||
|
Source: support\Microsoft.VC80.CRT.SP1\*; DestDir: {app}\Microsoft.VC80.CRT; Flags: ignoreversion; Excludes: .svn\; Check: IsNonAdminLoggedOn
|
||||||
|
Source: support\Microsoft.VC80.CRT.SP1\*; DestDir: {app}\clibs\Microsoft.VC80.CRT; Flags: ignoreversion; Excludes: .svn\; Components: modules; Check: IsNonAdminLoggedOn
|
||||||
|
Source: support\Microsoft.VC80.CRT\*; DestDir: {app}\clibs\alien\Microsoft.VC80.CRT; Flags: ignoreversion; Excludes: .svn\; Components: modules; Check: IsNonAdminLoggedOn
|
||||||
|
Source: support\Microsoft.VC80.CRT.SP1\*; DestDir: {app}\clibs\md5\Microsoft.VC80.CRT; Flags: ignoreversion; Excludes: .svn\; Components: modules; Check: IsNonAdminLoggedOn
|
||||||
|
Source: support\Microsoft.VC80.CRT.SP1\*; DestDir: {app}\clibs\mime\Microsoft.VC80.CRT; Flags: ignoreversion; Excludes: .svn\; Components: modules; Check: IsNonAdminLoggedOn
|
||||||
|
Source: support\Microsoft.VC80.CRT.SP1\*; DestDir: {app}\clibs\socket\Microsoft.VC80.CRT; Flags: ignoreversion; Excludes: .svn\; Components: modules; Check: IsNonAdminLoggedOn
|
||||||
|
Source: support\*; DestDir: {app}\install\support; Flags: ignoreversion recursesubdirs createallsubdirs; Excludes: .svn\
|
||||||
|
#ifdef DOWNLOAD_FILES
|
||||||
|
Source: support\isxdl.dll; DestDir: {tmp}; Flags: dontcopy
|
||||||
|
Source: {src}\vcredist_x86.exe; DestDir: {app}\install\support; Flags: ignoreversion external; Check: ShouldCopyVc8Runtime
|
||||||
|
#else
|
||||||
|
Source: vcredist_x86.exe; DestDir: {app}\install\support; Flags: ignoreversion; Excludes: .svn\
|
||||||
|
#endif
|
||||||
|
Source: LuaForWindows.iss; DestDir: {app}\install; Flags: ignoreversion; Excludes: .svn\
|
||||||
|
Source: changes.txt; DestDir: {app}; Flags: ignoreversion; Excludes: .svn\
|
||||||
|
Source: todo.txt; DestDir: {app}; Flags: ignoreversion; Excludes: .svn\
|
||||||
|
|
||||||
|
; -- SciTE files
|
||||||
|
Source: SciTE\*; DestDir: {app}\SciTE; Flags: ignoreversion recursesubdirs createallsubdirs; Excludes: .svn\; Components: editors/scite
|
||||||
|
Source: support\SciTEGlobal.black.properties; DestDir: {app}\SciTE; DestName: SciTEGlobal.properties; Tasks: blackscheme; Components: editors/scite; Flags: ignoreversion
|
||||||
|
|
||||||
|
[InstallDelete]
|
||||||
|
Name: {app}\lua\pl; Type: filesandordirs
|
||||||
|
Name: {app}\docs\bitlib; Type: filesandordirs
|
||||||
|
Name: {app}\docs\penlight; Type: filesandordirs
|
||||||
|
Name: {app}\examples\bitlib; Type: filesandordirs
|
||||||
|
Name: {app}\examples\penlight; Type: filesandordirs
|
||||||
|
Name: {app}\examples\iup\tree_set_attrs.lua; Type: filesandordirs
|
||||||
|
; Cleanup the old file.
|
||||||
|
Name: {app}\install\Lua.iss; Type: files
|
||||||
|
|
||||||
|
[Icons]
|
||||||
|
Name: {group}\Lua (Command Line); WorkingDir: {app}; Filename: {app}\lua.exe; Components: main
|
||||||
|
Name: {group}\iLua (Friendly Lua Command Line); WorkingDir: {app}; Filename: {app}\ilua.cmd; Components: main
|
||||||
|
Name: {group}\lExecutor; WorkingDir: {app}; Filename: {app}\lExecutor.wlua; Components: main
|
||||||
|
Name: {group}\LuaForWindows Documentation; Filename: {app}\docs\luaforwindows.html; Components: main
|
||||||
|
Name: {group}\QuickLuaTour; Filename: {app}\Examples\quickluatour.lua; Components: examples
|
||||||
|
Name: {group}\{#MyAppName} Examples; Filename: {app}\Examples; Components: examples
|
||||||
|
Name: {group}\Documentation\{#MyAppName} Module Documentation; Filename: {app}\docs; Components: docs
|
||||||
|
Name: {group}\Documentation\Lua Quick Reference; Filename: {app}\docs\luarefv51.html; Components: docs
|
||||||
|
Name: {group}\Documentation\Lua 5.1 Reference Manual; Filename: {app}\docs\lua5_1_4_Docs.chm; Components: docs
|
||||||
|
Name: {group}\Documentation\lExecutor Documentation; Filename: {app}\docs\lexecutor\lExecutor.html; Components: docs
|
||||||
|
Name: {group}\{cm:UninstallProgram,{#MyAppName}}; Filename: {uninstallexe}
|
||||||
|
Name: {commondesktop}\{#MyAppName}; Filename: {app}\{#MyAppExeName}; Tasks: desktopicon
|
||||||
|
; -- SciTE icons.
|
||||||
|
Name: {group}\SciTE; Filename: {app}\SciTE\scite.exe; Components: editors/scite
|
||||||
|
Name: {commondesktop}\SciTE; Filename: {app}\SciTE\scite.exe; Tasks: desktopicon; Components: editors/scite
|
||||||
|
|
||||||
|
[Run]
|
||||||
|
Filename: {app}\Examples\quickluatour.lua; Description: Run a simple introduction to Lua.; WorkingDir: {app}; Flags: nowait postinstall skipifsilent unchecked shellexec; Components: examples
|
||||||
|
Filename: {app}/install/support/vcredist_x86.exe; Parameters: "/q:a /c:""VCREDI~3.EXE /q:a /c:""""msiexec /i vcredist.msi /qn"""" """; StatusMsg: Installing Microsoft Visual C++ 2005 SP1 Redistributable...; Check: ShouldInstallVc8Runtime
|
||||||
|
|
||||||
|
[INI]
|
||||||
|
Filename: {group}\Documentation\{#MyAppName} On The Web.url; Section: InternetShortcut; Key: URL; String: http://lua.org/
|
||||||
|
Filename: {group}\Documentation\Lua PiL Book.url; Section: InternetShortcut; Key: URL; String: http://www.lua.org/pil/; Components: docs
|
||||||
|
Filename: {app}\docs\Lua PiL Book.url; Section: InternetShortcut; Key: URL; String: http://www.lua.org/pil/; Components: docs
|
||||||
|
|
||||||
|
[UninstallDelete]
|
||||||
|
Type: files; Name: {app}\{#MyAppName}.url
|
||||||
|
Type: files; Name: {app}\docs\Lua PiL Book.url
|
||||||
|
Type: files; Name: {app}\docs\lua5_1_3_Docs.chm
|
||||||
|
Type: filesandordirs; Name: {group}
|
||||||
|
|
||||||
|
[Components]
|
||||||
|
Name: main; Description: Lua (required); Flags: fixed dontinheritcheck checkablealone; Types: full compact custom
|
||||||
|
Name: editors; Description: Script Editors; Flags: dontinheritcheck disablenouninstallwarning; Types: full custom
|
||||||
|
Name: editors/scite; Description: SciTE (IDE with debugging); Flags: disablenouninstallwarning exclusive; Types: full custom
|
||||||
|
Name: modules; Description: Lua Modules; Flags: dontinheritcheck checkablealone disablenouninstallwarning; Types: full custom
|
||||||
|
Name: luarocks; Description: LuaRocks Module Installer (Experimental); Flags: dontinheritcheck checkablealone disablenouninstallwarning; Types: full custom
|
||||||
|
Name: moduledevel; Description: Lua Module Development files (libs and headers); Flags: dontinheritcheck checkablealone disablenouninstallwarning; Types: full custom
|
||||||
|
Name: docs; Description: Documentation; Flags: dontinheritcheck checkablealone disablenouninstallwarning; Types: full custom
|
||||||
|
Name: examples; Description: Examples; Flags: dontinheritcheck checkablealone disablenouninstallwarning; Types: full custom
|
||||||
|
|
||||||
|
[Registry]
|
||||||
|
; -- Add the Lua file associations.
|
||||||
|
Root: HKCR; SubKey: .lua; ValueType: string; ValueData: {#MyAppName}.Script; Flags: uninsdeletekey; Check: IsAdminLoggedOn
|
||||||
|
Root: HKCR; SubKey: .lua\Content Type; ValueType: string; ValueData: text/plain; Flags: uninsdeletekey; Check: IsAdminLoggedOn
|
||||||
|
Root: HKCR; SubKey: .lua\PerceivedType; ValueType: string; ValueData: text; Flags: uninsdeletekey; Check: IsAdminLoggedOn
|
||||||
|
Root: HKCR; SubKey: {#MyAppName}.Script\DefaultIcon; ValueType: string; ValueData: {app}\install\support\luafile.ico; Flags: uninsdeletekey; Check: IsAdminLoggedOn
|
||||||
|
Root: HKCR; SubKey: {#MyAppName}.Script; ValueType: string; ValueData: {#MyAppName} Script File; Flags: uninsdeletekey; Check: IsAdminLoggedOn
|
||||||
|
Root: HKCR; SubKey: {#MyAppName}.Script\Shell\Open\Command; ValueType: string; ValueData: """{app}\{#MyAppExeName}"" ""%1"" %*"; Flags: uninsdeletevalue; Check: IsAdminLoggedOn
|
||||||
|
Root: HKCR; SubKey: {#MyAppName}.Script\Shell\Edit; ValueType: string; ValueData: Edit Script; Flags: uninsdeletevalue; Components: editors/scite; Check: IsAdminLoggedOn
|
||||||
|
Root: HKCR; SubKey: {#MyAppName}.Script\Shell\Edit\Command; ValueType: expandsz; ValueData: """{app}\SciTE\scite.exe"" ""%1"""; Flags: uninsdeletevalue; Components: editors/scite; Check: IsAdminLoggedOn
|
||||||
|
Root: HKCR; SubKey: .wlua; ValueType: string; ValueData: w{#MyAppName}.Script; Flags: uninsdeletekey; Check: IsAdminLoggedOn
|
||||||
|
Root: HKCR; SubKey: .wlua\Content Type; ValueType: string; ValueData: text/plain; Flags: uninsdeletekey; Check: IsAdminLoggedOn
|
||||||
|
Root: HKCR; SubKey: .wlua\PerceivedType; ValueType: string; ValueData: text; Flags: uninsdeletekey; Check: IsAdminLoggedOn
|
||||||
|
Root: HKCR; SubKey: w{#MyAppName}.Script\DefaultIcon; ValueType: string; ValueData: {app}\install\support\luafile.ico; Flags: uninsdeletekey; Check: IsAdminLoggedOn
|
||||||
|
Root: HKCR; SubKey: w{#MyAppName}.Script; ValueType: string; ValueData: w{#MyAppName} Script File; Flags: uninsdeletekey; Check: IsAdminLoggedOn
|
||||||
|
Root: HKCR; SubKey: w{#MyAppName}.Script\Shell\Open\Command; ValueType: string; ValueData: """{app}\w{#MyAppExeName}"" ""%1"" %*"; Flags: uninsdeletevalue; Check: IsAdminLoggedOn
|
||||||
|
Root: HKCR; SubKey: w{#MyAppName}.Script\Shell\Edit; ValueType: string; ValueData: Edit Script; Flags: uninsdeletevalue; Components: editors/scite; Check: IsAdminLoggedOn
|
||||||
|
Root: HKCR; SubKey: w{#MyAppName}.Script\Shell\Edit\Command; ValueType: expandsz; ValueData: """{app}\SciTE\scite.exe"" ""%1"""; Flags: uninsdeletevalue; Components: editors/scite; Check: IsAdminLoggedOn
|
||||||
|
Root: HKCR; SubKey: .lexe; ValueType: string; ValueData: lExecutor.Script; Flags: uninsdeletekey; Check: IsAdminLoggedOn
|
||||||
|
Root: HKCR; SubKey: .lexe\Content Type; ValueType: string; ValueData: text/plain; Flags: uninsdeletekey; Check: IsAdminLoggedOn
|
||||||
|
Root: HKCR; SubKey: .lexe\PerceivedType; ValueType: string; ValueData: text; Flags: uninsdeletekey; Check: IsAdminLoggedOn
|
||||||
|
Root: HKCR; SubKey: lExecutor.Script\DefaultIcon; ValueType: string; ValueData: {app}\install\support\lexe.ico; Flags: uninsdeletekey; Check: IsAdminLoggedOn
|
||||||
|
Root: HKCR; SubKey: lExecutor.Script; ValueType: string; ValueData: lExecutor Script File; Flags: uninsdeletekey; Check: IsAdminLoggedOn
|
||||||
|
Root: HKCR; SubKey: lExecutor.Script\Shell\Open\Command; ValueType: string; ValueData: """{app}\w{#MyAppExeName}"" ""{app}\lExecutor.wlua"" ""%1"" %*"; Flags: uninsdeletevalue; Check: IsAdminLoggedOn
|
||||||
|
Root: HKCR; SubKey: lExecutor.Script\Shell\Edit; ValueType: string; ValueData: Edit Script; Flags: uninsdeletevalue; Components: editors/scite; Check: IsAdminLoggedOn
|
||||||
|
Root: HKCR; SubKey: lExecutor.Script\Shell\Edit\Command; ValueType: expandsz; ValueData: """{app}\SciTE\scite.exe"" ""%1"""; Flags: uninsdeletevalue; Components: editors/scite; Check: IsAdminLoggedOn
|
||||||
|
;
|
||||||
|
Root: HKCR; SubKey: .luac; ValueType: string; ValueData: {#MyAppName}.Compiled; Flags: uninsdeletekey; Check: IsAdminLoggedOn
|
||||||
|
;Root: HKCR; SubKey: .luac\Content Type; ValueType: string; ValueData: text/plain; Flags: uninsdeletekey; Check: IsAdminLoggedOn
|
||||||
|
;Root: HKCR; SubKey: .luac\PerceivedType; ValueType: string; ValueData: text; Flags: uninsdeletekey; Check: IsAdminLoggedOn
|
||||||
|
Root: HKCR; SubKey: {#MyAppName}.Compiled\DefaultIcon; ValueType: string; ValueData: {app}\install\support\luafile3.ico; Flags: uninsdeletekey; Check: IsAdminLoggedOn
|
||||||
|
Root: HKCR; SubKey: {#MyAppName}.Compiled; ValueType: string; ValueData: {#MyAppName} Compiled File; Flags: uninsdeletekey; Check: IsAdminLoggedOn
|
||||||
|
Root: HKCR; SubKey: {#MyAppName}.Compiled\Shell\Open\Command; ValueType: string; ValueData: """{app}\{#MyAppExeName}"" ""%1"" %*"; Flags: uninsdeletevalue; Check: IsAdminLoggedOn
|
||||||
|
Root: HKCR; SubKey: .mlua; ValueType: string; ValueData: Meta{#MyAppName}.Script; Flags: uninsdeletekey; Check: IsAdminLoggedOn
|
||||||
|
Root: HKCR; SubKey: .mlua\Content Type; ValueType: string; ValueData: text/plain; Flags: uninsdeletekey; Check: IsAdminLoggedOn
|
||||||
|
Root: HKCR; SubKey: .mlua\PerceivedType; ValueType: string; ValueData: text; Flags: uninsdeletekey; Check: IsAdminLoggedOn
|
||||||
|
Root: HKCR; SubKey: Meta{#MyAppName}.Script\DefaultIcon; ValueType: string; ValueData: {app}\install\support\luafile2.ico; Flags: uninsdeletekey; Check: IsAdminLoggedOn
|
||||||
|
Root: HKCR; SubKey: Meta{#MyAppName}.Script; ValueType: string; ValueData: Meta{#MyAppName} Script File; Flags: uninsdeletekey; Check: IsAdminLoggedOn
|
||||||
|
Root: HKCR; SubKey: Meta{#MyAppName}.Script\Shell\Open\Command; ValueType: string; ValueData: """{app}\metalua.bat"" ""%1"" %*"; Flags: uninsdeletevalue; Check: IsAdminLoggedOn
|
||||||
|
Root: HKCR; SubKey: Meta{#MyAppName}.Script\Shell\Edit; ValueType: string; ValueData: Edit Script; Flags: uninsdeletevalue; Components: editors/scite; Check: IsAdminLoggedOn
|
||||||
|
Root: HKCR; SubKey: Meta{#MyAppName}.Script\Shell\Edit\Command; ValueType: expandsz; ValueData: """{app}\SciTE\scite.exe"" ""%1"""; Flags: uninsdeletevalue; Components: editors/scite; Check: IsAdminLoggedOn
|
||||||
|
|
||||||
|
; -- Limited user Lua file associations.
|
||||||
|
Root: HKCU; SubKey: SOFTWARE\Classes\.lua; ValueType: string; ValueData: {#MyAppName}.Script; Flags: uninsdeletekey; Check: IsNonAdminLoggedOn
|
||||||
|
Root: HKCU; SubKey: SOFTWARE\Classes\.lua\Content Type; ValueType: string; ValueData: text/plain; Flags: uninsdeletekey; Check: IsNonAdminLoggedOn
|
||||||
|
Root: HKCU; SubKey: SOFTWARE\Classes\.lua\PerceivedType; ValueType: string; ValueData: text; Flags: uninsdeletekey; Check: IsNonAdminLoggedOn
|
||||||
|
Root: HKCU; SubKey: SOFTWARE\Classes\{#MyAppName}.Script\DefaultIcon; ValueType: string; ValueData: {app}\install\support\luafile.ico; Flags: uninsdeletekey; Check: IsNonAdminLoggedOn
|
||||||
|
Root: HKCU; SubKey: SOFTWARE\Classes\{#MyAppName}.Script; ValueType: string; ValueData: {#MyAppName} Script File; Flags: uninsdeletekey; Check: IsNonAdminLoggedOn
|
||||||
|
Root: HKCU; SubKey: SOFTWARE\Classes\{#MyAppName}.Script\Shell\Open\Command; ValueType: string; ValueData: """{app}\{#MyAppExeName}"" ""%1"" %*"; Flags: uninsdeletevalue; Check: IsNonAdminLoggedOn
|
||||||
|
Root: HKCU; SubKey: SOFTWARE\Classes\{#MyAppName}.Script\Shell\Edit; ValueType: string; ValueData: Edit Script; Flags: uninsdeletevalue; Components: editors/scite; Check: IsNonAdminLoggedOn
|
||||||
|
Root: HKCU; SubKey: SOFTWARE\Classes\{#MyAppName}.Script\Shell\Edit\Command; ValueType: expandsz; ValueData: """{app}\SciTE\scite.exe"" ""%1"""; Flags: uninsdeletevalue; Components: editors/scite; Check: IsNonAdminLoggedOn
|
||||||
|
Root: HKCU; SubKey: SOFTWARE\Classes\.wlua; ValueType: string; ValueData: w{#MyAppName}.Script; Flags: uninsdeletekey; Check: IsNonAdminLoggedOn
|
||||||
|
Root: HKCU; SubKey: SOFTWARE\Classes\.wlua\Content Type; ValueType: string; ValueData: text/plain; Flags: uninsdeletekey; Check: IsNonAdminLoggedOn
|
||||||
|
Root: HKCU; SubKey: SOFTWARE\Classes\.wlua\PerceivedType; ValueType: string; ValueData: text; Flags: uninsdeletekey; Check: IsNonAdminLoggedOn
|
||||||
|
Root: HKCU; SubKey: SOFTWARE\Classes\w{#MyAppName}.Script\DefaultIcon; ValueType: string; ValueData: {app}\install\support\luafile.ico; Flags: uninsdeletekey; Check: IsNonAdminLoggedOn
|
||||||
|
Root: HKCU; SubKey: SOFTWARE\Classes\w{#MyAppName}.Script; ValueType: string; ValueData: w{#MyAppName} Script File; Flags: uninsdeletekey; Check: IsNonAdminLoggedOn
|
||||||
|
Root: HKCU; SubKey: SOFTWARE\Classes\w{#MyAppName}.Script\Shell\Open\Command; ValueType: string; ValueData: """{app}\w{#MyAppExeName}"" ""%1"" %*"; Flags: uninsdeletevalue; Check: IsNonAdminLoggedOn
|
||||||
|
Root: HKCU; SubKey: SOFTWARE\Classes\w{#MyAppName}.Script\Shell\Edit; ValueType: string; ValueData: Edit Script; Flags: uninsdeletevalue; Components: editors/scite; Check: IsNonAdminLoggedOn
|
||||||
|
Root: HKCU; SubKey: SOFTWARE\Classes\w{#MyAppName}.Script\Shell\Edit\Command; ValueType: expandsz; ValueData: """{app}\SciTE\scite.exe"" ""%1"""; Flags: uninsdeletevalue; Components: editors/scite; Check: IsNonAdminLoggedOn
|
||||||
|
Root: HKCU; SubKey: SOFTWARE\Classes\.lexe; ValueType: string; ValueData: lExecutor.Script; Flags: uninsdeletekey; Check: IsNonAdminLoggedOn
|
||||||
|
Root: HKCU; SubKey: SOFTWARE\Classes\.lexe\Content Type; ValueType: string; ValueData: text/plain; Flags: uninsdeletekey; Check: IsNonAdminLoggedOn
|
||||||
|
Root: HKCU; SubKey: SOFTWARE\Classes\.lexe\PerceivedType; ValueType: string; ValueData: text; Flags: uninsdeletekey; Check: IsNonAdminLoggedOn
|
||||||
|
Root: HKCU; SubKey: SOFTWARE\Classes\lExecutor.Script\DefaultIcon; ValueType: string; ValueData: {app}\install\support\lexe.ico; Flags: uninsdeletekey; Check: IsNonAdminLoggedOn
|
||||||
|
Root: HKCU; SubKey: SOFTWARE\Classes\lExecutor.Script; ValueType: string; ValueData: lExecutor Script File; Flags: uninsdeletekey; Check: IsNonAdminLoggedOn
|
||||||
|
Root: HKCU; SubKey: SOFTWARE\Classes\lExecutor.Script\Shell\Open\Command; ValueType: string; ValueData: """{app}\w{#MyAppExeName}"" ""{app}\lExecutor.wlua"" ""%1"" %*"; Flags: uninsdeletevalue; Check: IsNonAdminLoggedOn
|
||||||
|
Root: HKCU; SubKey: SOFTWARE\Classes\lExecutor.Script\Shell\Edit; ValueType: string; ValueData: Edit Script; Flags: uninsdeletevalue; Components: editors/scite; Check: IsNonAdminLoggedOn
|
||||||
|
Root: HKCU; SubKey: SOFTWARE\Classes\lExecutor.Script\Shell\Edit\Command; ValueType: expandsz; ValueData: """{app}\SciTE\scite.exe"" ""%1"""; Flags: uninsdeletevalue; Components: editors/scite; Check: IsNonAdminLoggedOn
|
||||||
|
Root: HKCU; SubKey: SOFTWARE\Classes\.luac; ValueType: string; ValueData: {#MyAppName}.Compiled; Flags: uninsdeletekey; Check: IsNonAdminLoggedOn
|
||||||
|
;Root: HKCU; SubKey: SOFTWARE\Classes\.luac\Content Type; ValueType: string; ValueData: text/plain; Flags: uninsdeletekey; Check: IsNonAdminLoggedOn
|
||||||
|
;Root: HKCU; SubKey: SOFTWARE\Classes\.luac\PerceivedType; ValueType: string; ValueData: text; Flags: uninsdeletekey; Check: IsNonAdminLoggedOn
|
||||||
|
Root: HKCU; SubKey: SOFTWARE\Classes\{#MyAppName}.Compiled\DefaultIcon; ValueType: string; ValueData: {app}\install\support\luafile3.ico; Flags: uninsdeletekey; Check: IsNonAdminLoggedOn
|
||||||
|
Root: HKCU; SubKey: SOFTWARE\Classes\{#MyAppName}.Compiled; ValueType: string; ValueData: {#MyAppName} Compiled File; Flags: uninsdeletekey; Check: IsNonAdminLoggedOn
|
||||||
|
Root: HKCU; SubKey: SOFTWARE\Classes\{#MyAppName}.Compiled\Shell\Open\Command; ValueType: string; ValueData: """{app}\{#MyAppExeName}"" ""%1"" %*"; Flags: uninsdeletevalue; Check: IsNonAdminLoggedOn
|
||||||
|
Root: HKCU; SubKey: SOFTWARE\Classes\.mlua; ValueType: string; ValueData: Meta{#MyAppName}.Script; Flags: uninsdeletekey; Check: IsNonAdminLoggedOn
|
||||||
|
Root: HKCU; SubKey: SOFTWARE\Classes\.mlua\Content Type; ValueType: string; ValueData: text/plain; Flags: uninsdeletekey; Check: IsNonAdminLoggedOn
|
||||||
|
Root: HKCU; SubKey: SOFTWARE\Classes\.mlua\PerceivedType; ValueType: string; ValueData: text; Flags: uninsdeletekey; Check: IsNonAdminLoggedOn
|
||||||
|
Root: HKCU; SubKey: SOFTWARE\Classes\Meta{#MyAppName}.Script\DefaultIcon; ValueType: string; ValueData: {app}\install\support\luafile2.ico; Flags: uninsdeletekey; Check: IsNonAdminLoggedOn
|
||||||
|
Root: HKCU; SubKey: SOFTWARE\Classes\Meta{#MyAppName}.Script; ValueType: string; ValueData: Meta{#MyAppName} Script File; Flags: uninsdeletekey; Check: IsNonAdminLoggedOn
|
||||||
|
Root: HKCU; SubKey: SOFTWARE\Classes\Meta{#MyAppName}.Script\Shell\Open\Command; ValueType: string; ValueData: """{app}\metalua.bat"" ""%1"" %*"; Flags: uninsdeletevalue; Check: IsNonAdminLoggedOn
|
||||||
|
Root: HKCU; SubKey: SOFTWARE\Classes\Meta{#MyAppName}.Script\Shell\Edit; ValueType: string; ValueData: Edit Script; Flags: uninsdeletevalue; Components: editors/scite; Check: IsNonAdminLoggedOn
|
||||||
|
Root: HKCU; SubKey: SOFTWARE\Classes\Meta{#MyAppName}.Script\Shell\Edit\Command; ValueType: expandsz; ValueData: """{app}\SciTE\scite.exe"" ""%1"""; Flags: uninsdeletevalue; Components: editors/scite; Check: IsNonAdminLoggedOn
|
||||||
|
|
||||||
|
[Code]
|
||||||
|
// -- Misc Functions
|
||||||
|
|
||||||
|
// -- Checks to see if a non-administrator is logged on.
|
||||||
|
function IsNonAdminLoggedOn(): boolean;
|
||||||
|
begin
|
||||||
|
if IsAdminLoggedOn() then begin
|
||||||
|
Result := false;
|
||||||
|
end else begin
|
||||||
|
Result := true;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
// -- Checks to see if the VC 8.0 run-time is installed.
|
||||||
|
function IsVc8RuntimeInstalled(): boolean;
|
||||||
|
begin
|
||||||
|
Result := RegValueExists( HKLM, 'Software\Microsoft\DevDiv\VC\Servicing\8.0\RED\1033', 'Install' );
|
||||||
|
end;
|
||||||
|
|
||||||
|
// -- Checks to see if the VC 8.0 run-time is already installed and determines if it should be installed.
|
||||||
|
function ShouldInstallVc8Runtime(): boolean;
|
||||||
|
begin
|
||||||
|
if IsVc8RuntimeInstalled() then begin
|
||||||
|
// Already installed so no need to re-install.
|
||||||
|
Result := false;
|
||||||
|
end else begin
|
||||||
|
if IsAdminLoggedOn() then begin
|
||||||
|
Result := true;
|
||||||
|
end else begin
|
||||||
|
SuppressibleMsgBox( 'The Microsoft Visual C++ 2005 Redistributable doesn''t appear to be installed and requires administrator privileges.' #13 #13 'Please run "vcredist_x86.exe", as an Administrator, from' #13 ' ' + ExpandConstant( '{app}\install\support\vcredist_x86.exe' ) + #13 'after the install finishes.' #13 #13 'NOTE: Lua will have limited or no functionality, so please do this as soon as possible.' , mbInformation, MB_OK, IDOK );
|
||||||
|
Result := false;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
// -- Checks to see if the VC 8.0 run-time needs to be copied
|
||||||
|
function ShouldCopyVc8Runtime(): boolean;
|
||||||
|
begin
|
||||||
|
Result := not IsVc8RuntimeInstalled();
|
||||||
|
end;
|
||||||
|
|
||||||
|
// -- Updates specified environment variable.
|
||||||
|
procedure UpdateEnvironmentVariable( const environmentVariable: String; const stringToAdd: String );
|
||||||
|
var
|
||||||
|
value: String;
|
||||||
|
newVal: String;
|
||||||
|
idx: Integer;
|
||||||
|
|
||||||
|
begin
|
||||||
|
// Get the old value so the new value can be appended.
|
||||||
|
// Also check if you have administrative rights so that we can read
|
||||||
|
// from the right location. This is because reads are ok on a non-admin system.
|
||||||
|
if IsAdminLoggedOn() then begin
|
||||||
|
RegQueryStringValue( HKLM, 'SYSTEM\CurrentControlSet\Control\Session Manager\Environment', environmentVariable, value )
|
||||||
|
end else begin
|
||||||
|
// Check if the local environment already exists and grab that as a starting place.
|
||||||
|
if RegValueExists( HKCU, 'Environment', environmentVariable ) then begin
|
||||||
|
RegQueryStringValue( HKCU, 'Environment', environmentVariable, value )
|
||||||
|
end else begin
|
||||||
|
if CompareText( environmentVariable, 'PATH' ) = 0 then begin
|
||||||
|
RegQueryStringValue( HKCU, 'Environment', environmentVariable, value )
|
||||||
|
end else begin
|
||||||
|
RegQueryStringValue( HKLM, 'SYSTEM\CurrentControlSet\Control\Session Manager\Environment', environmentVariable, value )
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
// Only add the ';' if there is a string already.
|
||||||
|
if Length( value ) > 0 then begin
|
||||||
|
newVal := ';' + stringToAdd;
|
||||||
|
end else begin
|
||||||
|
newVal := stringToAdd
|
||||||
|
end;
|
||||||
|
|
||||||
|
// Search for the string
|
||||||
|
idx := Pos( stringToAdd, value );
|
||||||
|
if idx = 0 then begin
|
||||||
|
value := value + newVal;
|
||||||
|
if not RegWriteStringValue( HKLM, 'SYSTEM\CurrentControlSet\Control\Session Manager\Environment', environmentVariable, value ) then
|
||||||
|
RegWriteStringValue( HKCU, 'Environment', environmentVariable, value );
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
// -- Updates specified environment variable.
|
||||||
|
procedure RemoveEnvironmentVariable( const environmentVariable: String; const stringToRemove: String );
|
||||||
|
var
|
||||||
|
value: String;
|
||||||
|
firstVal: String;
|
||||||
|
secondVal: String;
|
||||||
|
lastChar: String;
|
||||||
|
idx: Integer;
|
||||||
|
|
||||||
|
begin
|
||||||
|
// Get the old value so the new value can be appended.
|
||||||
|
// Also check if you have administrative rights so that we can read
|
||||||
|
// from the right location. This is because reads are ok on a non-admin system.
|
||||||
|
if IsAdminLoggedOn() then begin
|
||||||
|
RegQueryStringValue( HKLM, 'SYSTEM\CurrentControlSet\Control\Session Manager\Environment', environmentVariable, value )
|
||||||
|
end else begin
|
||||||
|
// Check if the local environment already exists and grab that as a starting place.
|
||||||
|
if RegValueExists( HKCU, 'Environment', environmentVariable ) then begin
|
||||||
|
RegQueryStringValue( HKCU, 'Environment', environmentVariable, value )
|
||||||
|
end else begin
|
||||||
|
if CompareText( environmentVariable, 'PATH' ) = 0 then begin
|
||||||
|
RegQueryStringValue( HKCU, 'Environment', environmentVariable, value )
|
||||||
|
end else begin
|
||||||
|
RegQueryStringValue( HKLM, 'SYSTEM\CurrentControlSet\Control\Session Manager\Environment', environmentVariable, value )
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
// Search for the string
|
||||||
|
idx := Pos( stringToRemove, value );
|
||||||
|
if idx > 0 then begin
|
||||||
|
// get the parts of the string.
|
||||||
|
firstVal := Copy( value, 0, idx - 1 );
|
||||||
|
secondVal := Copy( value, idx + Length( stringToRemove ), Length( value ) );
|
||||||
|
|
||||||
|
// Combine the first and second values to make the new value.
|
||||||
|
value := firstVal + secondVal;
|
||||||
|
|
||||||
|
// See if the value is now empty and delete it. Else write the balance back.
|
||||||
|
if Length( value ) = 0 then begin
|
||||||
|
if not RegDeleteValue( HKLM, 'SYSTEM\CurrentControlSet\Control\Session Manager\Environment', environmentVariable ) then
|
||||||
|
RegDeleteValue( HKCU, 'Environment', environmentVariable );
|
||||||
|
end else begin
|
||||||
|
// Clean up the string a bit by removing duplicate ;.
|
||||||
|
StringChangeEx( value, ';;', ';', True );
|
||||||
|
// Check the last character for a ; and remove it.
|
||||||
|
lastChar := Copy( value, Length( value ), Length( value ) );
|
||||||
|
if lastChar = ';' then
|
||||||
|
value := Copy( value, 0, Length( value ) - 1 );
|
||||||
|
|
||||||
|
// Write the new value back.
|
||||||
|
if not RegWriteStringValue( HKLM, 'SYSTEM\CurrentControlSet\Control\Session Manager\Environment', environmentVariable, value ) then
|
||||||
|
RegWriteStringValue( HKCU, 'Environment', environmentVariable, value );
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
// -- Previous version and uninstalling functions
|
||||||
|
function GetPathInstalled( AppID: String ): String;
|
||||||
|
var
|
||||||
|
sPrevPath: String;
|
||||||
|
begin
|
||||||
|
sPrevPath := '';
|
||||||
|
if not RegQueryStringValue( HKLM,
|
||||||
|
'Software\Microsoft\Windows\CurrentVersion\Uninstall\'+AppID+'_is1',
|
||||||
|
'Inno Setup: App Path', sPrevpath) then
|
||||||
|
RegQueryStringValue( HKCU, 'Software\Microsoft\Windows\CurrentVersion\Uninstall\'+AppID+'_is1' ,
|
||||||
|
'Inno Setup: App Path', sPrevpath);
|
||||||
|
|
||||||
|
Result := sPrevPath;
|
||||||
|
end;
|
||||||
|
|
||||||
|
function GetPathUninstallString( AppID: String ): String;
|
||||||
|
var
|
||||||
|
sPrevPath: String;
|
||||||
|
begin
|
||||||
|
sPrevPath := '';
|
||||||
|
if not RegQueryStringValue( HKLM,
|
||||||
|
'Software\Microsoft\Windows\CurrentVersion\Uninstall\'+AppID+'_is1',
|
||||||
|
'UninstallString', sPrevpath) then
|
||||||
|
RegQueryStringValue( HKCU, 'Software\Microsoft\Windows\CurrentVersion\Uninstall\'+AppID+'_is1' ,
|
||||||
|
'UninstallString', sPrevpath);
|
||||||
|
|
||||||
|
Result := sPrevPath;
|
||||||
|
end;
|
||||||
|
|
||||||
|
function GetInstalledVersion( AppID: String ): String;
|
||||||
|
var
|
||||||
|
sPrevPath: String;
|
||||||
|
|
||||||
|
begin
|
||||||
|
sPrevPath := '';
|
||||||
|
if not RegQueryStringValue( HKLM,
|
||||||
|
'Software\Microsoft\Windows\CurrentVersion\Uninstall\'+AppID+'_is1',
|
||||||
|
'DisplayVersion', sPrevpath) then
|
||||||
|
RegQueryStringValue( HKCU, 'Software\Microsoft\Windows\CurrentVersion\Uninstall\'+AppID+'_is1' ,
|
||||||
|
'DisplayVersion', sPrevpath);
|
||||||
|
|
||||||
|
Result := sPrevPath;
|
||||||
|
end;
|
||||||
|
|
||||||
|
function InitializeSetup(): boolean;
|
||||||
|
var
|
||||||
|
ResultCode: Integer;
|
||||||
|
sVersion: String;
|
||||||
|
sUninstallEXE: String;
|
||||||
|
|
||||||
|
begin
|
||||||
|
sVersion:= GetInstalledVersion('{#MyAppName}');
|
||||||
|
sUninstallEXE:= RemoveQuotes(GetPathUninstallString('{#MyAppName}'));
|
||||||
|
|
||||||
|
// Check to make sure there is an exceptable version of LfW installed.
|
||||||
|
if Length(sVersion) = 0 then begin
|
||||||
|
result:= true;
|
||||||
|
end else begin
|
||||||
|
//MsgBox( 'Version ' + sVersion + ' found. Minversion = ' + '{#AppMinVer}', mbInformation, MB_OK );
|
||||||
|
if CompareText( sVersion, '{#AppMinVer}' ) <= 0 then begin
|
||||||
|
if FileExists( sUninstallEXE ) then begin
|
||||||
|
if WizardSilent() then begin
|
||||||
|
// Just uninstall without asking because we are in silent mode.
|
||||||
|
Exec( sUninstallEXE, '/SILENT', GetPathInstalled('{#MyAppName}'),
|
||||||
|
SW_SHOWNORMAL, ewWaitUntilTerminated, ResultCode);
|
||||||
|
|
||||||
|
// Make sure that Setup is visible and the foreground window
|
||||||
|
BringToFrontAndRestore;
|
||||||
|
result := true;
|
||||||
|
end else begin
|
||||||
|
// Ask if they really want to uninstall because we are in the default installer.
|
||||||
|
if SuppressibleMsgBox( 'Version ' + sVersion + ' of {#MyAppName} was detected.' #13 'It is recommended that you uninstall the old version first before continuing.' + #13 + #13 + 'Would you like to uninstall it now?', mbInformation, MB_YESNO, IDYES ) = IDYES then begin
|
||||||
|
Exec( sUninstallEXE, '/SILENT', GetPathInstalled('{#MyAppName}'),
|
||||||
|
SW_SHOWNORMAL, ewWaitUntilTerminated, ResultCode);
|
||||||
|
|
||||||
|
// Make sure that Setup is visible and the foreground window
|
||||||
|
BringToFrontAndRestore;
|
||||||
|
result := true;
|
||||||
|
end else begin
|
||||||
|
result := true;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
end else begin
|
||||||
|
result := true;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure CurStepChanged( CurStep: TSetupStep );
|
||||||
|
begin
|
||||||
|
if CurStep = ssPostInstall then begin
|
||||||
|
// Add the app path to the PATH environment variable.
|
||||||
|
UpdateEnvironmentVariable( 'PATH', ExpandConstant( '{app}' ) );
|
||||||
|
UpdateEnvironmentVariable( 'PATH', ExpandConstant( '{app}' ) + '\clibs' );
|
||||||
|
// Add the file extentions to the PATHEXT environment variable.
|
||||||
|
//UpdateEnvironmentVariable( 'PATHEXT', '.lua' );
|
||||||
|
UpdateEnvironmentVariable( 'PATHEXT', '.wlua' );
|
||||||
|
UpdateEnvironmentVariable( 'PATHEXT', '.lexe' );
|
||||||
|
// Add the LUA_PATH and LUA_CPATH.
|
||||||
|
UpdateEnvironmentVariable( 'LUA_PATH', ';;' + ExpandConstant( '{app}' ) + '\lua\?.luac' )
|
||||||
|
//UpdateEnvironmentVariable( 'LUA_CPATH', ';;?.dll;' + ExpandConstant( '{app}' ) + '\clibs\?.dll;' + ExpandConstant( '{app}' ) + '\clibs\loadall.dll;' + ExpandConstant( '{app}' ) + '\clibs\?51.dll' )
|
||||||
|
// Add LUA_DEV to help C module writers.
|
||||||
|
UpdateEnvironmentVariable( 'LUA_DEV', ExpandConstant( '{app}' ) )
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure CurUninstallStepChanged( CurUninstallStep: TUninstallStep );
|
||||||
|
begin
|
||||||
|
if CurUninstallStep = usPostUninstall then begin
|
||||||
|
// Remove the app path to the PATH environment variable.
|
||||||
|
RemoveEnvironmentVariable( 'PATH', ExpandConstant( '{app}' ) );
|
||||||
|
RemoveEnvironmentVariable( 'PATH', ExpandConstant( '{app}' ) + '\clibs' );
|
||||||
|
// Remove the file extentions to the PATHEXT environment variable.
|
||||||
|
//RemoveEnvironmentVariable( 'PATHEXT', '.lua' );
|
||||||
|
RemoveEnvironmentVariable( 'PATHEXT', '.wlua' );
|
||||||
|
RemoveEnvironmentVariable( 'PATHEXT', '.lexe' );
|
||||||
|
// Remove the LUA_PATH and LUA_CPATH.
|
||||||
|
RemoveEnvironmentVariable( 'LUA_PATH', ';;' + ExpandConstant( '{app}' ) + '\lua\?.luac' )
|
||||||
|
//RemoveEnvironmentVariable( 'LUA_CPATH', ';;?.dll;' + ExpandConstant( '{app}' ) + '\clibs\?.dll;' + ExpandConstant( '{app}' ) + '\clibs\loadall.dll;' + ExpandConstant( '{app}' ) + '\clibs\?51.dll' )
|
||||||
|
// Remove the LUA_DEV variable.
|
||||||
|
RemoveEnvironmentVariable( 'LUA_DEV', ExpandConstant( '{app}' ) )
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
#ifdef DOWNLOAD_FILES
|
||||||
|
procedure isxdl_AddFile(URL, Filename: String);
|
||||||
|
external 'isxdl_AddFile@files:isxdl.dll stdcall';
|
||||||
|
function isxdl_DownloadFiles(hWnd: Integer): Integer;
|
||||||
|
external 'isxdl_DownloadFiles@files:isxdl.dll stdcall';
|
||||||
|
function isxdl_SetOption(Option, Value: String): Integer;
|
||||||
|
external 'isxdl_SetOption@files:isxdl.dll stdcall';
|
||||||
|
|
||||||
|
|
||||||
|
function NextButtonClick( CurPage: Integer ): Boolean;
|
||||||
|
var
|
||||||
|
hWnd: Integer;
|
||||||
|
downloadNeeded: Boolean;
|
||||||
|
vcRedistPath: String;
|
||||||
|
|
||||||
|
begin
|
||||||
|
downloadNeeded := false;
|
||||||
|
Result := true;
|
||||||
|
|
||||||
|
if CurPage = wpReady then begin
|
||||||
|
hWnd := StrToInt( ExpandConstant( '{wizardhwnd}' ) );
|
||||||
|
|
||||||
|
if not IsVc8RuntimeInstalled() then begin
|
||||||
|
vcRedistPath := ExpandConstant( '{src}\vcredist_x86.exe' );
|
||||||
|
if not FileExists( vcRedistPath ) then begin
|
||||||
|
isxdl_AddFile( '{#vcRedistURL}', vcRedistPath );
|
||||||
|
downloadNeeded := true;
|
||||||
|
end;
|
||||||
|
|
||||||
|
isxdl_SetOption( 'label', 'Downloading extra files' );
|
||||||
|
isxdl_SetOption( 'description', 'Please wait while Setup is downloading the Microsoft Visual C++ 2005 SP1 Redistributable to your computer.' );
|
||||||
|
if downloadNeeded then begin
|
||||||
|
if isxdl_DownloadFiles( hWnd ) = 0 then begin
|
||||||
|
Result := false;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,39 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
||||||
|
<assembly
|
||||||
|
xmlns="urn:schemas-microsoft-com:asm.v1"
|
||||||
|
manifestVersion="1.0">
|
||||||
|
<assemblyIdentity
|
||||||
|
processorArchitecture="x86"
|
||||||
|
version="5.1.0.0"
|
||||||
|
type="win32"
|
||||||
|
name="xplorer2"/>
|
||||||
|
<description>gScripted scripting interface to gtxDeviceComm</description>
|
||||||
|
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v3">
|
||||||
|
<security>
|
||||||
|
<requestedPrivileges>
|
||||||
|
<requestedExecutionLevel
|
||||||
|
level="asInvoker"
|
||||||
|
uiAccess="false"/>
|
||||||
|
</requestedPrivileges>
|
||||||
|
</security>
|
||||||
|
</trustInfo>
|
||||||
|
<dependency>
|
||||||
|
<dependentAssembly>
|
||||||
|
<assemblyIdentity
|
||||||
|
type="win32"
|
||||||
|
name="Microsoft.Windows.Common-Controls"
|
||||||
|
version="6.0.0.0"
|
||||||
|
publicKeyToken="6595b64144ccf1df"
|
||||||
|
language="*"
|
||||||
|
processorArchitecture="x86"/>
|
||||||
|
</dependentAssembly>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<dependentAssembly>
|
||||||
|
<assemblyIdentity type="win32" name="Microsoft.VC80.CRT"
|
||||||
|
version="8.0.50727.762" processorArchitecture="x86"
|
||||||
|
publicKeyToken="1fc8b3b9a1e18e3b"></assemblyIdentity>
|
||||||
|
</dependentAssembly>
|
||||||
|
</dependency>
|
||||||
|
</assembly>
|
||||||
|
|
|
@ -0,0 +1,623 @@
|
||||||
|
# Global initialisation file for SciTE
|
||||||
|
# Go to Help|Help on SciTE for a full list of available properties
|
||||||
|
|
||||||
|
# switch the comments if you want the dark blue or black theme
|
||||||
|
import default
|
||||||
|
#import darkblue
|
||||||
|
#import black
|
||||||
|
|
||||||
|
# switch the comments if you want a monospaced font.
|
||||||
|
font.base=font:Lucida Console,size:10
|
||||||
|
#font.base=font:Verdana,size:10
|
||||||
|
|
||||||
|
# set this to 0 if you prefer not to have the full path in SciTE's caption bar
|
||||||
|
title.full.path=1
|
||||||
|
# set this to 0 if you prefer not to have line numbers automatically (can always set with View|Line Numbers)
|
||||||
|
line.margin.visible=1
|
||||||
|
# set this to 0 if you prefer to explicitly complete words with Ctrl+Enter
|
||||||
|
autocompleteword.automatic=1
|
||||||
|
# set this to 0 if you prefer not to have the session (the files that were open when SciTE was closed)
|
||||||
|
# restored the next time you open SciTE
|
||||||
|
save.session=1
|
||||||
|
# make this 1 if you would like double-click to select strings or comments.
|
||||||
|
scite.double.click.select.string=0
|
||||||
|
# if you prefer that a debugged program immediately runs to a breakpoint, make this 1
|
||||||
|
debug.run.automatically=0
|
||||||
|
|
||||||
|
# switch the comments of the first two lines if you want a standard Lua 5.1 prompt (that is, not ilua)
|
||||||
|
lua.prompt=lua -i "$(SciteDefaultHome)\scite-debug\ilua.lua" -i
|
||||||
|
#lua.prompt=lua
|
||||||
|
#lua.prompt=lua "$(SciteDefaultHome)\scite-debug\ilua.lua"
|
||||||
|
|
||||||
|
# assuming SciTE is in a similar location to Lua (e.g. \Program Files\SciTE)....
|
||||||
|
lua.directory=$(SciteDefaultHome)\..
|
||||||
|
command.help.*.lua=Lua 5.1 Reference Manual!$(lua.directory)\docs\lua5_1_4_Docs.chm
|
||||||
|
command.help.subsystem.*.lua=4
|
||||||
|
command.help.*.wlua=Lua 5.1 Reference Manual!$(lua.directory)\docs\lua5_1_4_Docs.chm
|
||||||
|
command.help.subsystem.*.wlua=4
|
||||||
|
command.help.*.lexe=Lua 5.1 Reference Manual!$(lua.directory)\docs\lua5_1_4_Docs.chm
|
||||||
|
command.help.subsystem.*.lexe=4
|
||||||
|
|
||||||
|
|
||||||
|
command.overview.help="file://$(SciteDefaultHome)\docs\scite-intro.html"
|
||||||
|
command.overview.help.subsystem=2
|
||||||
|
|
||||||
|
# Globals
|
||||||
|
ext.lua.startup.script=$(SciteDefaultHome)\scite-debug\extman.lua
|
||||||
|
|
||||||
|
# User-configurable toolbar. Note that ||| means a separator!
|
||||||
|
# The format is <bitmap>|<command|<tooltip>|
|
||||||
|
# <bitmap>You can use the STD_* standard # Windows bitmaps,
|
||||||
|
# or you can supply a bitmap 'name', which will be found as 'name.bmp'
|
||||||
|
# in this directory. Bitmaps with transperancy are apparently not supported.
|
||||||
|
# <command> can be a SciTE menu command (IDM_*) (see CommandValues.html in docs)
|
||||||
|
# or a Lua command; format is lua;<save before>;<name of global Lua function>
|
||||||
|
# <tooltip> is what will appear when the mouse hovers over the icon.
|
||||||
|
user.toolbar=\
|
||||||
|
|||\
|
||||||
|
STD_FILENEW|IDM_NEW|New|\
|
||||||
|
STD_FILEOPEN|IDM_OPEN|Open|\
|
||||||
|
STD_FILESAVE|IDM_SAVE|Save|\
|
||||||
|
|||\
|
||||||
|
STD_PRINT|IDM_PRINT|Print|\
|
||||||
|
|||\
|
||||||
|
STD_CUT|IDM_CUT|Cut|\
|
||||||
|
STD_COPY|IDM_COPY|Copy|\
|
||||||
|
STD_PASTE|IDM_PASTE|Paste|\
|
||||||
|
|||\
|
||||||
|
STD_FIND|IDM_FIND|Find|\
|
||||||
|
STD_REPLACE|IDM_REPLACE|Replace|\
|
||||||
|
|||\
|
||||||
|
run|IDM_GO|Run Program|\
|
||||||
|
stop|IDM_STOPEXECUTE|Kill Program|\
|
||||||
|
terminal|lua;no;start_lua_prompt|Launch Interactive Lua|\
|
||||||
|
load|lua;yes;load_current_lua_file|Load Lua File into Interactive Session|\
|
||||||
|
|||\
|
||||||
|
debug|lua;yes;do_run|Debug Program/Continue|\
|
||||||
|
breakpoint|lua;no;do_breakpoint|Set Breakpoint|\
|
||||||
|
step|lua;no;do_step|Step|\
|
||||||
|
step_over|lua;no;do_next|Step Over|\
|
||||||
|
step_out|lua;no;do_finish|Step Out|\
|
||||||
|
watch|lua;no;do_watch|Watch Variable|\
|
||||||
|
inspect|lua;no;do_inspect|Inspect Variable|\
|
||||||
|
stack|lua;no;do_backtrace|Stack Trace|\
|
||||||
|
stopd|lua;no;do_kill|Stop Debugging|
|
||||||
|
|
||||||
|
user.context.menu=\
|
||||||
|
||\
|
||||||
|
Select Block|lua;no;block_select|\
|
||||||
|
Smart Paste|lua;no;smart_paste|
|
||||||
|
|
||||||
|
# Window sizes and visibility
|
||||||
|
if PLAT_WIN
|
||||||
|
position.left=75
|
||||||
|
position.top=75
|
||||||
|
if PLAT_GTK
|
||||||
|
position.left=5
|
||||||
|
position.top=22
|
||||||
|
position.width=750
|
||||||
|
position.height=740
|
||||||
|
#position.tile=1
|
||||||
|
#full.screen.hides.menu=1
|
||||||
|
#minimize.to.tray=1
|
||||||
|
split.vertical=0
|
||||||
|
#output.horizontal.size=200
|
||||||
|
#output.vertical.size=60
|
||||||
|
#output.initial.hide=1
|
||||||
|
#horizontal.scrollbar=0
|
||||||
|
#horizontal.scroll.width=10000
|
||||||
|
#output.horizontal.scrollbar=0
|
||||||
|
#output.horizontal.scroll.width=10000
|
||||||
|
#output.scroll=0
|
||||||
|
#error.select.line=1
|
||||||
|
#end.at.last.line=0
|
||||||
|
tabbar.visible=1
|
||||||
|
tabbar.hide.one=1
|
||||||
|
#tabbar.multiline=1
|
||||||
|
toolbar.visible=1
|
||||||
|
#toolbar.detachable=1
|
||||||
|
#toolbar.usestockicons=1
|
||||||
|
#menubar.detachable=1
|
||||||
|
#undo.redo.lazy=1
|
||||||
|
statusbar.visible=1
|
||||||
|
#fileselector.width=800
|
||||||
|
#fileselector.height=600
|
||||||
|
#magnification=-1
|
||||||
|
#output.magnification=-1
|
||||||
|
|
||||||
|
# Sizes and visibility in edit pane
|
||||||
|
line.margin.width=4
|
||||||
|
margin.width=16
|
||||||
|
#fold.margin.width=16
|
||||||
|
#fold.margin.colour=#FF0000
|
||||||
|
#fold.margin.highlight.colour=#0000FF
|
||||||
|
#blank.margin.left=4
|
||||||
|
#blank.margin.right=4
|
||||||
|
buffered.draw=1
|
||||||
|
#two.phase.draw=0
|
||||||
|
use.palette=0
|
||||||
|
|
||||||
|
# Element styles
|
||||||
|
#view.eol=1
|
||||||
|
#control.char.symbol=.
|
||||||
|
caret.period=500
|
||||||
|
view.whitespace=0
|
||||||
|
view.indentation.whitespace=1
|
||||||
|
view.indentation.guides=1
|
||||||
|
highlight.indentation.guides=1
|
||||||
|
#caret.fore=#FF0000
|
||||||
|
#caret.width=2
|
||||||
|
#caret.line.back=#FFFED8
|
||||||
|
#caret.line.back.alpha=63
|
||||||
|
edge.column=200
|
||||||
|
edge.mode=0
|
||||||
|
edge.colour=#C0DCC0
|
||||||
|
braces.check=1
|
||||||
|
braces.sloppy=1
|
||||||
|
#selection.fore=#006000
|
||||||
|
# DADADA used as background because it yields standard silver C0C0C0
|
||||||
|
# on low colour displays and a reasonable light grey on higher bit depths
|
||||||
|
#selection.alpha=30
|
||||||
|
#selection.back=#000000
|
||||||
|
#whitespace.fore=#FF0000
|
||||||
|
#whitespace.back=#FFF0F0
|
||||||
|
#error.marker.fore=#0000A0
|
||||||
|
#error.marker.back=#DADAFF
|
||||||
|
#bookmark.fore=#808000
|
||||||
|
#bookmark.back=#FFFFA0
|
||||||
|
#bookmark.alpha=
|
||||||
|
#find.mark=#0000FF
|
||||||
|
|
||||||
|
# Checking
|
||||||
|
are.you.sure=1
|
||||||
|
#are.you.sure.for.build=1
|
||||||
|
#save.all.for.build=1
|
||||||
|
#quit.on.close.last=1
|
||||||
|
#load.on.activate=1
|
||||||
|
#save.on.deactivate=1
|
||||||
|
are.you.sure.on.reload=1
|
||||||
|
reload.preserves.undo=1
|
||||||
|
check.if.already.open=1
|
||||||
|
default.file.ext=.lua
|
||||||
|
#source.default.extensions=.h|.cxx|.bat
|
||||||
|
|
||||||
|
#title.show.buffers=1
|
||||||
|
save.recent=1
|
||||||
|
session.bookmarks=1
|
||||||
|
session.folds=1
|
||||||
|
open.dialog.in.file.directory=1
|
||||||
|
strip.trailing.spaces=1
|
||||||
|
ensure.final.line.end=1
|
||||||
|
ensure.consistent.line.ends=1
|
||||||
|
#save.deletes.first=1
|
||||||
|
buffers=30
|
||||||
|
buffers.zorder.switching=1
|
||||||
|
#api.*.cxx=d:\api\w.api
|
||||||
|
#win95.death.delay=1000
|
||||||
|
#translation.missing=***
|
||||||
|
#read.only=1
|
||||||
|
#max.file.size=1
|
||||||
|
|
||||||
|
# Indentation
|
||||||
|
tabsize=4
|
||||||
|
indent.size=4
|
||||||
|
use.tabs=1
|
||||||
|
#indent.auto=1
|
||||||
|
indent.automatic=1
|
||||||
|
indent.opening=0
|
||||||
|
indent.closing=0
|
||||||
|
#tab.indents=0
|
||||||
|
#backspace.unindents=0
|
||||||
|
|
||||||
|
# Wrapping of long lines
|
||||||
|
#wrap=1
|
||||||
|
#wrap.style=2
|
||||||
|
#cache.layout=3
|
||||||
|
#output.wrap=1
|
||||||
|
#output.cache.layout=3
|
||||||
|
#wrap.visual.flags=3
|
||||||
|
#wrap.visual.flags.location=3
|
||||||
|
#wrap.visual.startindent=4
|
||||||
|
|
||||||
|
# Folding
|
||||||
|
# enable folding, and show lines below when collapsed.
|
||||||
|
fold=1
|
||||||
|
fold.compact=1
|
||||||
|
fold.flags=16
|
||||||
|
fold.symbols=1
|
||||||
|
#fold.on.open=1
|
||||||
|
fold.comment=1
|
||||||
|
fold.preprocessor=1
|
||||||
|
|
||||||
|
# Find and Replace
|
||||||
|
# Internal search always available with recursive capability so use in preference to external tool
|
||||||
|
find.command=
|
||||||
|
# findstr is available on recent versions of Windows including 2000
|
||||||
|
#if PLAT_WIN
|
||||||
|
# find.command=findstr /n /s $(find.what) $(find.files)
|
||||||
|
#find.input=$(find.what)
|
||||||
|
#if PLAT_GTK
|
||||||
|
# find.command=grep --line-number "$(find.what)" $(find.files)
|
||||||
|
find.files=*.lua;*.wlua;*.lexe
|
||||||
|
#find.in.files.close.on.find=0
|
||||||
|
#find.in.dot=1
|
||||||
|
#find.in.binary=1
|
||||||
|
#find.replace.matchcase=1
|
||||||
|
#find.replace.escapes=1
|
||||||
|
#find.replace.regexp=1
|
||||||
|
#find.replace.regexp.posix=1
|
||||||
|
#find.replace.wrap=0
|
||||||
|
#find.replacewith.focus=0
|
||||||
|
#find.replace.advanced=1
|
||||||
|
|
||||||
|
# Behaviour
|
||||||
|
#eol.mode=LF
|
||||||
|
eol.auto=1
|
||||||
|
clear.before.execute=0
|
||||||
|
#vc.home.key=1
|
||||||
|
#wrap.aware.home.end.keys=1
|
||||||
|
#autocomplete.choose.single=1
|
||||||
|
autocomplete.*.ignorecase=1
|
||||||
|
caret.policy.xslop=1
|
||||||
|
caret.policy.width=20
|
||||||
|
caret.policy.xstrict=0
|
||||||
|
caret.policy.xeven=0
|
||||||
|
caret.policy.xjumps=0
|
||||||
|
caret.policy.yslop=1
|
||||||
|
caret.policy.lines=1
|
||||||
|
caret.policy.ystrict=1
|
||||||
|
caret.policy.yeven=1
|
||||||
|
caret.policy.yjumps=0
|
||||||
|
#visible.policy.strict=1
|
||||||
|
#visible.policy.slop=1
|
||||||
|
#visible.policy.lines=4
|
||||||
|
#time.commands=1
|
||||||
|
#caret.sticky=1
|
||||||
|
#properties.directory.enable=1
|
||||||
|
|
||||||
|
# Status Bar
|
||||||
|
statusbar.number=1
|
||||||
|
statusbar.text.1=\
|
||||||
|
Ln: $(LineNumber) Col: $(ColumnNumber) Sel: $(SelLength) | Saved: $(FileDate) $(FileTime) | [$(OverType)] [$(EOLMode)] | $(status.msg)
|
||||||
|
#li=$(LineNumber) co=$(ColumnNumber) $(OverType) ($(EOLMode)) $(FileAttr) $(status.msg)
|
||||||
|
statusbar.text.2=\
|
||||||
|
$(BufferLength) chars in $(NbOfLines) lines. Sel: $(SelLength) chars.
|
||||||
|
statusbar.text.3=\
|
||||||
|
Now is: Date=$(CurrentDate) Time=$(CurrentTime)
|
||||||
|
statusbar.text.4=\
|
||||||
|
$(FileNameExt) : $(FileDate) - $(FileTime) | $(FileAttr)
|
||||||
|
|
||||||
|
if PLAT_WIN
|
||||||
|
command.scite.help="file://$(SciteDefaultHome)\docs\SciTEDoc.html"
|
||||||
|
command.scite.help.subsystem=2
|
||||||
|
if PLAT_GTK
|
||||||
|
command.print.*=a2ps "$(FileNameExt)"
|
||||||
|
command.scite.help=netscape "file://$(SciteDefaultHome)/SciTEDoc.html"
|
||||||
|
|
||||||
|
# Internationalisation
|
||||||
|
# Japanese input code page 932 and ShiftJIS character set 128
|
||||||
|
#code.page=932
|
||||||
|
#character.set=128
|
||||||
|
# Unicode
|
||||||
|
#code.page=65001
|
||||||
|
code.page=0
|
||||||
|
#character.set=204
|
||||||
|
# Required for Unicode to work on GTK+:
|
||||||
|
#LC_CTYPE=en_US.UTF-8
|
||||||
|
#output.code.page=65001
|
||||||
|
|
||||||
|
# Export
|
||||||
|
#export.keep.ext=1
|
||||||
|
export.html.wysiwyg=1
|
||||||
|
#export.html.tabs=1
|
||||||
|
#export.html.folding=1
|
||||||
|
export.html.styleused=1
|
||||||
|
#export.html.title.fullpath=1
|
||||||
|
#export.rtf.tabs=1
|
||||||
|
#export.rtf.font.face=Arial
|
||||||
|
#export.rtf.font.size=9
|
||||||
|
#export.rtf.tabsize=8
|
||||||
|
# Magnification (added to default screen font size)
|
||||||
|
export.pdf.magnification=0
|
||||||
|
# Font: Courier, Helvetica or Times (Courier line-wraps)
|
||||||
|
export.pdf.font=Helvetica
|
||||||
|
# Page size (in points): width, height
|
||||||
|
# E.g. Letter 612,792; A4 595,842; maximum 14400,14400
|
||||||
|
export.pdf.pagesize=595,842
|
||||||
|
# Margins (in points): left, right, top, bottom
|
||||||
|
export.pdf.margins=72,72,72,72
|
||||||
|
export.xml.collapse.spaces=1
|
||||||
|
export.xml.collapse.lines=1
|
||||||
|
|
||||||
|
# Define values for use in the imported properties files
|
||||||
|
chars.alpha=abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ
|
||||||
|
chars.numeric=0123456789
|
||||||
|
chars.accented=ŠšŒœŸÿÀàÁáÂâÃãÄäÅåÆæÇçÈèÉéÊêËëÌìÍíÎîÏïÐðÑñÒòÓóÔôÕõÖØøÙùÚúÛûÜüÝýÞþßö
|
||||||
|
# This is a better set for Russian:
|
||||||
|
#chars.accented=ÀàÁáÂâÃãÄäÅ娸ÆæÇçÈèÉéÊêËëÌìÍíÎîÏïÐðÑñÒòÓóÔôÕõÖö×÷ØøÙùÚúÛûÜüÝýÞþßÿ
|
||||||
|
|
||||||
|
# The open.filter setting is only used on Windows where the file selector has a menu of filters to apply
|
||||||
|
# to the types of files seen when opening.
|
||||||
|
# There is a limit (possibly 256 characters) to the length of a filter,
|
||||||
|
# so not all source extensions can be in this setting.
|
||||||
|
#~ source.files=*.c;*.cc;*.cpp;*.cxx;*.cs;*.h;*.hxx;*.hpp;\
|
||||||
|
#~ *.idl;*.rc;*.def;\
|
||||||
|
#~ *.java;*.js;*.py;*.lua;\
|
||||||
|
#~ make*;*.mak;\
|
||||||
|
#~ *.properties;*.html;*.xml;*.iface;*.bat;*.tex
|
||||||
|
|
||||||
|
source.files=*.c;*.cc;*.cpp;*.cxx;*.cs;*.h;*.hxx;*.hpp;\
|
||||||
|
*.idl;*.rc;*.def;\
|
||||||
|
*.java;*.lua;*.wlua;*.lexe;\
|
||||||
|
make*;*.mak;\
|
||||||
|
*.properties;*.html;*.xml;*.bat
|
||||||
|
|
||||||
|
if PLAT_WIN
|
||||||
|
all.files=All Files (*.*)|*.*|
|
||||||
|
if PLAT_GTK
|
||||||
|
all.files=All Files (*)|*|Hidden Files (.*)|.*|
|
||||||
|
open.filter=\
|
||||||
|
All Source|$(source.files)|\
|
||||||
|
$(all.files)\
|
||||||
|
$(filter.cpp)\
|
||||||
|
#$(filter.ch)\
|
||||||
|
#$(filter.css)\
|
||||||
|
#$(filter.d)\
|
||||||
|
#$(filter.fortran)\
|
||||||
|
#$(filter.idl)\
|
||||||
|
#$(filter.java)\
|
||||||
|
$(filter.js)\
|
||||||
|
$(filter.lua)\
|
||||||
|
#$(filter.matlab)\
|
||||||
|
#$(filter.pascal)\
|
||||||
|
#$(filter.perl)\
|
||||||
|
$(filter.properties)\
|
||||||
|
#$(filter.python)\
|
||||||
|
#$(filter.tex)\
|
||||||
|
$(filter.text)
|
||||||
|
|
||||||
|
# Give symbolic names to the set of fonts used in the standard styles.
|
||||||
|
if PLAT_WIN
|
||||||
|
font.monospace=font:Courier New,size:10
|
||||||
|
#font.small=font:Verdana,size:8
|
||||||
|
#font.comment=font:Comic Sans MS,size:9
|
||||||
|
|
||||||
|
font.comment=$(font.base)
|
||||||
|
font.code.comment.box=$(font.comment)
|
||||||
|
font.code.comment.line=$(font.comment)
|
||||||
|
font.code.comment.doc=$(font.comment)
|
||||||
|
font.code.comment.nested=$(font.comment)
|
||||||
|
#font.text=font:Times New Roman,size:11
|
||||||
|
font.text=$(font.base)
|
||||||
|
font.text.comment=$(font.comment)
|
||||||
|
font.embedded.base=$(font.comment)
|
||||||
|
font.embedded.comment=$(font.comment)
|
||||||
|
font.vbs=$(font.monospace)
|
||||||
|
if PLAT_GTK
|
||||||
|
font.base=font:!Bitstream Vera Sans,size:9
|
||||||
|
font.small=font:!Bitstream Vera Sans,size:8
|
||||||
|
font.comment=font:!Bitstream Vera Serif,size:9
|
||||||
|
font.code.comment.box=$(font.comment)
|
||||||
|
font.code.comment.line=$(font.comment)
|
||||||
|
font.code.comment.doc=$(font.comment)
|
||||||
|
font.code.comment.nested=$(font.comment)
|
||||||
|
font.text=font:!Bitstream Charter,size:10
|
||||||
|
font.text.comment=font:!Serif,size:9
|
||||||
|
font.embedded.base=font:!Serif,size:9
|
||||||
|
font.embedded.comment=font:!Serif,size:9
|
||||||
|
font.monospace=font:!Bitstream Vera Sans Mono,size:9
|
||||||
|
font.vbs=font:!Bitstream Vera Sans Mono,size:9
|
||||||
|
font.js=$(font.comment)
|
||||||
|
|
||||||
|
# Old GTK+ font settings are faster but not antialiased
|
||||||
|
#~ font.base=font:lucidatypewriter,size:12
|
||||||
|
#~ font.small=font:lucidatypewriter,size:10
|
||||||
|
#~ font.comment=font:new century schoolbook,size:12
|
||||||
|
#~ font.code.comment.box=$(font.comment)
|
||||||
|
#~ font.code.comment.line=$(font.comment)
|
||||||
|
#~ font.code.comment.doc=$(font.comment)
|
||||||
|
#~ font.text=font:times,size:14
|
||||||
|
#~ font.text.comment=font:lucidatypewriter,size:10
|
||||||
|
#~ font.embedded.base=font:lucidatypewriter,size:12
|
||||||
|
#~ font.embedded.comment=font:lucidatypewriter,size:12
|
||||||
|
#~ font.monospace=font:courier,size:12
|
||||||
|
#~ font.vbs=font:new century schoolbook,size:12
|
||||||
|
|
||||||
|
# Give symbolic names to the set of colours used in the standard styles.
|
||||||
|
colour.code.comment.box=fore:#007F00
|
||||||
|
colour.code.comment.line=fore:#007F00
|
||||||
|
colour.code.comment.doc=fore:#3F703F
|
||||||
|
colour.code.comment.nested=fore:#A0C0A0
|
||||||
|
colour.text.comment=fore:#0000FF,back:#D0F0D0
|
||||||
|
colour.other.comment=fore:#007F00
|
||||||
|
colour.embedded.comment=back:#E0EEFF
|
||||||
|
colour.embedded.js=back:#F0F0FF
|
||||||
|
colour.notused=back:#FF0000
|
||||||
|
|
||||||
|
colour.number=fore:#007F7F
|
||||||
|
colour.keyword=fore:#00007F
|
||||||
|
colour.string=fore:#7F007F
|
||||||
|
colour.char=fore:#7F007F
|
||||||
|
colour.operator=fore:#000000
|
||||||
|
colour.preproc=fore:#7F7F00
|
||||||
|
colour.error=fore:#FFFF00,back:#FF0000
|
||||||
|
|
||||||
|
# Global default styles for all languages
|
||||||
|
# Default
|
||||||
|
style.*.32=$(font.base)
|
||||||
|
# Line number
|
||||||
|
style.*.33=$(stdstyle.linenumbers)
|
||||||
|
# Brace highlight
|
||||||
|
style.*.34=$(stdstyle.bracematch)
|
||||||
|
# Brace incomplete highlight
|
||||||
|
style.*.35=$(stdstyle.bracemismatch)
|
||||||
|
# Control characters
|
||||||
|
style.*.36=$(stdstyle.controlchars)
|
||||||
|
# Indentation guides
|
||||||
|
style.*.37=$(stdstyle.indentguides)
|
||||||
|
|
||||||
|
# Printing - only works on Windows
|
||||||
|
if PLAT_WIN
|
||||||
|
#print.colour.mode=1
|
||||||
|
print.magnification=-1
|
||||||
|
# Setup: left, right, top, bottom margins, in local units:
|
||||||
|
# hundredths of millimeters or thousandths of inches
|
||||||
|
print.margins=1500,1000,1000,1500
|
||||||
|
# Header/footer:
|
||||||
|
# && = &; &p = current page
|
||||||
|
# &f = file name; &F = full path
|
||||||
|
# &d = file date; &D = current date
|
||||||
|
# &t = file time; &T = full time
|
||||||
|
print.header.format=$(FileNameExt) — Printed on $(CurrentDate), $(CurrentTime) — Page $(CurrentPage)
|
||||||
|
print.footer.format=$(FilePath) — File date: $(FileDate) — File time: $(FileTime)
|
||||||
|
# Header/footer style
|
||||||
|
print.header.style=font:Arial,size:12,bold
|
||||||
|
print.footer.style=font:Arial Narrow,size:10,italics
|
||||||
|
|
||||||
|
# Warnings - only works on Windows and needs to be pointed at files on machine
|
||||||
|
#if PLAT_WIN
|
||||||
|
# warning.findwrapped=100,E:\Windows\Media\SFX\Boing.wav
|
||||||
|
# warning.notfound=0,Effect.wav
|
||||||
|
# warning.wrongfile=0,Glass.wav
|
||||||
|
# warning.executeok=0,Fanfare.wav
|
||||||
|
# warning.executeko=100,GlassBreak.wav
|
||||||
|
# warning.nootherbookmark=100,Boing2.wav
|
||||||
|
|
||||||
|
# Define the Lexer menu,
|
||||||
|
# Each item contains three parts: menu string | file extension | key
|
||||||
|
# The only keys allowed currently are based on F-keys and alphabetic keys and look like
|
||||||
|
# [Ctrl+][Shift+][Fn|a] such as F12 or Ctrl+Shift+D.
|
||||||
|
# A '&' may be placed before a letter to be used as an accelerator. This does not work on GTK+.
|
||||||
|
menu.language=\
|
||||||
|
Text|txt||\
|
||||||
|
&Batch|bat||\
|
||||||
|
&C / C++|c||\
|
||||||
|
#CMake|cmake||\
|
||||||
|
#C&#|cs||\
|
||||||
|
#Csound|orc||\
|
||||||
|
#CSS|css||\
|
||||||
|
#D|d||\
|
||||||
|
#&Difference|diff||\
|
||||||
|
#&Eiffel|e||\
|
||||||
|
#Erlang|erl||\
|
||||||
|
#&Errorlist|err||\
|
||||||
|
#FlagShip|prg||\
|
||||||
|
#&Fortran|f90||\
|
||||||
|
#Gap|g||\
|
||||||
|
#H&ypertext|html||\
|
||||||
|
#&InnoSetup|iss||\
|
||||||
|
#&Java|java||\
|
||||||
|
#Java&Script|js||\
|
||||||
|
#&Kix|kix||\
|
||||||
|
#TeX|tex||\
|
||||||
|
#Lisp|lisp||\
|
||||||
|
#Lot|lot||\
|
||||||
|
#Lout|lt||\
|
||||||
|
Lu&a|lua||\
|
||||||
|
#Matlab|m.matlab||\
|
||||||
|
#&Makefile|mak|Ctrl+Shift+F11|\
|
||||||
|
#MetaPost|mp||\
|
||||||
|
#MMIXAL|mms||\
|
||||||
|
#&nnCron crontab|tab||\
|
||||||
|
#NSIS|nsis||\
|
||||||
|
#Objective Caml|ml||\
|
||||||
|
#Octave|m.octave||\
|
||||||
|
#Opal|impl||\
|
||||||
|
#Pascal|pas||\
|
||||||
|
#Pe&rl|pl||\
|
||||||
|
#P&HP|php||\
|
||||||
|
#P&LSQL|spec||\
|
||||||
|
&Properties|properties||\
|
||||||
|
#P&ostScript|ps||\
|
||||||
|
#P&OV-Ray SDL|pov||\
|
||||||
|
#Pytho&n|py||\
|
||||||
|
#Reso&urce|rc||\
|
||||||
|
#Ruby|rb||\
|
||||||
|
#Shell|sh||\
|
||||||
|
#S&QL|sql||\
|
||||||
|
#Specman|e||\
|
||||||
|
#&TCL|tcl||\
|
||||||
|
#&VB|vb||\
|
||||||
|
#VBScr&ipt|vbs||\
|
||||||
|
#Verilog|v||\
|
||||||
|
#VHDL|vhd||\
|
||||||
|
#&XML|xml|Shift+F12|
|
||||||
|
|
||||||
|
# User defined key commands
|
||||||
|
#~ user.shortcuts=\
|
||||||
|
#~ Ctrl+Shift+V|IDM_PASTEANDDOWN|\
|
||||||
|
#~ Ctrl+PageUp|IDM_PREVFILE|\
|
||||||
|
#~ Ctrl+PageDown|IDM_NEXTFILE|
|
||||||
|
|
||||||
|
#KeypadPlus|IDM_EXPAND|\
|
||||||
|
#KeypadMinus|IDM_BLOCK_COMMENT|
|
||||||
|
|
||||||
|
#user.context.menu=\
|
||||||
|
#||\
|
||||||
|
#Next File|IDM_NEXTFILE|\
|
||||||
|
#Prev File|IDM_PREVFILE|
|
||||||
|
|
||||||
|
# Import all the language specific properties files
|
||||||
|
#import ada
|
||||||
|
#import asm
|
||||||
|
#import asn1
|
||||||
|
#import au3
|
||||||
|
#import ave
|
||||||
|
#import baan
|
||||||
|
#import freebasic
|
||||||
|
#import blitzbasic
|
||||||
|
#import bullant
|
||||||
|
#import caml
|
||||||
|
#import conf
|
||||||
|
import cpp
|
||||||
|
#import cmake
|
||||||
|
#import d
|
||||||
|
#import csound
|
||||||
|
#import css
|
||||||
|
#import eiffel
|
||||||
|
#import erlang
|
||||||
|
#import escript
|
||||||
|
#import flagship
|
||||||
|
#import forth
|
||||||
|
#import fortran
|
||||||
|
#import gap
|
||||||
|
import html
|
||||||
|
#import inno
|
||||||
|
#import kix
|
||||||
|
#import lisp
|
||||||
|
#import lot
|
||||||
|
#import lout
|
||||||
|
import lua
|
||||||
|
#import matlab
|
||||||
|
#import metapost
|
||||||
|
#import mmixal
|
||||||
|
#import nncrontab
|
||||||
|
#import nsis
|
||||||
|
#import opal
|
||||||
|
import others
|
||||||
|
#import pascal
|
||||||
|
#import perl
|
||||||
|
#import pov
|
||||||
|
#import ps
|
||||||
|
#import purebasic
|
||||||
|
#import python
|
||||||
|
#import rebol
|
||||||
|
#import ruby
|
||||||
|
#import scriptol
|
||||||
|
#import smalltalk
|
||||||
|
#import spice
|
||||||
|
#import sql
|
||||||
|
#import specman
|
||||||
|
#import tcl
|
||||||
|
#import tex
|
||||||
|
#import vb
|
||||||
|
#import yaml
|
||||||
|
#import verilog
|
||||||
|
#import vhdl
|
||||||
|
|
||||||
|
abbreviations.*.lua=$(SciteDefaultHome)\abbrev.properties
|
||||||
|
abbreviations.*.wlua=$(SciteDefaultHome)\abbrev.properties
|
||||||
|
abbreviations.*.lexe=$(SciteDefaultHome)\abbrev.properties
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,25 @@
|
||||||
|
if=if | then\n\
|
||||||
|
\n\
|
||||||
|
end
|
||||||
|
|
||||||
|
ife=if | then\n\
|
||||||
|
\n\
|
||||||
|
else\n\
|
||||||
|
\n\
|
||||||
|
end
|
||||||
|
|
||||||
|
f=function | ()\n\
|
||||||
|
\n\
|
||||||
|
end
|
||||||
|
|
||||||
|
lf=local function | ()\n\
|
||||||
|
\n\
|
||||||
|
end
|
||||||
|
|
||||||
|
for=for k,v in pairs(|) do\n\
|
||||||
|
\n\
|
||||||
|
end
|
||||||
|
|
||||||
|
fi=for i,v in ipairs(|) do\n\
|
||||||
|
\n\
|
||||||
|
end
|
After Width: | Height: | Size: 1.4 KiB |
After Width: | Height: | Size: 1.4 KiB |
|
@ -0,0 +1,188 @@
|
||||||
|
black=#000000
|
||||||
|
#C0C0C0
|
||||||
|
stdstyle.fg=fore:#C0C0C0
|
||||||
|
stdstyle.bg=back:$(black)
|
||||||
|
stdstyle.syntaxerror=back:#CC0055,fore:#ffff00
|
||||||
|
#stdstyle.syntaxerror=back:#FF8000,fore:#000000
|
||||||
|
|
||||||
|
# style 0
|
||||||
|
stdstyle.whitespace=$(stdstyle.bg),#808080
|
||||||
|
|
||||||
|
# styles 32 - 37
|
||||||
|
stdstyle.default=$(stdstyle.fg),$(stdstyle.bg),$(font.base)
|
||||||
|
stdstyle.linenumbers=fore:#408080,$(stdstyle.bg)
|
||||||
|
stdstyle.bracematch=fore:#FFFF00,bold
|
||||||
|
stdstyle.bracemismatch=fore:#FF0000,bold
|
||||||
|
stdstyle.controlchars=fore:#808080
|
||||||
|
stdstyle.indentguides=fore:#808080,back:#000000
|
||||||
|
fold.margin.colour=#202020
|
||||||
|
fold.margin.highlight.colour=#202020
|
||||||
|
# various other SciTE system colors
|
||||||
|
caret.fore=#FFFFFF
|
||||||
|
caret.line.back=#C0C0C0
|
||||||
|
caret.line.back.alpha=50
|
||||||
|
selection.fore=#FFFFFF
|
||||||
|
selection.back=#0000FF
|
||||||
|
selection.alpha=80
|
||||||
|
#whitespace.fore=
|
||||||
|
#whitespace.back=
|
||||||
|
#bookmark.fore=
|
||||||
|
#bookmark.back=
|
||||||
|
#bookmark.alpha=
|
||||||
|
#error.marker.fore=
|
||||||
|
#error.marker.back=
|
||||||
|
#bookmark.fore=
|
||||||
|
#bookmark.back=
|
||||||
|
#bookmark.alpha=
|
||||||
|
#fold.margin.colour
|
||||||
|
#fold.margin.highlight.colour=
|
||||||
|
#edge.colour=
|
||||||
|
|
||||||
|
# SYNTAX ELEMENTS
|
||||||
|
stdstyle.keyword1=fore:#0080FF
|
||||||
|
stdstyle.keyword2=fore:#0080FF
|
||||||
|
stdstyle.keyword3=fore:#0080FF
|
||||||
|
stdstyle.keyword4=fore:#0080FF
|
||||||
|
|
||||||
|
# identifiers (the default is often the same as default style)$(stdstyle.fg)
|
||||||
|
stdstyle.identifier1=fore:#C0C0C0
|
||||||
|
stdstyle.identifier2=fore:#C0C0C0
|
||||||
|
stdstyle.identifier3=fore:#C0C0C0
|
||||||
|
stdstyle.identifier4=fore:#C0C0C0
|
||||||
|
|
||||||
|
stdstyle.number1=fore:#FF00FF
|
||||||
|
stdstyle.number2=fore:#FF00FF
|
||||||
|
stdstyle.number3=fore:#FF00FF
|
||||||
|
stdstyle.number4=fore:#FF00FF
|
||||||
|
|
||||||
|
# a normal string; usu 1 for single-quoted, 2 for double-quoted
|
||||||
|
stdstyle.string1=fore:#FF8000
|
||||||
|
stdstyle.string2=fore:#FFFF00
|
||||||
|
stdstyle.string3=fore:#FFFF00
|
||||||
|
stdstyle.string4=fore:#FFFF00
|
||||||
|
|
||||||
|
# a string that extends over multiple lines
|
||||||
|
stdstyle.mlstring1=fore:#FFFF00
|
||||||
|
stdstyle.mlstring2=fore:#FFFF00
|
||||||
|
stdstyle.mlstring3=fore:#FFFF00
|
||||||
|
stdstyle.mlstring4=fore:#FFFF00
|
||||||
|
stdstyle.mlstring1.bg=back:#000000
|
||||||
|
stdstyle.mlstring2.bg=back:#000000
|
||||||
|
stdstyle.mlstring3.bg=back:#000000
|
||||||
|
stdstyle.mlstring4.bg=back:#000000
|
||||||
|
|
||||||
|
# a character string
|
||||||
|
stdstyle.char1=fore:#FF8040
|
||||||
|
stdstyle.char2=fore:#FF8040
|
||||||
|
stdstyle.char3=fore:#FF8040
|
||||||
|
stdstyle.char4=fore:#FF8040
|
||||||
|
|
||||||
|
# a regular expression
|
||||||
|
stdstyle.regexp1=fore:#770077,$(font.monospace)
|
||||||
|
stdstyle.regexp2=fore:#770077,$(font.monospace)
|
||||||
|
stdstyle.regexp3=fore:#770077,$(font.monospace)
|
||||||
|
stdstyle.regexp4=fore:#770077,$(font.monospace)
|
||||||
|
stdstyle.regexp1.bg=back:#003300,eolfilled
|
||||||
|
stdstyle.regexp2.bg=back:#003300,eolfilled
|
||||||
|
stdstyle.regexp3.bg=back:#003300,eolfilled
|
||||||
|
stdstyle.regexp4.bg=back:#003300,eolfilled
|
||||||
|
|
||||||
|
stdstyle.stringerror=fore:#000000,back:#FF8000
|
||||||
|
|
||||||
|
# a normal block comment
|
||||||
|
stdstyle.comment=fore:#00FF00,$(font.comment)
|
||||||
|
stdstyle.comment1=$(stdstyle.comment)
|
||||||
|
stdstyle.comment2=$(stdstyle.comment)
|
||||||
|
stdstyle.comment3=$(stdstyle.comment)
|
||||||
|
stdstyle.comment4=$(stdstyle.comment)
|
||||||
|
stdstyle.comment1.bg=back:#003300,eolfilled
|
||||||
|
stdstyle.comment2.bg=back:#220022,eolfilled
|
||||||
|
stdstyle.comment3.bg=back:#003300,eolfilled
|
||||||
|
stdstyle.comment4.bg=back:#220022,eolfilled
|
||||||
|
|
||||||
|
# a normal comment that extends to EOL
|
||||||
|
stdstyle.eolcomment1=$(stdstyle.comment)
|
||||||
|
stdstyle.eolcomment2=fore:#557755
|
||||||
|
stdstyle.eolcomment3=fore:#007700,$(font.comment)
|
||||||
|
stdstyle.eolcomment4=fore:#007700,$(font.comment)
|
||||||
|
|
||||||
|
# a doc-comment
|
||||||
|
stdstyle.doccomment1=fore:#00FF00,$(font.comment)
|
||||||
|
stdstyle.doccomment2=fore:#007700,$(font.comment)
|
||||||
|
stdstyle.doccomment3=fore:#007700,$(font.comment)
|
||||||
|
stdstyle.doccomment4=fore:#007700,$(font.comment)
|
||||||
|
stdstyle.doccomment1.bg=back:#003300,eolfilled
|
||||||
|
stdstyle.doccomment2.bg=back:#220022,eolfilled
|
||||||
|
stdstyle.doccomment3.bg=back:#003300,eolfilled
|
||||||
|
stdstyle.doccomment4.bg=back:#220022,eolfilled
|
||||||
|
|
||||||
|
# a keyword inside doc-comment
|
||||||
|
stdstyle.dockeyword1=fore:#8080FF,$(font.comment)
|
||||||
|
stdstyle.dockeyword2=fore:#8080FF,$(font.comment)
|
||||||
|
stdstyle.dockeyword3=fore:#8080FF,$(font.comment)
|
||||||
|
stdstyle.dockeyword4=fore:#8080FF,$(font.comment)
|
||||||
|
stdstyle.dockeyworderror=fore:#800080,$(font.comment)
|
||||||
|
|
||||||
|
# other blocks
|
||||||
|
stdstyle.otherblock1=fore:#0000aa
|
||||||
|
stdstyle.otherblock2=fore:#0000aa
|
||||||
|
stdstyle.otherblock3=fore:#0000aa
|
||||||
|
stdstyle.otherblock4=fore:#0000aa
|
||||||
|
stdstyle.otherblock1.bg=back:#333300
|
||||||
|
stdstyle.otherblock2.bg=back:#333300
|
||||||
|
stdstyle.otherblock3.bg=back:#333300
|
||||||
|
stdstyle.otherblock4.bg=back:#333300
|
||||||
|
|
||||||
|
stdstyle.preprocessor1=fore:#804040
|
||||||
|
stdstyle.preprocessor2=fore:#804040
|
||||||
|
stdstyle.preprocessor3=fore:#804040
|
||||||
|
stdstyle.preprocessor4=fore:#804040
|
||||||
|
|
||||||
|
stdstyle.operator1=fore:#808080
|
||||||
|
stdstyle.operator2=fore:#808080
|
||||||
|
stdstyle.operator3=fore:#808080
|
||||||
|
stdstyle.operator4=fore:#808080
|
||||||
|
|
||||||
|
stdstyle.importantoperator1=fore:#CC00CC
|
||||||
|
stdstyle.importantoperator2=fore:#00CC00
|
||||||
|
stdstyle.importantoperator3=fore:#AAAA00
|
||||||
|
stdstyle.importantoperator4=fore:#CCAA00
|
||||||
|
|
||||||
|
# internal processing: visual brace matching
|
||||||
|
stdstyle.bracematch1=$(stdstyle.bracematch)
|
||||||
|
stdstyle.bracematch2=$(stdstyle.bracematch)
|
||||||
|
stdstyle.bracematch3=$(stdstyle.bracematch)
|
||||||
|
stdstyle.bracematch4=$(stdstyle.bracematch)
|
||||||
|
stdstyle.bracemismatch1=$(stdstyle.bracemismatch)
|
||||||
|
stdstyle.bracemismatch2=$(stdstyle.bracemismatch)
|
||||||
|
stdstyle.bracemismatch3=$(stdstyle.bracemismatch)
|
||||||
|
stdstyle.bracemismatch4=$(stdstyle.bracemismatch)
|
||||||
|
|
||||||
|
# class/method decorator
|
||||||
|
stdstyle.decorator1=fore:#00DDDD
|
||||||
|
stdstyle.decorator2=fore:#00DDDD
|
||||||
|
stdstyle.decorator3=fore:#00DDDD
|
||||||
|
stdstyle.decorator4=fore:#00DDDD
|
||||||
|
|
||||||
|
stdstyle.visualbreak1=fore:#FFFF40,back:#AAAAAA,eolfilled
|
||||||
|
stdstyle.visualbreak2=fore:#FFFF40,back:#770077,eolfilled
|
||||||
|
stdstyle.visualbreak3=fore:#FFFF40,back:#AAAAAA,eolfilled
|
||||||
|
stdstyle.visualbreak4=fore:#FFFF40,back:#770077,eolfilled
|
||||||
|
|
||||||
|
# Error messages
|
||||||
|
stdstyle.error=fore:#FFFF00
|
||||||
|
error.marker.back=#B20000
|
||||||
|
error.marker.fore=#FFFF00
|
||||||
|
stdstyle.command=fore:#BBBBFF
|
||||||
|
|
||||||
|
stdstyle.diff1=fore:#007F00
|
||||||
|
stdstyle.diff2=fore:#7F7F00
|
||||||
|
stdstyle.diff3=fore:#7F0000
|
||||||
|
stdstyle.diff4=fore:#7F007F
|
||||||
|
stdstyle.diff5=fore:#007F7F
|
||||||
|
stdstyle.diff6=fore:#00007F
|
||||||
|
|
||||||
|
#Debugger markers
|
||||||
|
stdcolor.active=#408040
|
||||||
|
stdcolor.error=#804040
|
||||||
|
|
After Width: | Height: | Size: 1.4 KiB |
|
@ -0,0 +1,341 @@
|
||||||
|
abort();
|
||||||
|
abs(int n);
|
||||||
|
acos(double x);
|
||||||
|
asctime(const struct tm* tp);
|
||||||
|
asin(double x);
|
||||||
|
assert(int expression);
|
||||||
|
atan(double x);
|
||||||
|
atan2(double y, double x);
|
||||||
|
atexit(void (*fcm)(void));
|
||||||
|
atof(const char* s);
|
||||||
|
atoi(const char* s);
|
||||||
|
atol(const char* s);
|
||||||
|
bsearch(const void* key, const void* base, size_t n, size_t size, int (*cmp)(const void* keyval, const void* datum));
|
||||||
|
calloc(size_t nobj, size_t size);
|
||||||
|
ceil(double x);
|
||||||
|
clearerr(FILE* stream);
|
||||||
|
clock(void);
|
||||||
|
cos(double x);
|
||||||
|
cosh(double x);
|
||||||
|
ctime(const time_t* tp);
|
||||||
|
difftime(time_t time2, time_t time1);
|
||||||
|
div(int num, int denom);
|
||||||
|
exit(int status);
|
||||||
|
exp(double x);
|
||||||
|
fabs(double x);
|
||||||
|
fclose(FILE* stream);
|
||||||
|
feof(FILE* stream);
|
||||||
|
ferror(FILE* stream);
|
||||||
|
fflush(FILE* stream);
|
||||||
|
fgetc(FILE* stream);
|
||||||
|
fgetpos(FILE* stream, fpos_t* ptr);
|
||||||
|
fgets(char* s, int n, FILE* stream);
|
||||||
|
floor(double x);
|
||||||
|
fmod(double x, double y);
|
||||||
|
fopen(const char* filename, const char* mode);
|
||||||
|
fprintf(FILE* stream, const char* format, ...);
|
||||||
|
fputc(int c, FILE* stream);
|
||||||
|
fputs(const char* s, FILE* stream);
|
||||||
|
fread(void* ptr, size_t size, size_t nobj, FILE* stream);
|
||||||
|
free(void* p);
|
||||||
|
freopen(const char* filename, const char* mode, FILE* stream);
|
||||||
|
frexp(double x, int* exp);
|
||||||
|
fscanf(FILE* stream, const char* format, ...);
|
||||||
|
fseek(FILE* stream, long offset, int origin);
|
||||||
|
fsetpos(FILE* stream, const fpos_t* ptr);
|
||||||
|
ftell(FILE* stream);
|
||||||
|
fwrite(const void* ptr, size_t size, size_t nobj, FILE* stream);
|
||||||
|
getc(FILE* stream);
|
||||||
|
getchar(void);
|
||||||
|
getenv(const char* name);
|
||||||
|
gets(char* s);
|
||||||
|
gmtime(const time_t* tp);
|
||||||
|
isalnum(int c);
|
||||||
|
isalpha(int c);
|
||||||
|
iscntrl(int c);
|
||||||
|
isdigit(int c);
|
||||||
|
isgraph(int c);
|
||||||
|
islower(int c);
|
||||||
|
isprint(int c);
|
||||||
|
ispunct(int c);
|
||||||
|
isspace(int c);
|
||||||
|
isupper(int c);
|
||||||
|
isxdigit(int c);
|
||||||
|
labs(long n);
|
||||||
|
ldexp(double x, int n);
|
||||||
|
ldiv(long num, long denom);
|
||||||
|
localtime(const time_t* tp);
|
||||||
|
log(double x);
|
||||||
|
log10(double x);
|
||||||
|
lua_assert(expr) macro
|
||||||
|
lua_atpanic (lua_State *L, lua_CFunction panicf) returns lua_CFunction
|
||||||
|
LUA_AUTHORS
|
||||||
|
lua_baselibopen(lua_State *L) macro returns int
|
||||||
|
lua_boxpointer(lua_State *L, void *u) macro returns void*
|
||||||
|
lua_call (lua_State *L, int nargs, int nresults) returns void
|
||||||
|
lua_checkstack (lua_State *L, int sz) returns int
|
||||||
|
lua_close (lua_State *L) returns void
|
||||||
|
LUA_COLIBNAME
|
||||||
|
lua_concat (lua_State *L, int n) returns void
|
||||||
|
LUA_COPYRIGHT
|
||||||
|
lua_cpcall (lua_State *L, lua_CFunction func, void *ud) returns int
|
||||||
|
LUA_DBLIBNAME
|
||||||
|
lua_dblibopen(lua_State *L) macro returns int
|
||||||
|
lua_dobuffer (lua_State *L, const char *buff, size_t sz, const char *n) returns int
|
||||||
|
lua_dofile (lua_State *L, const char *filename) returns int
|
||||||
|
lua_dostring (lua_State *L, const char *str) returns int
|
||||||
|
lua_dump (lua_State *L, lua_Chunkwriter writer, void *data) returns int
|
||||||
|
lua_equal (lua_State *L, int idx1, int idx2) returns int
|
||||||
|
LUA_ERRERR
|
||||||
|
LUA_ERRFILE
|
||||||
|
LUA_ERRMEM
|
||||||
|
lua_error (lua_State *L) returns int
|
||||||
|
LUA_ERRRUN
|
||||||
|
LUA_ERRSYNTAX
|
||||||
|
lua_getfenv (lua_State *L, int idx) returns void
|
||||||
|
lua_getgccount (lua_State *L) returns int
|
||||||
|
lua_getgcthreshold (lua_State *L) returns int
|
||||||
|
lua_getglobal(lua_State *L, const char *s) macro returns void
|
||||||
|
lua_gethook (lua_State *L) returns lua_Hook
|
||||||
|
lua_gethookcount (lua_State *L) returns int
|
||||||
|
lua_gethookmask (lua_State *L) returns int
|
||||||
|
lua_getinfo (lua_State *L, const char *what, lua_Debug *ar) returns int
|
||||||
|
lua_getlocal (lua_State *L, const lua_Debug *ar, int n) returns const char*
|
||||||
|
lua_getmetatable (lua_State *L, int objindex) returns int
|
||||||
|
lua_getref(lua_State *L, int ref) macro returns void
|
||||||
|
lua_getregistry(lua_State *L) macro returns void
|
||||||
|
lua_getstack (lua_State *L, int level, lua_Debug *ar) returns int
|
||||||
|
lua_gettable (lua_State *L, int idx) returns void
|
||||||
|
lua_gettop (lua_State *L) returns int
|
||||||
|
lua_getupvalue (lua_State *L, int funcindex, int n) returns const char*
|
||||||
|
LUA_GLOBALSINDEX
|
||||||
|
LUA_HOOKCALL
|
||||||
|
LUA_HOOKCOUNT
|
||||||
|
LUA_HOOKLINE
|
||||||
|
LUA_HOOKRET
|
||||||
|
LUA_HOOKTAILRET
|
||||||
|
LUA_IDSIZE
|
||||||
|
lua_insert (lua_State *L, int idx) returns void
|
||||||
|
LUA_IOLIBNAME
|
||||||
|
lua_iolibopen(lua_State *L) macro returns int
|
||||||
|
lua_isboolean(lua_State *L,n) macro returns int
|
||||||
|
lua_iscfunction (lua_State *L, int idx) returns int
|
||||||
|
lua_isfunction(lua_State *L,n) macro returns int
|
||||||
|
lua_islightuserdata(lua_State *L,n) macro returns int
|
||||||
|
lua_isnil(lua_State *L,n) macro returns int
|
||||||
|
lua_isnone(lua_State *L,n) macro returns int
|
||||||
|
lua_isnoneornil(lua_State *L, n) macro returns int
|
||||||
|
lua_isnumber (lua_State *L, int idx) returns int
|
||||||
|
lua_isstring (lua_State *L, int idx) returns int
|
||||||
|
lua_istable(lua_State *L,n) macro returns int
|
||||||
|
lua_isuserdata (lua_State *L, int idx) returns int
|
||||||
|
lua_lessthan (lua_State *L, int idx1, int idx2) returns int
|
||||||
|
lua_load (lua_State *L, lua_Chunkreader reader, void *dt, const char *chunkname) returns int
|
||||||
|
LUA_MASKCALL
|
||||||
|
LUA_MASKCOUNT
|
||||||
|
LUA_MASKLINE
|
||||||
|
LUA_MASKRET
|
||||||
|
LUA_MATHLIBNAME
|
||||||
|
lua_mathlibopen(lua_State *L) macro returns int
|
||||||
|
LUA_MINSTACK
|
||||||
|
LUA_MULTRET
|
||||||
|
lua_newtable (lua_State *L) returns void
|
||||||
|
lua_newthread (lua_State *L) returns lua_State*
|
||||||
|
lua_newuserdata (lua_State *L, size_t sz) returns void*
|
||||||
|
lua_next (lua_State *L, int idx) returns int
|
||||||
|
LUA_NOREF
|
||||||
|
LUA_NUMBER_FMT
|
||||||
|
LUA_NUMBER_SCAN
|
||||||
|
lua_open (void) returns lua_State*
|
||||||
|
LUA_OSLIBNAME
|
||||||
|
lua_pcall (lua_State *L, int nargs, int nresults, int errfunc) returns int
|
||||||
|
lua_pop(lua_State *L, int idx) macro returns void
|
||||||
|
lua_pushboolean (lua_State *L, int b) returns void
|
||||||
|
lua_pushcclosure (lua_State *L, lua_CFunction fn, int n) returns void
|
||||||
|
lua_pushcfunction(lua_State *L, lua_CFunction fn) macro returns void
|
||||||
|
lua_pushfstring (lua_State *L, const char *fmt, ...) returns const char*
|
||||||
|
lua_pushlightuserdata (lua_State *L, void *p) returns void
|
||||||
|
lua_pushliteral(lua_State *L, s) macro returns void
|
||||||
|
lua_pushlstring (lua_State *L, const char *s, size_t l) returns void
|
||||||
|
lua_pushnil (lua_State *L) returns void
|
||||||
|
lua_pushnumber (lua_State *L, lua_Number n) returns void
|
||||||
|
lua_pushstring (lua_State *L, const char *s) returns void
|
||||||
|
lua_pushupvalues (lua_State *L) returns int
|
||||||
|
lua_pushvalue (lua_State *L, int idx) returns void
|
||||||
|
lua_pushvfstring (lua_State *L, const char *fmt, va_list argp) returns const char*
|
||||||
|
lua_rawequal (lua_State *L, int idx1, int idx2) returns int
|
||||||
|
lua_rawget (lua_State *L, int idx) returns void
|
||||||
|
lua_rawgeti (lua_State *L, int idx, int n) returns void
|
||||||
|
lua_rawset (lua_State *L, int idx) returns void
|
||||||
|
lua_rawseti (lua_State *L, int idx, int n) returns void
|
||||||
|
lua_ref(lua_State *L, lock) macro returns int
|
||||||
|
LUA_REFNIL
|
||||||
|
lua_register(lua_State *L, const char *s, lua_CFunction fn) macro returns void
|
||||||
|
LUA_REGISTRYINDEX
|
||||||
|
lua_remove (lua_State *L, int idx) returns void
|
||||||
|
lua_replace (lua_State *L, int idx) returns void
|
||||||
|
lua_resume (lua_State *L, int narg) returns int
|
||||||
|
lua_setfenv (lua_State *L, int idx) returns int
|
||||||
|
lua_setgcthreshold (lua_State *L, int newthreshold) returns void
|
||||||
|
lua_setglobal(lua_State *L, const char *s) macro returns void
|
||||||
|
lua_sethook (lua_State *L, lua_Hook func, int mask, int count) returns int
|
||||||
|
lua_setlocal (lua_State *L, const lua_Debug *ar, int n) returns const char*
|
||||||
|
lua_setmetatable (lua_State *L, int objindex) returns int
|
||||||
|
lua_settable (lua_State *L, int idx) returns void
|
||||||
|
lua_settop (lua_State *L, int idx) returns void
|
||||||
|
lua_setupvalue (lua_State *L, int funcindex, int n) returns const char*
|
||||||
|
lua_strlen (lua_State *L, int idx) returns size_t
|
||||||
|
LUA_STRLIBNAME
|
||||||
|
lua_strlibopen(lua_State *L) macro returns int
|
||||||
|
LUA_TABLIBNAME
|
||||||
|
lua_tablibopen(lua_State *L) macro returns int
|
||||||
|
LUA_TBOOLEAN
|
||||||
|
LUA_TFUNCTION
|
||||||
|
LUA_TLIGHTUSERDATA
|
||||||
|
LUA_TNIL
|
||||||
|
LUA_TNONE
|
||||||
|
LUA_TNUMBER
|
||||||
|
lua_toboolean (lua_State *L, int idx) returns int
|
||||||
|
lua_tocfunction (lua_State *L, int idx) returns lua_CFunction
|
||||||
|
lua_tonumber (lua_State *L, int idx) returns lua_Number
|
||||||
|
lua_topointer (lua_State *L, int idx) returns const char*
|
||||||
|
lua_tostring (lua_State *L, int idx) returns const char*
|
||||||
|
lua_tothread (lua_State *L, int idx) returns lua_State*
|
||||||
|
lua_touserdata (lua_State *L, int idx) returns void*
|
||||||
|
LUA_TSTRING
|
||||||
|
LUA_TTABLE
|
||||||
|
LUA_TTHREAD
|
||||||
|
LUA_TUSERDATA
|
||||||
|
lua_type (lua_State *L, int idx) returns int
|
||||||
|
lua_typename (lua_State *L, int tp) returns const char*
|
||||||
|
lua_unboxpointer(lua_State *L, int idx) macro returns void*
|
||||||
|
lua_unref(lua_State *L, int ref) macro returns void
|
||||||
|
lua_upvalueindex(i) macro returns expr
|
||||||
|
LUA_VERSION
|
||||||
|
lua_version (void) returns const char*
|
||||||
|
lua_xmove (lua_State *from, lua_State *to, int n) returns void
|
||||||
|
lua_yield (lua_State *L, int nresults) returns int
|
||||||
|
luaL_addlstring (luaL_Buffer *B, const char *s, size_t l) returns void
|
||||||
|
luaL_addsize(luaL_Buffer *B, size_t n) macro returns void
|
||||||
|
luaL_addstring (luaL_Buffer *B, const char *s) returns void
|
||||||
|
luaL_addvalue (luaL_Buffer *B) returns void
|
||||||
|
luaL_arg_check(lua_State *L, expr, int numarg, const char *extramsg) macro returns void
|
||||||
|
luaL_argcheck(lua_State *L, expr, int numarg, const char *extramsg) macro returns void
|
||||||
|
luaL_argerror (lua_State *L, int numarg, const char *extramsg) returns int
|
||||||
|
LUAL_BUFFERSIZE
|
||||||
|
luaL_buffinit (lua_State *L, luaL_Buffer *B) returns void
|
||||||
|
luaL_callmeta (lua_State *L, int obj, const char *e) returns int
|
||||||
|
luaL_check_int(lua_State *L, int numArg) macro returns int
|
||||||
|
luaL_check_long(lua_State *L, int numArg) macro returns long
|
||||||
|
luaL_check_lstr(lua_State *L, int numArg, size_t *l) macro returns const char*
|
||||||
|
luaL_check_number(lua_State *L, int numArg) macro returns lua_Number
|
||||||
|
luaL_check_string(lua_State *L, int n) macro returns const char*
|
||||||
|
luaL_checkany (lua_State *L, int narg) returns void
|
||||||
|
luaL_checkint(lua_State *L, int numArg) macro returns int
|
||||||
|
luaL_checklong(lua_State *L, int numArg) macro returns long
|
||||||
|
luaL_checklstring (lua_State *L, int numArg, size_t *l) returns const char*
|
||||||
|
luaL_checknumber (lua_State *L, int numArg) returns lua_Number
|
||||||
|
luaL_checkstack (lua_State *L, int sz, const char *msg) returns void
|
||||||
|
luaL_checkstring(lua_State *L, int numArg) macro returns const char*
|
||||||
|
luaL_checktype (lua_State *L, int narg, int t) returns void
|
||||||
|
luaL_checkudata (lua_State *L, int ud, const char *tname) returns void*
|
||||||
|
luaL_error (lua_State *L, const char *fmt, ...) returns int
|
||||||
|
luaL_findstring (const char *st, const char *const lst[]) returns int
|
||||||
|
luaL_getmetafield (lua_State *L, int obj, const char *e) returns int
|
||||||
|
luaL_getmetatable (lua_State *L, const char *tname) returns void
|
||||||
|
luaL_getn (lua_State *L, int t) returns int
|
||||||
|
luaL_loadbuffer (lua_State *L, const char *buff, size_t sz, const char *name) returns int
|
||||||
|
luaL_loadfile (lua_State *L, const char *filename) returns int
|
||||||
|
luaL_newmetatable (lua_State *L, const char *tname) returns int
|
||||||
|
luaL_openlib (lua_State *L, const char *libname, const luaL_reg *l, int nup) returns void
|
||||||
|
luaL_opt_int(lua_State *L, int nArg, lua_Number def) macro returns int
|
||||||
|
luaL_opt_long(lua_State *L, int nArg, lua_Number def) macro returns long
|
||||||
|
luaL_opt_lstr(lua_State *L, int numArg, const char *def, size_t *l) macro returns const char*
|
||||||
|
luaL_opt_number(lua_State *L, int nArg, lua_Number def) macro returns lua_Number
|
||||||
|
luaL_opt_string(lua_State *L, int numArg, const char *def) macro returns const char*
|
||||||
|
luaL_optint(lua_State *L, int nArg, lua_Number def) macro returns int
|
||||||
|
luaL_optlong(lua_State *L, int nArg, lua_Number def) macro returns long
|
||||||
|
luaL_optlstring (lua_State *L, int numArg, const char *def, size_t *l) returns const char*
|
||||||
|
luaL_optnumber (lua_State *L, int nArg, lua_Number def) returns lua_Number
|
||||||
|
luaL_optstring(lua_State *L, int numArg, const char *def) macro returns const char*
|
||||||
|
luaL_prepbuffer (luaL_Buffer *B) returns char*
|
||||||
|
luaL_pushresult (luaL_Buffer *B) returns void
|
||||||
|
luaL_putchar(luaL_Buffer *B, char c) macro returns void
|
||||||
|
luaL_ref (lua_State *L, int t) returns int
|
||||||
|
luaL_setn (lua_State *L, int t, int n) returns void
|
||||||
|
luaL_typerror (lua_State *L, int narg, const char *tname) returns int
|
||||||
|
luaL_unref (lua_State *L, int t, int ref) returns void
|
||||||
|
luaL_where (lua_State *L, int lvl) returns void
|
||||||
|
luaopen_base (lua_State *L) returns int
|
||||||
|
luaopen_debug (lua_State *L) returns int
|
||||||
|
luaopen_io (lua_State *L) returns int
|
||||||
|
luaopen_loadlib (lua_State *L) returns int
|
||||||
|
luaopen_math (lua_State *L) returns int
|
||||||
|
luaopen_string (lua_State *L) returns int
|
||||||
|
luaopen_table (lua_State *L) returns int
|
||||||
|
malloc(size_t size);
|
||||||
|
memchr(const void* cs, int c, size_t n);
|
||||||
|
memcmp(const void* cs, const void* ct, size_t n);
|
||||||
|
memcpy(void* s, const void* ct, size_t n);
|
||||||
|
memmove(void* s, const void* ct, size_t n);
|
||||||
|
memset(void* s, int c, size_t n);
|
||||||
|
mktime(struct tm* tp);
|
||||||
|
modf(double x, double* ip);
|
||||||
|
perror(const char* s);
|
||||||
|
pow(double x, double y);
|
||||||
|
printf(const char* format, ...);
|
||||||
|
putc(int c, FILE* stream);
|
||||||
|
putchar(int c);
|
||||||
|
puts(const char* s);
|
||||||
|
qsort(void* base, size_t n, size_t size, int (*cmp)(const void*, const void*));
|
||||||
|
raise(int sig);
|
||||||
|
rand(void);
|
||||||
|
realloc(void* p, size_t size);
|
||||||
|
remove(const char* filename);
|
||||||
|
rename(const char* oldname, const char* newname);
|
||||||
|
rewind(FILE* stream);
|
||||||
|
scanf(const char* format, ...);
|
||||||
|
setbuf(FILE* stream, char* buf);
|
||||||
|
setvbuf(FILE* stream, char* buf, int mode, size_t size);
|
||||||
|
sin(double x);
|
||||||
|
sinh(double x);
|
||||||
|
sprintf(char* s, const char* format, ...);
|
||||||
|
sqrt(double x);
|
||||||
|
srand(unsigned int seed);
|
||||||
|
sscanf(char* s, const char* format, ...);
|
||||||
|
strcat(char* s, const char* ct);
|
||||||
|
strchr(const char* cs, int c);
|
||||||
|
strcmp(const char* cs, const char* ct);
|
||||||
|
strcoll(const char* cs, const char* ct);
|
||||||
|
strcpy(char* s, const char* ct);
|
||||||
|
strcspn(const char* cs, const char* ct);
|
||||||
|
strerror(int n);
|
||||||
|
strftime(char* s, size_t smax, const char* fmt, const struct tm* tp);
|
||||||
|
strlen(const char* cs);
|
||||||
|
strncat(char* s, const char* ct, size_t n);
|
||||||
|
strncmp(const char* cs, const char* ct, size_t n);
|
||||||
|
strncpy(char* s, const char* ct, size_t n);
|
||||||
|
strpbrk(const char* cs, const char* ct);
|
||||||
|
strrchr(const char* cs, int c);
|
||||||
|
strspn(const char* cs, const char* ct);
|
||||||
|
strstr(const char* cs, const char* ct);
|
||||||
|
strtod(const char* s, char** endp);
|
||||||
|
strtok(char* s, const char* t);
|
||||||
|
strtol(const char* s, char** endp, int base);
|
||||||
|
strtoul(const char* s, char** endp, int base);
|
||||||
|
strxfrm(char* s, const char* ct, size_t n);
|
||||||
|
system(const char* s);
|
||||||
|
tan(double x);
|
||||||
|
tanh(double x);
|
||||||
|
time(time_t* tp);
|
||||||
|
tmpfile();
|
||||||
|
tmpname(char s[L_tmpnam]);
|
||||||
|
tolower(int c);
|
||||||
|
toupper(int c);
|
||||||
|
ungetc(int c, FILE* stream);
|
||||||
|
va_arg(va_list ap, type);
|
||||||
|
va_end(va_list ap);
|
||||||
|
va_start(va_list ap, lastarg);
|
||||||
|
vfprintf(FILE* stream, const char* format, va_list arg);
|
||||||
|
vprintf(const char* format, va_list arg);
|
||||||
|
vsprintf(char* s, const char* format, va_list arg);
|
|
@ -0,0 +1,320 @@
|
||||||
|
# Define SciTE settings for C++, C, C#, Ch, Java, IDL, JavaScript, Flash (ActionScript 2) files.
|
||||||
|
|
||||||
|
# sma files are Small script (C-like)
|
||||||
|
file.patterns.cpp=*.c;*.cc;*.cpp;*.cxx;*.h;*.hh;*.hpp;*.hxx;*.ipp;*.sma
|
||||||
|
file.patterns.cplusplus=*.cc;*.cpp;*.cxx
|
||||||
|
# pln, inc and t are SilkTest (4Test) files.
|
||||||
|
file.patterns.test=*.pln;*.inc;*.t
|
||||||
|
file.patterns.cs=*.cs
|
||||||
|
file.patterns.rc=*.rc;*.rc2;*.dlg
|
||||||
|
file.patterns.idl=*.idl;*.odl
|
||||||
|
file.patterns.flash=*.as;*.asc;*.jsfl
|
||||||
|
file.patterns.ch=*.ch;*.chf;*.chs
|
||||||
|
file.patterns.c.like=$(file.patterns.cpp);$(file.patterns.cs);$(file.patterns.idl);*.java;$(file.patterns.flash);$(file.patterns.ch)
|
||||||
|
|
||||||
|
shbang.tcc=cpp
|
||||||
|
shbang.tinycc=cpp
|
||||||
|
|
||||||
|
#api control
|
||||||
|
api.$(file.patterns.cpp)=$(SciteDefaultHome)/c.api
|
||||||
|
calltip.cpp.end.definition=)
|
||||||
|
|
||||||
|
filter.cpp=C/C++ (c cc cpp cxx cs h hh hxx hpp ipp dlg rc rc2 mak)|\
|
||||||
|
$(file.patterns.cpp);$(file.patterns.cs);$(file.patterns.rc);*.mak;make*|
|
||||||
|
filter.java=Java (java)|*.java|
|
||||||
|
filter.js=JavaScript (js)|*.js|
|
||||||
|
filter.idl=IDL (idl odl)|$(file.patterns.idl)|
|
||||||
|
filter.test=SilkTest (pln inc t)|$(file.patterns.test)|
|
||||||
|
filter.flash=Flash (as asc jsfl)|$(file.patterns.flash)|
|
||||||
|
filter.ch=Ch (ch chf chs)|$(file.patterns.ch)|
|
||||||
|
|
||||||
|
lexer.*.java=cpp
|
||||||
|
lexer.$(file.patterns.cpp)=cpp
|
||||||
|
lexer.$(file.patterns.rc)=cpp
|
||||||
|
lexer.$(file.patterns.idl)=cpp
|
||||||
|
lexer.$(file.patterns.cs)=cpp
|
||||||
|
lexer.*.js=cpp
|
||||||
|
lexer.$(file.patterns.test)=cpp
|
||||||
|
lexer.$(file.patterns.flash)=cpp
|
||||||
|
lexer.$(file.patterns.ch)=cpp
|
||||||
|
|
||||||
|
keywordclass.cpp=and and_eq asm auto bitand bitor bool break \
|
||||||
|
case catch char class compl const const_cast continue \
|
||||||
|
default delete do double dynamic_cast else enum explicit export extern false float for \
|
||||||
|
friend goto if inline int long mutable namespace new not not_eq \
|
||||||
|
operator or or_eq private protected public \
|
||||||
|
register reinterpret_cast return short signed sizeof static static_cast struct switch \
|
||||||
|
template this throw true try typedef typeid typename union unsigned using \
|
||||||
|
virtual void volatile wchar_t while xor xor_eq
|
||||||
|
keywords.$(file.patterns.cpp)=$(keywordclass.cpp)
|
||||||
|
# keywords2 is for highlighting user defined keywords or function calls or similar
|
||||||
|
#keywords2.$(file.patterns.cpp)=file
|
||||||
|
# keywords3 is for doc comment keywords, highlighted in style 17
|
||||||
|
#CPP doxygen
|
||||||
|
keywords3.$(file.patterns.cpp)=a addindex addtogroup anchor arg attention \
|
||||||
|
author b brief bug c class code date def defgroup deprecated dontinclude \
|
||||||
|
e em endcode endhtmlonly endif endlatexonly endlink endverbatim enum example exception \
|
||||||
|
f$ f[ f] file fn hideinitializer htmlinclude htmlonly \
|
||||||
|
if image include ingroup internal invariant interface latexonly li line link \
|
||||||
|
mainpage name namespace nosubgrouping note overload \
|
||||||
|
p page par param param[in] param[out] \
|
||||||
|
post pre ref relates remarks return retval \
|
||||||
|
sa section see showinitializer since skip skipline struct subsection \
|
||||||
|
test throw todo typedef union until \
|
||||||
|
var verbatim verbinclude version warning weakgroup $ @ \ & < > # { }
|
||||||
|
|
||||||
|
word.chars.cxx=$(chars.alpha)$(chars.numeric)_#
|
||||||
|
word.characters.$(file.patterns.cpp)=$(word.chars.cxx)
|
||||||
|
word.characters.$(file.patterns.cs)=$(word.chars.cxx)
|
||||||
|
calltip.cpp.word.characters=$(chars.alpha)$(chars.numeric)_
|
||||||
|
comment.block.cpp=//~
|
||||||
|
#comment.block.at.line.start.cpp=1
|
||||||
|
comment.stream.start.cpp=/*
|
||||||
|
comment.stream.end.cpp=*/
|
||||||
|
comment.box.start.cpp=/*
|
||||||
|
comment.box.middle.cpp= *
|
||||||
|
comment.box.end.cpp= */
|
||||||
|
#fold.at.else=1
|
||||||
|
|
||||||
|
file.patterns.c.except.cpp=$(file.patterns.cs);$(file.patterns.idl);*.java;$(file.patterns.flash);$(file.patterns.ch)
|
||||||
|
statement.indent.$(file.patterns.c.except.cpp)=5 case default do else for if while
|
||||||
|
statement.indent.$(file.patterns.cpp)=5 case default do else for if private protected public while
|
||||||
|
statement.end.$(file.patterns.c.like)=10 ;
|
||||||
|
statement.lookback.$(file.patterns.c.like)=20
|
||||||
|
block.start.$(file.patterns.c.like)=10 {
|
||||||
|
block.end.$(file.patterns.c.like)=10 }
|
||||||
|
|
||||||
|
#autocomplete.cpp.fillups=(
|
||||||
|
|
||||||
|
#styling.within.preprocessor=1
|
||||||
|
preprocessor.symbol.$(file.patterns.cpp)=#
|
||||||
|
preprocessor.start.$(file.patterns.cpp)=if ifdef ifndef
|
||||||
|
preprocessor.middle.$(file.patterns.cpp)=else elif
|
||||||
|
preprocessor.end.$(file.patterns.cpp)=endif
|
||||||
|
|
||||||
|
preprocessor.symbol.$(file.patterns.cs)=#
|
||||||
|
preprocessor.start.$(file.patterns.cs)=if region
|
||||||
|
preprocessor.middle.$(file.patterns.cs)=else elif
|
||||||
|
preprocessor.end.$(file.patterns.cs)=endif endregion
|
||||||
|
|
||||||
|
keywordclass.ch=\
|
||||||
|
auto array bool break case char class complex ComplexInf ComplexNaN \
|
||||||
|
const continue default delete \
|
||||||
|
do double else enum export extern float for foreach goto if Inf inline int \
|
||||||
|
long namespace NaN new NULL private public register restrict return short \
|
||||||
|
signed sizeof static string_t struct switch this typedef union unsigned \
|
||||||
|
using void volatile wchar_t while __declspec
|
||||||
|
keywords.$(file.patterns.ch)=$(keywordclass.ch)
|
||||||
|
word.chars.ch=$(chars.alpha)$(chars.numeric)_#
|
||||||
|
word.characters.$(file.patterns.ch)=$(word.chars.cxx)
|
||||||
|
comment.block.ch=//~
|
||||||
|
#comment.block.at.line.start.ch=1
|
||||||
|
comment.stream.start.ch=/*
|
||||||
|
comment.stream.end.ch=*/
|
||||||
|
comment.box.start.ch=/*
|
||||||
|
comment.box.middle.ch= *
|
||||||
|
comment.box.end.ch= */
|
||||||
|
preprocessor.symbol.$(file.patterns.ch)=#
|
||||||
|
preprocessor.start.$(file.patterns.ch)=if ifdef ifndef
|
||||||
|
preprocessor.middle.$(file.patterns.ch)=else elif
|
||||||
|
preprocessor.end.$(file.patterns.ch)=endif
|
||||||
|
|
||||||
|
keywordclass.cs=abstract as base bool break byte case catch char checked class \
|
||||||
|
const continue decimal default delegate do double else enum \
|
||||||
|
event explicit extern false finally fixed float for foreach goto if \
|
||||||
|
implicit in int interface internal is lock long namespace new null \
|
||||||
|
object operator out override params private protected public \
|
||||||
|
readonly ref return sbyte sealed short sizeof stackalloc static \
|
||||||
|
string struct switch this throw true try typeof uint ulong \
|
||||||
|
unchecked unsafe ushort using virtual void while
|
||||||
|
keywords.$(file.patterns.cs)=$(keywordclass.cs)
|
||||||
|
word.characters.$(file.patterns.cs)=$(word.chars.cxx)
|
||||||
|
|
||||||
|
keywordclass.rc=\
|
||||||
|
ACCELERATORS ALT AUTO3STATE AUTOCHECKBOX AUTORADIOBUTTON \
|
||||||
|
BEGIN BITMAP BLOCK BUTTON CAPTION CHARACTERISTICS CHECKBOX CLASS \
|
||||||
|
COMBOBOX CONTROL CTEXT CURSOR DEFPUSHBUTTON DIALOG DIALOGEX DISCARDABLE \
|
||||||
|
EDITTEXT END EXSTYLE FONT GROUPBOX ICON LANGUAGE LISTBOX LTEXT \
|
||||||
|
MENU MENUEX MENUITEM MESSAGETABLE POPUP \
|
||||||
|
PUSHBUTTON RADIOBUTTON RCDATA RTEXT SCROLLBAR SEPARATOR SHIFT STATE3 \
|
||||||
|
STRINGTABLE STYLE TEXTINCLUDE VALUE VERSION VERSIONINFO VIRTKEY
|
||||||
|
keywords.$(file.patterns.rc)=$(keywordclass.rc)
|
||||||
|
|
||||||
|
keywordclass.idl=\
|
||||||
|
aggregatable allocate appobject arrays async async_uuid \
|
||||||
|
auto_handle \
|
||||||
|
bindable boolean broadcast byte byte_count \
|
||||||
|
call_as callback char coclass code comm_status \
|
||||||
|
const context_handle context_handle_noserialize \
|
||||||
|
context_handle_serialize control cpp_quote custom \
|
||||||
|
decode default defaultbind defaultcollelem \
|
||||||
|
defaultvalue defaultvtable dispinterface displaybind dllname \
|
||||||
|
double dual \
|
||||||
|
enable_allocate encode endpoint entry enum error_status_t \
|
||||||
|
explicit_handle \
|
||||||
|
fault_status first_is float \
|
||||||
|
handle_t heap helpcontext helpfile helpstring \
|
||||||
|
helpstringcontext helpstringdll hidden hyper \
|
||||||
|
id idempotent ignore iid_as iid_is immediatebind implicit_handle \
|
||||||
|
import importlib in include in_line int __int64 __int3264 interface \
|
||||||
|
last_is lcid length_is library licensed local long \
|
||||||
|
max_is maybe message methods midl_pragma \
|
||||||
|
midl_user_allocate midl_user_free min_is module ms_union \
|
||||||
|
ncacn_at_dsp ncacn_dnet_nsp ncacn_http ncacn_ip_tcp \
|
||||||
|
ncacn_nb_ipx ncacn_nb_nb ncacn_nb_tcp ncacn_np \
|
||||||
|
ncacn_spx ncacn_vns_spp ncadg_ip_udp ncadg_ipx ncadg_mq \
|
||||||
|
ncalrpc nocode nonbrowsable noncreatable nonextensible notify \
|
||||||
|
object odl oleautomation optimize optional out out_of_line \
|
||||||
|
pipe pointer_default pragma properties propget propput propputref \
|
||||||
|
ptr public \
|
||||||
|
range readonly ref represent_as requestedit restricted retval \
|
||||||
|
shape short signed size_is small source strict_context_handle \
|
||||||
|
string struct switch switch_is switch_type \
|
||||||
|
transmit_as typedef \
|
||||||
|
uidefault union unique unsigned user_marshal usesgetlasterror uuid \
|
||||||
|
v1_enum vararg version void wchar_t wire_marshal
|
||||||
|
|
||||||
|
keywordclass.msidl=handle
|
||||||
|
keywordclass.xpidl=attribute native noscript scriptable shared wstring inout
|
||||||
|
keywords.$(file.patterns.idl)=$(keywordclass.idl) $(keywordclass.xpidl)
|
||||||
|
|
||||||
|
keywordclass.java=abstract assert boolean break byte case catch char class \
|
||||||
|
const continue default do double else extends final finally float for future \
|
||||||
|
generic goto if implements import inner instanceof int interface long \
|
||||||
|
native new null outer package private protected public rest \
|
||||||
|
return short static super switch synchronized this throw throws \
|
||||||
|
transient try var void volatile while
|
||||||
|
keywords.*.java=$(keywordclass.java)
|
||||||
|
|
||||||
|
keywordclass.javascript=abstract boolean break byte case catch char class \
|
||||||
|
const continue debugger default delete do double else enum export extends \
|
||||||
|
final finally float for function goto if implements import in instanceof \
|
||||||
|
int interface long native new package private protected public \
|
||||||
|
return short static super switch synchronized this throw throws \
|
||||||
|
transient try typeof var void volatile while with
|
||||||
|
keywords.*.js=$(keywordclass.javascript)
|
||||||
|
|
||||||
|
keywordclass.flash=add and break case catch class continue default delete do \
|
||||||
|
dynamic else eq extends false finally for function ge get gt if implements import in \
|
||||||
|
instanceof interface intrinsic le lt ne new not null or private public return \
|
||||||
|
set static super switch this throw true try typeof undefined var void while with
|
||||||
|
|
||||||
|
keywordclass2.flash=Array Arguments Accessibility Boolean Button Camera Color \
|
||||||
|
ContextMenu ContextMenuItem Date Error Function Key LoadVars LocalConnection Math \
|
||||||
|
Microphone Mouse MovieClip MovieClipLoader NetConnection NetStream Number Object \
|
||||||
|
PrintJob Selection SharedObject Sound Stage String StyleSheet System TextField \
|
||||||
|
TextFormat TextSnapshot Video Void XML XMLNode XMLSocket \
|
||||||
|
_accProps _focusrect _global _highquality _parent _quality _root _soundbuftime \
|
||||||
|
arguments asfunction call capabilities chr clearInterval duplicateMovieClip \
|
||||||
|
escape eval fscommand getProperty getTimer getURL getVersion gotoAndPlay gotoAndStop \
|
||||||
|
ifFrameLoaded Infinity -Infinity int isFinite isNaN length loadMovie loadMovieNum \
|
||||||
|
loadVariables loadVariablesNum maxscroll mbchr mblength mbord mbsubstring MMExecute \
|
||||||
|
NaN newline nextFrame nextScene on onClipEvent onUpdate ord parseFloat parseInt play \
|
||||||
|
prevFrame prevScene print printAsBitmap printAsBitmapNum printNum random removeMovieClip \
|
||||||
|
scroll set setInterval setProperty startDrag stop stopAllSounds stopDrag substring \
|
||||||
|
targetPath tellTarget toggleHighQuality trace unescape unloadMovie unLoadMovieNum updateAfterEvent
|
||||||
|
|
||||||
|
keywords.$(file.patterns.flash)=$(keywordclass.flash)
|
||||||
|
keywords2.$(file.patterns.flash)=$(keywordclass2.flash)
|
||||||
|
|
||||||
|
# C++ styles
|
||||||
|
|
||||||
|
# Default
|
||||||
|
style.cpp.32=$(stdstyle.default)
|
||||||
|
# White space
|
||||||
|
style.cpp.0=$(stdstyle.whitespace)
|
||||||
|
# Comment: /* */.
|
||||||
|
style.cpp.1=$(stdstyle.comment1)
|
||||||
|
# Line Comment: //.
|
||||||
|
style.cpp.2=$(stdstyle.eolcomment1)
|
||||||
|
# Doc comment: block comments beginning with /** or /*!
|
||||||
|
style.cpp.3=$(stdstyle.doccomment1)
|
||||||
|
# Number
|
||||||
|
style.cpp.4=$(stdstyle.number1)
|
||||||
|
# Keyword
|
||||||
|
style.cpp.5=$(stdstyle.keyword1)
|
||||||
|
# Double quoted string
|
||||||
|
style.cpp.6=$(stdstyle.string1)
|
||||||
|
# Single quoted string
|
||||||
|
style.cpp.7=$(stdstyle.string2)
|
||||||
|
# UUIDs (only in IDL)
|
||||||
|
style.cpp.8=$(stdstyle.identifier1)
|
||||||
|
# Preprocessor
|
||||||
|
style.cpp.9=$(stdstyle.preprocessor1)
|
||||||
|
# Operators
|
||||||
|
style.cpp.10=$(stdstyle.operator1)
|
||||||
|
# Identifiers
|
||||||
|
style.cpp.11=$(stdstyle.default)
|
||||||
|
# End of line where string is not closed
|
||||||
|
style.cpp.12=$(stdstyle.stringerror)
|
||||||
|
# Verbatim strings for C#
|
||||||
|
style.cpp.13=$(stdstyle.string1)
|
||||||
|
# Regular expressions for JavaScript
|
||||||
|
style.cpp.14=$(stdstyle.regexp1)
|
||||||
|
# Doc Comment Line: line comments beginning with /// or //!.
|
||||||
|
style.cpp.15=$(stdstyle.doccomment1)
|
||||||
|
# Keywords2
|
||||||
|
style.cpp.16=$(stdstyle.keyword2)
|
||||||
|
# Comment keyword
|
||||||
|
style.cpp.17=$(stdstyle.doccommkeyword1)
|
||||||
|
# Comment keyword error
|
||||||
|
style.cpp.18=$(stdstyle.doccommkeyworderror)
|
||||||
|
|
||||||
|
ccopts=-pedantic -Os
|
||||||
|
cc=g++ $(ccopts) -c $(FileNameExt) -o $(FileName).o
|
||||||
|
ccc=gcc $(ccopts) -c $(FileNameExt) -o $(FileName).o
|
||||||
|
|
||||||
|
make.command=make
|
||||||
|
command.compile.*.c=$(ccc) -std=c99
|
||||||
|
command.build.*.c=$(make.command)
|
||||||
|
command.go.*.c=./$(FileName)
|
||||||
|
# To make the Go command both compile (if needed) and execute, use this setting:
|
||||||
|
#command.go.needs.*.c=gcc $(ccopts) -std=c99 $(FileNameExt) -o $(FileName)
|
||||||
|
|
||||||
|
command.compile.$(file.patterns.cplusplus)=$(cc)
|
||||||
|
command.build.$(file.patterns.cplusplus)=$(make.command)
|
||||||
|
command.go.$(file.patterns.cplusplus)=./$(FileName)
|
||||||
|
command.go.needs.$(file.patterns.cplusplus)=g++ $(ccopts) $(FileNameExt) -o $(FileName)
|
||||||
|
|
||||||
|
command.build.*.h=$(make.command)
|
||||||
|
|
||||||
|
command.name.0.$(file.patterns.cpp)=Indent
|
||||||
|
command.0.$(file.patterns.cpp)=astyle -tapOK -M8 $(FileNameExt)
|
||||||
|
command.is.filter.0.$(file.patterns.cpp)=1
|
||||||
|
|
||||||
|
command.name.1.$(file.patterns.cplusplus)=Lint
|
||||||
|
command.1.$(file.patterns.cplusplus)=g++ -W -Wall -Wshadow -Wwrite-strings -Wold-style-cast \
|
||||||
|
-Woverloaded-virtual -pedantic -Os -fno-exceptions -c $(FileNameExt)
|
||||||
|
|
||||||
|
if PLAT_WIN
|
||||||
|
command.compile.*.rc=windres $(FileNameExt) $(FileName).o
|
||||||
|
command.build.*.rc=$(make.command)
|
||||||
|
command.help.$(file.patterns.cpp)=$(CurrentWord)!G:\Program Files\Microsoft Visual Studio\MSDN98\98VSa\1033\MSDNVS6A.COL
|
||||||
|
command.help.subsystem.$(file.patterns.cpp)=4
|
||||||
|
command.go.*.js=cscript /nologo $(FileNameExt)
|
||||||
|
# When maintaining old Win16 programs...
|
||||||
|
# command.help.$(file.patterns.cpp)=$(CurrentWord)!I:\msvc\help\win31wh.hlp
|
||||||
|
# command.help.subsystem.$(file.patterns.cpp)=5
|
||||||
|
|
||||||
|
if PLAT_GTK
|
||||||
|
command.help.$(file.patterns.cpp)=man $(CurrentWord) | col -b
|
||||||
|
|
||||||
|
if PLAT_WIN
|
||||||
|
command.build.*.cs=csc /t:winexe $(FileNameExt) /r:system.dll,system.drawing.dll
|
||||||
|
command.go.*.cs=$(FileName)
|
||||||
|
command.go.subsystem.*.cs=1
|
||||||
|
if PLAT_GTK
|
||||||
|
command.build.*.cs=mcs /t:winexe $(FileNameExt) /r:System,System.Drawing
|
||||||
|
command.go.*.cs=mono $(FileName).exe
|
||||||
|
command.go.subsystem.*.cs=1
|
||||||
|
|
||||||
|
command.compile.*.java=javac $(FileNameExt)
|
||||||
|
command.build.*.java=javac *.java
|
||||||
|
command.go.*.java=java $(FileName)
|
||||||
|
|
||||||
|
command.compile.*.ch=ch -n $(FileNameExt)
|
||||||
|
command.build.*.ch=ch -n $(FileNameExt)
|
||||||
|
command.go.*.ch=ch -u $(FileNameExt)
|
||||||
|
|
||||||
|
command.compile.*.as=mtasc -strict $(FileNameExt)
|
||||||
|
command.build.*.as=mtasc -strict *.as
|
|
@ -0,0 +1,185 @@
|
||||||
|
darkblue=#000040
|
||||||
|
|
||||||
|
stdstyle.fg=fore:#BBBBBB
|
||||||
|
stdstyle.bg=back:$(darkblue)
|
||||||
|
stdstyle.syntaxerror=back:#CC0055,fore:#ffff00
|
||||||
|
|
||||||
|
# style 0
|
||||||
|
stdstyle.whitespace=$(stdstyle.bg),#808080
|
||||||
|
|
||||||
|
# styles 32 - 37
|
||||||
|
stdstyle.default=$(stdstyle.fg),$(stdstyle.bg),$(font.base)
|
||||||
|
stdstyle.linenumbers=fore:#BBFFBB,$(stdstyle.bg)
|
||||||
|
stdstyle.bracematch=fore:#0000FF,bold
|
||||||
|
stdstyle.bracemismatch=fore:#FF0000,bold
|
||||||
|
stdstyle.controlchars=fore:#808080
|
||||||
|
stdstyle.indentguides=fore:#404040,back:#800000
|
||||||
|
fold.margin.colour=#000040
|
||||||
|
fold.margin.highlight.colour=#000040
|
||||||
|
# various other SciTE system colors
|
||||||
|
caret.fore=#DDDDDD
|
||||||
|
caret.line.back=#111111
|
||||||
|
caret.line.back.alpha=50
|
||||||
|
selection.fore=#006600
|
||||||
|
selection.back=#AAAAFF
|
||||||
|
selection.alpha=
|
||||||
|
#whitespace.fore=
|
||||||
|
#whitespace.back=
|
||||||
|
#bookmark.fore=
|
||||||
|
#bookmark.back=
|
||||||
|
#bookmark.alpha=
|
||||||
|
#error.marker.fore=
|
||||||
|
#error.marker.back=
|
||||||
|
#bookmark.fore=
|
||||||
|
#bookmark.back=
|
||||||
|
#bookmark.alpha=
|
||||||
|
#fold.margin.colour
|
||||||
|
#fold.margin.highlight.colour=
|
||||||
|
#edge.colour=
|
||||||
|
|
||||||
|
# SYNTAX ELEMENTS
|
||||||
|
stdstyle.keyword1=fore:#BBEEFF
|
||||||
|
stdstyle.keyword2=fore:#FFAAFF
|
||||||
|
stdstyle.keyword3=fore:#FFAAFF
|
||||||
|
stdstyle.keyword4=fore:#FFAAFF
|
||||||
|
|
||||||
|
# identifiers (the default is often the same as default style)
|
||||||
|
stdstyle.identifier1=$(stdstyle.fg)
|
||||||
|
stdstyle.identifier2=fore:#00EEFF
|
||||||
|
stdstyle.identifier3=fore:#00CCCC
|
||||||
|
stdstyle.identifier4=fore:#EEEEEE
|
||||||
|
|
||||||
|
stdstyle.number1=fore:#FF0077
|
||||||
|
stdstyle.number2=fore:#FF0077
|
||||||
|
stdstyle.number3=fore:#FF0077
|
||||||
|
stdstyle.number4=fore:#FF0077
|
||||||
|
|
||||||
|
# a normal string; usu 1 for single-quoted, 2 for double-quoted
|
||||||
|
stdstyle.string1=fore:#FFBBBB
|
||||||
|
stdstyle.string2=fore:#FFBBBB
|
||||||
|
stdstyle.string3=fore:#0000aa
|
||||||
|
stdstyle.string4=fore:#0000aa
|
||||||
|
|
||||||
|
# a string that extends over multiple lines
|
||||||
|
stdstyle.mlstring1=fore:#FFBBBB
|
||||||
|
stdstyle.mlstring2=fore:#FFBBBB
|
||||||
|
stdstyle.mlstring3=fore:#FFBBBB
|
||||||
|
stdstyle.mlstring4=fore:#FFBBBB
|
||||||
|
stdstyle.mlstring1.bg=back:#003300,eolfilled
|
||||||
|
stdstyle.mlstring2.bg=back:#003300,eolfilled
|
||||||
|
stdstyle.mlstring3.bg=back:#003300,eolfilled
|
||||||
|
stdstyle.mlstring4.bg=back:#003300,eolfilled
|
||||||
|
|
||||||
|
# a character string
|
||||||
|
stdstyle.char1=fore:#FFBBBB
|
||||||
|
stdstyle.char2=fore:#0000aa
|
||||||
|
stdstyle.char3=fore:#0000aa
|
||||||
|
stdstyle.char4=fore:#0000aa
|
||||||
|
|
||||||
|
# a regular expression
|
||||||
|
stdstyle.regexp1=fore:#770077,$(font.monospace)
|
||||||
|
stdstyle.regexp2=fore:#770077,$(font.monospace)
|
||||||
|
stdstyle.regexp3=fore:#770077,$(font.monospace)
|
||||||
|
stdstyle.regexp4=fore:#770077,$(font.monospace)
|
||||||
|
stdstyle.regexp1.bg=back:#003300,eolfilled
|
||||||
|
stdstyle.regexp2.bg=back:#003300,eolfilled
|
||||||
|
stdstyle.regexp3.bg=back:#003300,eolfilled
|
||||||
|
stdstyle.regexp4.bg=back:#003300,eolfilled
|
||||||
|
|
||||||
|
stdstyle.stringerror=$(stdstyle.syntaxerror),eolfilled
|
||||||
|
|
||||||
|
# a normal block comment
|
||||||
|
stdstyle.comment=fore:#00FF00,$(font.comment)
|
||||||
|
stdstyle.comment1=$(stdstyle.comment)
|
||||||
|
stdstyle.comment2=$(stdstyle.comment)
|
||||||
|
stdstyle.comment3=$(stdstyle.comment)
|
||||||
|
stdstyle.comment4=$(stdstyle.comment)
|
||||||
|
stdstyle.comment1.bg=back:#003300,eolfilled
|
||||||
|
stdstyle.comment2.bg=back:#220022,eolfilled
|
||||||
|
stdstyle.comment3.bg=back:#003300,eolfilled
|
||||||
|
stdstyle.comment4.bg=back:#220022,eolfilled
|
||||||
|
|
||||||
|
# a normal comment that extends to EOL
|
||||||
|
stdstyle.eolcomment1=$(stdstyle.comment)
|
||||||
|
stdstyle.eolcomment2=fore:#557755
|
||||||
|
stdstyle.eolcomment3=fore:#007700,$(font.comment)
|
||||||
|
stdstyle.eolcomment4=fore:#007700,$(font.comment)
|
||||||
|
|
||||||
|
# a doc-comment
|
||||||
|
stdstyle.doccomment1=fore:#007700,$(font.comment)
|
||||||
|
stdstyle.doccomment2=fore:#007700,$(font.comment)
|
||||||
|
stdstyle.doccomment3=fore:#007700,$(font.comment)
|
||||||
|
stdstyle.doccomment4=fore:#007700,$(font.comment)
|
||||||
|
stdstyle.doccomment1.bg=back:#003300,eolfilled
|
||||||
|
stdstyle.doccomment2.bg=back:#220022,eolfilled
|
||||||
|
stdstyle.doccomment3.bg=back:#003300,eolfilled
|
||||||
|
stdstyle.doccomment4.bg=back:#220022,eolfilled
|
||||||
|
|
||||||
|
# a keyword inside doc-comment
|
||||||
|
stdstyle.dockeyword1=fore:#00AAAA,$(font.comment)
|
||||||
|
stdstyle.dockeyword2=fore:#00AAAA,$(font.comment)
|
||||||
|
stdstyle.dockeyword3=fore:#00AAAA,$(font.comment)
|
||||||
|
stdstyle.dockeyword4=fore:#00AAAA,$(font.comment)
|
||||||
|
stdstyle.dockeyworderror=fore:#AA3333,$(font.comment)
|
||||||
|
|
||||||
|
# other blocks
|
||||||
|
stdstyle.otherblock1=fore:#0000aa
|
||||||
|
stdstyle.otherblock2=fore:#0000aa
|
||||||
|
stdstyle.otherblock3=fore:#0000aa
|
||||||
|
stdstyle.otherblock4=fore:#0000aa
|
||||||
|
stdstyle.otherblock1.bg=back:#333300
|
||||||
|
stdstyle.otherblock2.bg=back:#333300
|
||||||
|
stdstyle.otherblock3.bg=back:#333300
|
||||||
|
stdstyle.otherblock4.bg=back:#333300
|
||||||
|
|
||||||
|
stdstyle.preprocessor1=fore:#555555
|
||||||
|
stdstyle.preprocessor2=fore:#555555
|
||||||
|
stdstyle.preprocessor3=fore:#555555
|
||||||
|
stdstyle.preprocessor4=fore:#555555
|
||||||
|
|
||||||
|
stdstyle.operator1=$(stdstyle.fg)
|
||||||
|
stdstyle.operator2=$(stdstyle.fg)
|
||||||
|
stdstyle.operator3=$(stdstyle.fg)
|
||||||
|
stdstyle.operator4=$(stdstyle.fg)
|
||||||
|
|
||||||
|
stdstyle.importantoperator1=fore:#CC00CC
|
||||||
|
stdstyle.importantoperator2=fore:#00CC00
|
||||||
|
stdstyle.importantoperator3=fore:#AAAA00
|
||||||
|
stdstyle.importantoperator4=fore:#CCAA00
|
||||||
|
|
||||||
|
# internal processing: visual brace matching
|
||||||
|
stdstyle.bracematch1=$(stdstyle.bracematch)
|
||||||
|
stdstyle.bracematch2=$(stdstyle.bracematch)
|
||||||
|
stdstyle.bracematch3=$(stdstyle.bracematch)
|
||||||
|
stdstyle.bracematch4=$(stdstyle.bracematch)
|
||||||
|
stdstyle.bracemismatch1=$(stdstyle.bracemismatch)
|
||||||
|
stdstyle.bracemismatch2=$(stdstyle.bracemismatch)
|
||||||
|
stdstyle.bracemismatch3=$(stdstyle.bracemismatch)
|
||||||
|
stdstyle.bracemismatch4=$(stdstyle.bracemismatch)
|
||||||
|
|
||||||
|
# class/method decorator
|
||||||
|
stdstyle.decorator1=fore:#00DDDD
|
||||||
|
stdstyle.decorator2=fore:#00DDDD
|
||||||
|
stdstyle.decorator3=fore:#00DDDD
|
||||||
|
stdstyle.decorator4=fore:#00DDDD
|
||||||
|
|
||||||
|
stdstyle.visualbreak1=fore:#FFFF40,back:#AAAAAA,eolfilled
|
||||||
|
stdstyle.visualbreak2=fore:#FFFF40,back:#770077,eolfilled
|
||||||
|
stdstyle.visualbreak3=fore:#FFFF40,back:#AAAAAA,eolfilled
|
||||||
|
stdstyle.visualbreak4=fore:#FFFF40,back:#770077,eolfilled
|
||||||
|
|
||||||
|
# Error messages
|
||||||
|
stdstyle.error=fore:#FFBBBB
|
||||||
|
stdstyle.command=fore:#BBBBFF
|
||||||
|
|
||||||
|
stdstyle.diff1=fore:#007F00
|
||||||
|
stdstyle.diff2=fore:#7F7F00
|
||||||
|
stdstyle.diff3=fore:#7F0000
|
||||||
|
stdstyle.diff4=fore:#7F007F
|
||||||
|
stdstyle.diff5=fore:#007F7F
|
||||||
|
stdstyle.diff6=fore:#00007F
|
||||||
|
|
||||||
|
#Debugger markers
|
||||||
|
stdcolor.active=#408040
|
||||||
|
stdcolor.error=#804040
|
||||||
|
|
After Width: | Height: | Size: 1.4 KiB |
|
@ -0,0 +1,181 @@
|
||||||
|
stdstyle.fg=fore:#000000
|
||||||
|
stdstyle.bg=back:#FFFFFF
|
||||||
|
stdstyle.syntaxerror=back:#CC0055,fore:#ffff00
|
||||||
|
|
||||||
|
# style 0
|
||||||
|
stdstyle.whitespace=$(stdstyle.bg),#808080
|
||||||
|
|
||||||
|
# styles 32 - 37
|
||||||
|
stdstyle.default=$(stdstyle.fg),$(stdstyle.bg),$(font.base)
|
||||||
|
stdstyle.linenumbers=fore:#000077,back:#CCCCCC
|
||||||
|
stdstyle.bracematch=fore:#0000FF,bold
|
||||||
|
stdstyle.bracemismatch=fore:#FF0000,bold
|
||||||
|
stdstyle.controlchars=$(stdstyle.default)
|
||||||
|
stdstyle.indentguides=$(stdstyle.default)
|
||||||
|
|
||||||
|
# various other SciTE system colors
|
||||||
|
caret.fore=#000000
|
||||||
|
caret.line.back=#9999BB
|
||||||
|
caret.line.back.alpha=32
|
||||||
|
selection.fore=#003000
|
||||||
|
selection.back=#bbbbbb
|
||||||
|
selection.alpha=
|
||||||
|
#whitespace.fore=
|
||||||
|
#whitespace.back=
|
||||||
|
#bookmark.fore=
|
||||||
|
#bookmark.back=
|
||||||
|
#bookmark.alpha=
|
||||||
|
#error.marker.fore=
|
||||||
|
#error.marker.back=
|
||||||
|
#bookmark.fore=
|
||||||
|
#bookmark.back=
|
||||||
|
#bookmark.alpha=
|
||||||
|
#fold.margin.colour
|
||||||
|
#fold.margin.highlight.colour=
|
||||||
|
#edge.colour=
|
||||||
|
|
||||||
|
# SYNTAX ELEMENTS
|
||||||
|
stdstyle.keywordx=fore:#000080
|
||||||
|
stdstyle.keyword1=$(colour.keyword),bold
|
||||||
|
stdstyle.keyword2=$(stdstyle.keywordx)
|
||||||
|
stdstyle.keyword3=$(stdstyle.keywordx)
|
||||||
|
stdstyle.keyword4=$(stdstyle.keywordx)
|
||||||
|
|
||||||
|
# identifiers (the default is often the same as default style)
|
||||||
|
stdstyle.identifier1=$(stdstyle.fg)
|
||||||
|
stdstyle.identifier2=fore:#005555
|
||||||
|
stdstyle.identifier3=fore:#003333
|
||||||
|
stdstyle.identifier4=fore:#111111
|
||||||
|
|
||||||
|
stdstyle.number1=$(colour.number)
|
||||||
|
stdstyle.number2=fore:#770077
|
||||||
|
stdstyle.number3=fore:#770077
|
||||||
|
stdstyle.number4=fore:#770077
|
||||||
|
|
||||||
|
# a normal string; usu 1 for single-quoted, 2 for double-quoted
|
||||||
|
stdstyle.string1=$(colour.char)
|
||||||
|
stdstyle.string2=$(colour.string)
|
||||||
|
stdstyle.string3=fore:#0000aa
|
||||||
|
stdstyle.string4=fore:#0000aa
|
||||||
|
|
||||||
|
# a string that extends over multiple lines
|
||||||
|
stdstyle.mlstring1=fore:#990099
|
||||||
|
stdstyle.mlstring2=fore:#990099
|
||||||
|
stdstyle.mlstring3=fore:#990099
|
||||||
|
stdstyle.mlstring4=fore:#990099
|
||||||
|
stdstyle.mlstring1.bg=back:#FFEEFF,eolfilled
|
||||||
|
stdstyle.mlstring2.bg=back:#FFEEFF,eolfilled
|
||||||
|
stdstyle.mlstring3.bg=back:#FFEEFF,eolfilled
|
||||||
|
stdstyle.mlstring4.bg=back:#FFEEFF,eolfilled
|
||||||
|
|
||||||
|
# a character string
|
||||||
|
stdstyle.char1=fore:#0000aa
|
||||||
|
stdstyle.char2=fore:#0000aa
|
||||||
|
stdstyle.char3=fore:#0000aa
|
||||||
|
stdstyle.char4=fore:#0000aa
|
||||||
|
|
||||||
|
# a regular expression
|
||||||
|
stdstyle.regexp1=fore:#770077,$(font.monospace)
|
||||||
|
stdstyle.regexp2=fore:#770077,$(font.monospace)
|
||||||
|
stdstyle.regexp3=fore:#770077,$(font.monospace)
|
||||||
|
stdstyle.regexp4=fore:#770077,$(font.monospace)
|
||||||
|
stdstyle.regexp1.bg=back:#FFEEFF,eolfilled
|
||||||
|
stdstyle.regexp2.bg=back:#FFEEFF,eolfilled
|
||||||
|
stdstyle.regexp3.bg=back:#FFEEFF,eolfilled
|
||||||
|
stdstyle.regexp4.bg=back:#FFEEFF,eolfilled
|
||||||
|
|
||||||
|
stdstyle.stringerror=fore:#000040,back:#EEEEFF,eolfilled
|
||||||
|
|
||||||
|
# a normal block comment
|
||||||
|
stdstyle.comment1=fore:#007700,$(font.comment)
|
||||||
|
stdstyle.comment2=fore:#007700,$(font.comment)
|
||||||
|
stdstyle.comment3=fore:#007700,$(font.comment)
|
||||||
|
stdstyle.comment4=fore:#007700,$(font.comment)
|
||||||
|
stdstyle.comment1.bg=back:#EEFFEE,eolfilled
|
||||||
|
stdstyle.comment2.bg=back:#DDFFDD,eolfilled
|
||||||
|
stdstyle.comment3.bg=back:#EEFFEE,eolfilled
|
||||||
|
stdstyle.comment4.bg=back:#DDFFDD,eolfilled
|
||||||
|
|
||||||
|
# a normal comment that extends to EOL
|
||||||
|
stdstyle.eolcomment1=fore:#007700,$(font.comment)
|
||||||
|
stdstyle.eolcomment2=fore:#557755
|
||||||
|
stdstyle.eolcomment3=fore:#007700,$(font.comment)
|
||||||
|
stdstyle.eolcomment4=fore:#007700,$(font.comment)
|
||||||
|
|
||||||
|
# a doc-comment
|
||||||
|
stdstyle.doccomment1=fore:#007700,$(font.comment)
|
||||||
|
stdstyle.doccomment2=fore:#007700,$(font.comment)
|
||||||
|
stdstyle.doccomment3=fore:#007700,$(font.comment)
|
||||||
|
stdstyle.doccomment4=fore:#007700,$(font.comment)
|
||||||
|
stdstyle.doccomment1.bg=back:#EEFFEE,eolfilled
|
||||||
|
stdstyle.doccomment2.bg=back:#DDFFDD,eolfilled
|
||||||
|
stdstyle.doccomment3.bg=back:#EEFFEE,eolfilled
|
||||||
|
stdstyle.doccomment4.bg=back:#DDFFDD,eolfilled
|
||||||
|
|
||||||
|
# a keyword inside doc-comment
|
||||||
|
stdstyle.dockeyword1=fore:#00AAAA,$(font.comment)
|
||||||
|
stdstyle.dockeyword2=fore:#00AAAA,$(font.comment)
|
||||||
|
stdstyle.dockeyword3=fore:#00AAAA,$(font.comment)
|
||||||
|
stdstyle.dockeyword4=fore:#00AAAA,$(font.comment)
|
||||||
|
stdstyle.dockeyworderror=fore:#AA3333,$(font.comment)
|
||||||
|
|
||||||
|
# other blocks
|
||||||
|
stdstyle.otherblock1=fore:#0000aa
|
||||||
|
stdstyle.otherblock2=fore:#0000aa
|
||||||
|
stdstyle.otherblock3=fore:#0000aa
|
||||||
|
stdstyle.otherblock4=fore:#0000aa
|
||||||
|
stdstyle.otherblock1.bg=back:#eeeeff
|
||||||
|
stdstyle.otherblock2.bg=back:#eeeeff
|
||||||
|
stdstyle.otherblock3.bg=back:#eeeeff
|
||||||
|
stdstyle.otherblock4.bg=back:#eeeeff
|
||||||
|
|
||||||
|
stdstyle.preprocessor1=fore:#555555
|
||||||
|
stdstyle.preprocessor2=fore:#555555
|
||||||
|
stdstyle.preprocessor3=fore:#555555
|
||||||
|
stdstyle.preprocessor4=fore:#555555
|
||||||
|
|
||||||
|
stdstyle.operator1=$(stdstyle.fg)
|
||||||
|
stdstyle.operator2=$(stdstyle.fg)
|
||||||
|
stdstyle.operator3=$(stdstyle.fg)
|
||||||
|
stdstyle.operator4=$(stdstyle.fg)
|
||||||
|
|
||||||
|
stdstyle.importantoperator1=fore:#CC00CC
|
||||||
|
stdstyle.importantoperator2=fore:#00CC00
|
||||||
|
stdstyle.importantoperator3=fore:#AAAA00
|
||||||
|
stdstyle.importantoperator4=fore:#CCAA00
|
||||||
|
|
||||||
|
# internal processing: visual brace matching
|
||||||
|
stdstyle.bracematch1=$(stdstyle.bracematch)
|
||||||
|
stdstyle.bracematch2=$(stdstyle.bracematch)
|
||||||
|
stdstyle.bracematch3=$(stdstyle.bracematch)
|
||||||
|
stdstyle.bracematch4=$(stdstyle.bracematch)
|
||||||
|
stdstyle.bracemismatch1=$(stdstyle.bracemismatch)
|
||||||
|
stdstyle.bracemismatch2=$(stdstyle.bracemismatch)
|
||||||
|
stdstyle.bracemismatch3=$(stdstyle.bracemismatch)
|
||||||
|
stdstyle.bracemismatch4=$(stdstyle.bracemismatch)
|
||||||
|
|
||||||
|
# class/method decorator
|
||||||
|
stdstyle.decorator1=fore:#00DDDD
|
||||||
|
stdstyle.decorator2=fore:#00DDDD
|
||||||
|
stdstyle.decorator3=fore:#00DDDD
|
||||||
|
stdstyle.decorator4=fore:#00DDDD
|
||||||
|
|
||||||
|
stdstyle.visualbreak1=fore:#FFFF40,back:#AAAAAA,eolfilled
|
||||||
|
stdstyle.visualbreak2=fore:#FFFF40,back:#770077,eolfilled
|
||||||
|
stdstyle.visualbreak3=fore:#FFFF40,back:#AAAAAA,eolfilled
|
||||||
|
stdstyle.visualbreak4=fore:#FFFF40,back:#770077,eolfilled
|
||||||
|
|
||||||
|
# Error messages
|
||||||
|
stdstyle.error=fore:#FF0000
|
||||||
|
stdstyle.command=fore:#0000FF
|
||||||
|
|
||||||
|
stdstyle.diff1=fore:#007F00
|
||||||
|
stdstyle.diff2=fore:#7F7F00
|
||||||
|
stdstyle.diff3=fore:#7F0000
|
||||||
|
stdstyle.diff4=fore:#7F007F
|
||||||
|
stdstyle.diff5=fore:#007F7F
|
||||||
|
stdstyle.diff6=fore:#00007F
|
||||||
|
|
||||||
|
#Debugger markers
|
||||||
|
stdcolor.active=#AAFFAA
|
||||||
|
stdcolor.error=#FFAAAA
|
|
@ -0,0 +1,245 @@
|
||||||
|
|
||||||
|
<?xml version="1.0"?>
|
||||||
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
||||||
|
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||||
|
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||||
|
<!--Generated by scite/scripts/scommandsdoc.py -->
|
||||||
|
<style type="text/css">
|
||||||
|
table { border: 1px solid #1F1F1F; border-collapse: collapse; }
|
||||||
|
td { border: 1px solid; border-color: #E0E0E0 #000000; padding: 1px 5px 1px 5px; }
|
||||||
|
th { border: 1px solid #1F1F1F; padding: 1px 5px 1px 5px; }
|
||||||
|
thead { background-color: #000000; color: #FFFFFF; }
|
||||||
|
</style>
|
||||||
|
<body>
|
||||||
|
<h2>SciTE menu commands</h2>
|
||||||
|
<table>
|
||||||
|
<thead><td>Command</td><td>Menu text</td></thead>
|
||||||
|
<tr><td>IDM_NEW</td><td>New</td></tr>
|
||||||
|
<tr><td>IDM_OPEN</td><td>Open</td></tr>
|
||||||
|
<tr><td>IDM_OPENSELECTED</td><td>Open Selected Filename</td></tr>
|
||||||
|
<tr><td>IDM_REVERT</td><td>Revert</td></tr>
|
||||||
|
<tr><td>IDM_CLOSE</td><td>Close</td></tr>
|
||||||
|
<tr><td>IDM_SAVE</td><td>Save</td></tr>
|
||||||
|
<tr><td>IDM_SAVEAS</td><td>Save As</td></tr>
|
||||||
|
<tr><td>IDM_SAVEACOPY</td><td>Save a Copy</td></tr>
|
||||||
|
<tr><td>IDM_ENCODING_DEFAULT</td><td>Code Page Property</td></tr>
|
||||||
|
<tr><td>IDM_ENCODING_UCS2BE</td><td>UCS-2 Big Endian</td></tr>
|
||||||
|
<tr><td>IDM_ENCODING_UCS2LE</td><td>UCS-2 Little Endian</td></tr>
|
||||||
|
<tr><td>IDM_ENCODING_UTF8</td><td>UTF-8 with BOM</td></tr>
|
||||||
|
<tr><td>IDM_ENCODING_UCOOKIE</td><td>UTF-8</td></tr>
|
||||||
|
<tr><td>IDM_SAVEASHTML</td><td>As HTML</td></tr>
|
||||||
|
<tr><td>IDM_SAVEASRTF</td><td>As RTF</td></tr>
|
||||||
|
<tr><td>IDM_SAVEASPDF</td><td>As PDF</td></tr>
|
||||||
|
<tr><td>IDM_SAVEASTEX</td><td>As LaTeX</td></tr>
|
||||||
|
<tr><td>IDM_SAVEASXML</td><td>As XML</td></tr>
|
||||||
|
<tr><td>IDM_PRINTSETUP</td><td>Page Setup</td></tr>
|
||||||
|
<tr><td>IDM_PRINT</td><td>Print</td></tr>
|
||||||
|
<tr><td>IDM_LOADSESSION</td><td>Load Session</td></tr>
|
||||||
|
<tr><td>IDM_SAVESESSION</td><td>Save Session</td></tr>
|
||||||
|
<tr><td>IDM_QUIT</td><td>Exit</td></tr>
|
||||||
|
<tr><td>IDM_UNDO</td><td>Undo</td></tr>
|
||||||
|
<tr><td>IDM_REDO</td><td>Redo</td></tr>
|
||||||
|
<tr><td>IDM_CUT</td><td>Cut</td></tr>
|
||||||
|
<tr><td>IDM_COPY</td><td>Copy</td></tr>
|
||||||
|
<tr><td>IDM_PASTE</td><td>Paste</td></tr>
|
||||||
|
<tr><td>IDM_DUPLICATE</td><td>Duplicate</td></tr>
|
||||||
|
<tr><td>IDM_CLEAR</td><td>Delete</td></tr>
|
||||||
|
<tr><td>IDM_SELECTALL</td><td>Select All</td></tr>
|
||||||
|
<tr><td>IDM_COPYASRTF</td><td>Copy as RTF</td></tr>
|
||||||
|
<tr><td>IDM_MATCHBRACE</td><td>Match Brace</td></tr>
|
||||||
|
<tr><td>IDM_SELECTTOBRACE</td><td>Select to Brace</td></tr>
|
||||||
|
<tr><td>IDM_SHOWCALLTIP</td><td>Show Calltip</td></tr>
|
||||||
|
<tr><td>IDM_COMPLETE</td><td>Complete Symbol</td></tr>
|
||||||
|
<tr><td>IDM_COMPLETEWORD</td><td>Complete Word</td></tr>
|
||||||
|
<tr><td>IDM_ABBREV</td><td>Expand Abbreviation</td></tr>
|
||||||
|
<tr><td>IDM_INS_ABBREV</td><td>Insert Abbreviation</td></tr>
|
||||||
|
<tr><td>IDM_BLOCK_COMMENT</td><td>Block Comment or Uncomment</td></tr>
|
||||||
|
<tr><td>IDM_BOX_COMMENT</td><td>Box Comment</td></tr>
|
||||||
|
<tr><td>IDM_STREAM_COMMENT</td><td>Stream Comment</td></tr>
|
||||||
|
<tr><td>IDM_UPRCASE</td><td>Make Selection Uppercase</td></tr>
|
||||||
|
<tr><td>IDM_LWRCASE</td><td>Make Selection Lowercase</td></tr>
|
||||||
|
<tr><td>IDM_JOIN</td><td>Join</td></tr>
|
||||||
|
<tr><td>IDM_SPLIT</td><td>Split</td></tr>
|
||||||
|
<tr><td>IDM_FIND</td><td>Find</td></tr>
|
||||||
|
<tr><td>IDM_FINDNEXT</td><td>Find Next</td></tr>
|
||||||
|
<tr><td>IDM_FINDNEXTBACK</td><td>Find Previous</td></tr>
|
||||||
|
<tr><td>IDM_FINDINFILES</td><td>Find in Files</td></tr>
|
||||||
|
<tr><td>IDM_REPLACE</td><td>Replace</td></tr>
|
||||||
|
<tr><td>IDM_INCSEARCH</td><td>Incremental Search</td></tr>
|
||||||
|
<tr><td>IDM_GOTO</td><td>Go to</td></tr>
|
||||||
|
<tr><td>IDM_BOOKMARK_NEXT</td><td>Next Bookmark</td></tr>
|
||||||
|
<tr><td>IDM_BOOKMARK_PREV</td><td>Previous Bookmark</td></tr>
|
||||||
|
<tr><td>IDM_BOOKMARK_TOGGLE</td><td>Toggle Bookmark</td></tr>
|
||||||
|
<tr><td>IDM_BOOKMARK_CLEARALL</td><td>Clear All Bookmarks</td></tr>
|
||||||
|
<tr><td>IDM_EXPAND</td><td>Toggle current fold</td></tr>
|
||||||
|
<tr><td>IDM_TOGGLE_FOLDALL</td><td>Toggle all folds</td></tr>
|
||||||
|
<tr><td>IDM_FULLSCREEN</td><td>Full Screen</td></tr>
|
||||||
|
<tr><td>IDM_VIEWTOOLBAR</td><td>Tool Bar</td></tr>
|
||||||
|
<tr><td>IDM_VIEWTABBAR</td><td>Tab Bar</td></tr>
|
||||||
|
<tr><td>IDM_VIEWSTATUSBAR</td><td>Status Bar</td></tr>
|
||||||
|
<tr><td>IDM_VIEWSPACE</td><td>Whitespace</td></tr>
|
||||||
|
<tr><td>IDM_VIEWEOL</td><td>End of Line</td></tr>
|
||||||
|
<tr><td>IDM_VIEWGUIDES</td><td>Indentation Guides</td></tr>
|
||||||
|
<tr><td>IDM_LINENUMBERMARGIN</td><td>Line Numbers</td></tr>
|
||||||
|
<tr><td>IDM_SELMARGIN</td><td>Margin</td></tr>
|
||||||
|
<tr><td>IDM_FOLDMARGIN</td><td>Fold Margin</td></tr>
|
||||||
|
<tr><td>IDM_TOGGLEOUTPUT</td><td>Output</td></tr>
|
||||||
|
<tr><td>IDM_TOGGLEPARAMETERS</td><td>Parameters</td></tr>
|
||||||
|
<tr><td>IDM_COMPILE</td><td>Compile</td></tr>
|
||||||
|
<tr><td>IDM_BUILD</td><td>Build</td></tr>
|
||||||
|
<tr><td>IDM_GO</td><td>Go</td></tr>
|
||||||
|
<tr><td>IDM_STOPEXECUTE</td><td>Stop Executing</td></tr>
|
||||||
|
<tr><td>IDM_NEXTMSG</td><td>Next Message</td></tr>
|
||||||
|
<tr><td>IDM_PREVMSG</td><td>Previous Message</td></tr>
|
||||||
|
<tr><td>IDM_CLEAROUTPUT</td><td>Clear Output</td></tr>
|
||||||
|
<tr><td>IDM_SWITCHPANE</td><td>Switch Pane</td></tr>
|
||||||
|
<tr><td>IDM_ONTOP</td><td>Always On Top</td></tr>
|
||||||
|
<tr><td>IDM_OPENFILESHERE</td><td>Open Files Here</td></tr>
|
||||||
|
<tr><td>IDM_SPLITVERTICAL</td><td>Vertical Split</td></tr>
|
||||||
|
<tr><td>IDM_WRAP</td><td>Wrap</td></tr>
|
||||||
|
<tr><td>IDM_WRAPOUTPUT</td><td>Wrap Output</td></tr>
|
||||||
|
<tr><td>IDM_READONLY</td><td>Read-Only</td></tr>
|
||||||
|
<tr><td>IDM_EOL_CRLF</td><td>CR + LF</td></tr>
|
||||||
|
<tr><td>IDM_EOL_CR</td><td>CR</td></tr>
|
||||||
|
<tr><td>IDM_EOL_LF</td><td>LF</td></tr>
|
||||||
|
<tr><td>IDM_EOL_CONVERT</td><td>Convert Line End Characters</td></tr>
|
||||||
|
<tr><td>IDM_TABSIZE</td><td>Change Indentation Settings</td></tr>
|
||||||
|
<tr><td>IDM_MONOFONT</td><td>Use Monospaced Font</td></tr>
|
||||||
|
<tr><td>IDM_OPENLOCALPROPERTIES</td><td>Open Local Options File</td></tr>
|
||||||
|
<tr><td>IDM_OPENDIRECTORYPROPERTIES</td><td>Open Directory Options File</td></tr>
|
||||||
|
<tr><td>IDM_OPENUSERPROPERTIES</td><td>Open User Options File</td></tr>
|
||||||
|
<tr><td>IDM_OPENGLOBALPROPERTIES</td><td>Open Global Options File</td></tr>
|
||||||
|
<tr><td>IDM_OPENABBREVPROPERTIES</td><td>Open Abbreviations File</td></tr>
|
||||||
|
<tr><td>IDM_OPENLUAEXTERNALFILE</td><td>Open Lua Startup Script</td></tr>
|
||||||
|
<tr><td>IDM_PREVFILE</td><td>Previous</td></tr>
|
||||||
|
<tr><td>IDM_NEXTFILE</td><td>Next</td></tr>
|
||||||
|
<tr><td>IDM_CLOSEALL</td><td>Close All</td></tr>
|
||||||
|
<tr><td>IDM_SAVEALL</td><td>Save All</td></tr>
|
||||||
|
<tr><td>IDM_HELP</td><td>Help</td></tr>
|
||||||
|
<tr><td>IDM_HELP_SCITE</td><td>Sc1 Help</td></tr>
|
||||||
|
<tr><td>IDM_ABOUT</td><td>About Sc1</td></tr>
|
||||||
|
<tr><td>IDM_HELP_SCITE</td><td>SciTE Help</td></tr>
|
||||||
|
<tr><td>IDM_ABOUT</td><td>About SciTE</td></tr>
|
||||||
|
</table>
|
||||||
|
<h2>Scintilla key commands</h2>
|
||||||
|
<table>
|
||||||
|
<thead><td>Command</td><td>Name</td><td>Explanation</td></thead>
|
||||||
|
<tr><td>2101</td><td>AutoCCancel</td><td>Remove the auto-completion list from the screen.</td></tr>
|
||||||
|
<tr><td>2104</td><td>AutoCComplete</td><td>User has selected an item so remove the list and insert the selection.</td></tr>
|
||||||
|
<tr><td>2328</td><td>BackTab</td><td>Dedent the selected lines.</td></tr>
|
||||||
|
<tr><td>2078</td><td>BeginUndoAction</td><td>Start a sequence of actions that is undone and redone as a unit. May be nested.</td></tr>
|
||||||
|
<tr><td>2201</td><td>CallTipCancel</td><td>Remove the call tip from the screen.</td></tr>
|
||||||
|
<tr><td>2325</td><td>Cancel</td><td>Cancel any modes such as call tip or auto-completion list display.</td></tr>
|
||||||
|
<tr><td>2304</td><td>CharLeft</td><td>Move caret left one character.</td></tr>
|
||||||
|
<tr><td>2305</td><td>CharLeftExtend</td><td>Move caret left one character extending selection to new caret position.</td></tr>
|
||||||
|
<tr><td>2428</td><td>CharLeftRectExtend</td><td>Move caret left one character, extending rectangular selection to new caret position.</td></tr>
|
||||||
|
<tr><td>2306</td><td>CharRight</td><td>Move caret right one character.</td></tr>
|
||||||
|
<tr><td>2307</td><td>CharRightExtend</td><td>Move caret right one character extending selection to new caret position.</td></tr>
|
||||||
|
<tr><td>2429</td><td>CharRightRectExtend</td><td>Move caret right one character, extending rectangular selection to new caret position.</td></tr>
|
||||||
|
<tr><td>2399</td><td>ChooseCaretX</td><td>Set the last x chosen value to be the caret x position.</td></tr>
|
||||||
|
<tr><td>2180</td><td>Clear</td><td>Clear the selection.</td></tr>
|
||||||
|
<tr><td>2004</td><td>ClearAll</td><td>Delete all text in the document.</td></tr>
|
||||||
|
<tr><td>2072</td><td>ClearAllCmdKeys</td><td>Drop all key mappings.</td></tr>
|
||||||
|
<tr><td>2005</td><td>ClearDocumentStyle</td><td>Set all style bytes to 0, remove all folding information.</td></tr>
|
||||||
|
<tr><td>2408</td><td>ClearRegisteredImages</td><td>Clear all the registered XPM images.</td></tr>
|
||||||
|
<tr><td>2178</td><td>Copy</td><td>Copy the selection to the clipboard.</td></tr>
|
||||||
|
<tr><td>2177</td><td>Cut</td><td>Cut the selection to the clipboard.</td></tr>
|
||||||
|
<tr><td>2395</td><td>DelLineLeft</td><td>Delete back from the current position to the start of the line.</td></tr>
|
||||||
|
<tr><td>2396</td><td>DelLineRight</td><td>Delete forwards from the current position to the end of the line.</td></tr>
|
||||||
|
<tr><td>2335</td><td>DelWordLeft</td><td>Delete the word to the left of the caret.</td></tr>
|
||||||
|
<tr><td>2336</td><td>DelWordRight</td><td>Delete the word to the right of the caret.</td></tr>
|
||||||
|
<tr><td>2326</td><td>DeleteBack</td><td>Delete the selection or if no selection, the character before the caret.</td></tr>
|
||||||
|
<tr><td>2344</td><td>DeleteBackNotLine</td><td>Delete the selection or if no selection, the character before the caret. Will not delete the character before at the start of a line.</td></tr>
|
||||||
|
<tr><td>2318</td><td>DocumentEnd</td><td>Move caret to last position in document.</td></tr>
|
||||||
|
<tr><td>2319</td><td>DocumentEndExtend</td><td>Move caret to last position in document extending selection to new caret position.</td></tr>
|
||||||
|
<tr><td>2316</td><td>DocumentStart</td><td>Move caret to first position in document.</td></tr>
|
||||||
|
<tr><td>2317</td><td>DocumentStartExtend</td><td>Move caret to first position in document extending selection to new caret position.</td></tr>
|
||||||
|
<tr><td>2324</td><td>EditToggleOvertype</td><td>Switch from insert to overtype mode or the reverse.</td></tr>
|
||||||
|
<tr><td>2175</td><td>EmptyUndoBuffer</td><td>Delete the undo history.</td></tr>
|
||||||
|
<tr><td>2079</td><td>EndUndoAction</td><td>End a sequence of actions that is undone and redone as a unit.</td></tr>
|
||||||
|
<tr><td>2330</td><td>FormFeed</td><td>Insert a Form Feed character.</td></tr>
|
||||||
|
<tr><td>2400</td><td>GrabFocus</td><td>Set the focus to this Scintilla widget.</td></tr>
|
||||||
|
<tr><td>2312</td><td>Home</td><td>Move caret to first position on line.</td></tr>
|
||||||
|
<tr><td>2345</td><td>HomeDisplay</td><td>Move caret to first position on display line.</td></tr>
|
||||||
|
<tr><td>2346</td><td>HomeDisplayExtend</td><td>Move caret to first position on display line extending selection to new caret position.</td></tr>
|
||||||
|
<tr><td>2313</td><td>HomeExtend</td><td>Move caret to first position on line extending selection to new caret position.</td></tr>
|
||||||
|
<tr><td>2430</td><td>HomeRectExtend</td><td>Move caret to first position on line, extending rectangular selection to new caret position.</td></tr>
|
||||||
|
<tr><td>2349</td><td>HomeWrap</td><td>These are like their namesakes Home(Extend)?, LineEnd(Extend)?, VCHome(Extend)? except they behave differently when word-wrap is enabled: They go first to the start / end of the display line, like (Home|LineEnd)Display The difference is that, the cursor is already at the point, it goes on to the start or end of the document line, as appropriate for (Home|LineEnd|VCHome)(Extend)?.</td></tr>
|
||||||
|
<tr><td>2450</td><td>HomeWrapExtend</td><td>These are like their namesakes Home(Extend)?, LineEnd(Extend)?, VCHome(Extend)? except they behave differently when word-wrap is enabled: They go first to the start / end of the display line, like (Home|LineEnd)Display The difference is that, the cursor is already at the point, it goes on to the start or end of the document line, as appropriate for (Home|LineEnd|VCHome)(Extend)?.</td></tr>
|
||||||
|
<tr><td>2455</td><td>LineCopy</td><td>Copy the line containing the caret.</td></tr>
|
||||||
|
<tr><td>2337</td><td>LineCut</td><td>Cut the line containing the caret.</td></tr>
|
||||||
|
<tr><td>2338</td><td>LineDelete</td><td>Delete the line containing the caret.</td></tr>
|
||||||
|
<tr><td>2300</td><td>LineDown</td><td>Move caret down one line.</td></tr>
|
||||||
|
<tr><td>2301</td><td>LineDownExtend</td><td>Move caret down one line extending selection to new caret position.</td></tr>
|
||||||
|
<tr><td>2426</td><td>LineDownRectExtend</td><td>Move caret down one line, extending rectangular selection to new caret position.</td></tr>
|
||||||
|
<tr><td>2404</td><td>LineDuplicate</td><td>Duplicate the current line.</td></tr>
|
||||||
|
<tr><td>2314</td><td>LineEnd</td><td>Move caret to last position on line.</td></tr>
|
||||||
|
<tr><td>2347</td><td>LineEndDisplay</td><td>Move caret to last position on display line.</td></tr>
|
||||||
|
<tr><td>2348</td><td>LineEndDisplayExtend</td><td>Move caret to last position on display line extending selection to new caret position.</td></tr>
|
||||||
|
<tr><td>2315</td><td>LineEndExtend</td><td>Move caret to last position on line extending selection to new caret position.</td></tr>
|
||||||
|
<tr><td>2432</td><td>LineEndRectExtend</td><td>Move caret to last position on line, extending rectangular selection to new caret position.</td></tr>
|
||||||
|
<tr><td>2451</td><td>LineEndWrap</td><td>These are like their namesakes Home(Extend)?, LineEnd(Extend)?, VCHome(Extend)? except they behave differently when word-wrap is enabled: They go first to the start / end of the display line, like (Home|LineEnd)Display The difference is that, the cursor is already at the point, it goes on to the start or end of the document line, as appropriate for (Home|LineEnd|VCHome)(Extend)?.</td></tr>
|
||||||
|
<tr><td>2452</td><td>LineEndWrapExtend</td><td>These are like their namesakes Home(Extend)?, LineEnd(Extend)?, VCHome(Extend)? except they behave differently when word-wrap is enabled: They go first to the start / end of the display line, like (Home|LineEnd)Display The difference is that, the cursor is already at the point, it goes on to the start or end of the document line, as appropriate for (Home|LineEnd|VCHome)(Extend)?.</td></tr>
|
||||||
|
<tr><td>2342</td><td>LineScrollDown</td><td>Scroll the document down, keeping the caret visible.</td></tr>
|
||||||
|
<tr><td>2343</td><td>LineScrollUp</td><td>Scroll the document up, keeping the caret visible.</td></tr>
|
||||||
|
<tr><td>2339</td><td>LineTranspose</td><td>Switch the current line with the previous.</td></tr>
|
||||||
|
<tr><td>2302</td><td>LineUp</td><td>Move caret up one line.</td></tr>
|
||||||
|
<tr><td>2303</td><td>LineUpExtend</td><td>Move caret up one line extending selection to new caret position.</td></tr>
|
||||||
|
<tr><td>2427</td><td>LineUpRectExtend</td><td>Move caret up one line, extending rectangular selection to new caret position.</td></tr>
|
||||||
|
<tr><td>2288</td><td>LinesJoin</td><td>Join the lines in the target.</td></tr>
|
||||||
|
<tr><td>2340</td><td>LowerCase</td><td>Transform the selection to lower case.</td></tr>
|
||||||
|
<tr><td>2401</td><td>MoveCaretInsideView</td><td>Move the caret inside current view if it's not there already.</td></tr>
|
||||||
|
<tr><td>2329</td><td>NewLine</td><td>Insert a new line, may use a CRLF, CR or LF depending on EOL mode.</td></tr>
|
||||||
|
<tr><td>2172</td><td>Null</td><td>Null operation.</td></tr>
|
||||||
|
<tr><td>2322</td><td>PageDown</td><td>Move caret one page down.</td></tr>
|
||||||
|
<tr><td>2323</td><td>PageDownExtend</td><td>Move caret one page down extending selection to new caret position.</td></tr>
|
||||||
|
<tr><td>2434</td><td>PageDownRectExtend</td><td>Move caret one page down, extending rectangular selection to new caret position.</td></tr>
|
||||||
|
<tr><td>2320</td><td>PageUp</td><td>Move caret one page up.</td></tr>
|
||||||
|
<tr><td>2321</td><td>PageUpExtend</td><td>Move caret one page up extending selection to new caret position.</td></tr>
|
||||||
|
<tr><td>2433</td><td>PageUpRectExtend</td><td>Move caret one page up, extending rectangular selection to new caret position.</td></tr>
|
||||||
|
<tr><td>2413</td><td>ParaDown</td><td>Move caret between paragraphs (delimited by empty lines).</td></tr>
|
||||||
|
<tr><td>2414</td><td>ParaDownExtend</td><td>Move caret between paragraphs (delimited by empty lines).</td></tr>
|
||||||
|
<tr><td>2415</td><td>ParaUp</td><td>Move caret between paragraphs (delimited by empty lines).</td></tr>
|
||||||
|
<tr><td>2416</td><td>ParaUpExtend</td><td>Move caret between paragraphs (delimited by empty lines).</td></tr>
|
||||||
|
<tr><td>2179</td><td>Paste</td><td>Paste the contents of the clipboard into the document replacing the selection.</td></tr>
|
||||||
|
<tr><td>2011</td><td>Redo</td><td>Redoes the next action on the undo history.</td></tr>
|
||||||
|
<tr><td>2169</td><td>ScrollCaret</td><td>Ensure the caret is visible.</td></tr>
|
||||||
|
<tr><td>2366</td><td>SearchAnchor</td><td>Sets the current caret position to be the search anchor.</td></tr>
|
||||||
|
<tr><td>2013</td><td>SelectAll</td><td>Select all the text in the document.</td></tr>
|
||||||
|
<tr><td>2469</td><td>SelectionDuplicate</td><td>Duplicate the selection. If selection empty duplicate the line containing the caret.</td></tr>
|
||||||
|
<tr><td>2444</td><td>SetCharsDefault</td><td>Reset the set of characters for whitespace and word characters to the defaults.</td></tr>
|
||||||
|
<tr><td>2014</td><td>SetSavePoint</td><td>Remember the current position in the undo history as the position at which the document was saved.</td></tr>
|
||||||
|
<tr><td>3001</td><td>StartRecord</td><td>Start notifying the container of all key presses and commands.</td></tr>
|
||||||
|
<tr><td>3002</td><td>StopRecord</td><td>Stop notifying the container of all key presses and commands.</td></tr>
|
||||||
|
<tr><td>2437</td><td>StutteredPageDown</td><td>Move caret to bottom of page, or one page down if already at bottom of page.</td></tr>
|
||||||
|
<tr><td>2438</td><td>StutteredPageDownExtend</td><td>Move caret to bottom of page, or one page down if already at bottom of page, extending selection to new caret position.</td></tr>
|
||||||
|
<tr><td>2435</td><td>StutteredPageUp</td><td>Move caret to top of page, or one page up if already at top of page.</td></tr>
|
||||||
|
<tr><td>2436</td><td>StutteredPageUpExtend</td><td>Move caret to top of page, or one page up if already at top of page, extending selection to new caret position.</td></tr>
|
||||||
|
<tr><td>2058</td><td>StyleResetDefault</td><td>Reset the default style to its state at startup</td></tr>
|
||||||
|
<tr><td>2327</td><td>Tab</td><td>If selection is empty or all on one line replace the selection with a tab character. If more than one line selected, indent the lines.</td></tr>
|
||||||
|
<tr><td>2287</td><td>TargetFromSelection</td><td>Make the target range start and end be the same as the selection range start and end.</td></tr>
|
||||||
|
<tr><td>2459</td><td>ToggleCaretSticky</td><td>Switch between sticky and non-sticky: meant to be bound to a key.</td></tr>
|
||||||
|
<tr><td>2176</td><td>Undo</td><td>Undo one action in the undo history.</td></tr>
|
||||||
|
<tr><td>2341</td><td>UpperCase</td><td>Transform the selection to upper case.</td></tr>
|
||||||
|
<tr><td>2331</td><td>VCHome</td><td>Move caret to before first visible character on line. If already there move to first character on line.</td></tr>
|
||||||
|
<tr><td>2332</td><td>VCHomeExtend</td><td>Like VCHome but extending selection to new caret position.</td></tr>
|
||||||
|
<tr><td>2431</td><td>VCHomeRectExtend</td><td>Move caret to before first visible character on line. If already there move to first character on line. In either case, extend rectangular selection to new caret position.</td></tr>
|
||||||
|
<tr><td>2453</td><td>VCHomeWrap</td><td>These are like their namesakes Home(Extend)?, LineEnd(Extend)?, VCHome(Extend)? except they behave differently when word-wrap is enabled: They go first to the start / end of the display line, like (Home|LineEnd)Display The difference is that, the cursor is already at the point, it goes on to the start or end of the document line, as appropriate for (Home|LineEnd|VCHome)(Extend)?.</td></tr>
|
||||||
|
<tr><td>2454</td><td>VCHomeWrapExtend</td><td>These are like their namesakes Home(Extend)?, LineEnd(Extend)?, VCHome(Extend)? except they behave differently when word-wrap is enabled: They go first to the start / end of the display line, like (Home|LineEnd)Display The difference is that, the cursor is already at the point, it goes on to the start or end of the document line, as appropriate for (Home|LineEnd|VCHome)(Extend)?.</td></tr>
|
||||||
|
<tr><td>2308</td><td>WordLeft</td><td>Move caret left one word.</td></tr>
|
||||||
|
<tr><td>2439</td><td>WordLeftEnd</td><td>Move caret left one word, position cursor at end of word.</td></tr>
|
||||||
|
<tr><td>2440</td><td>WordLeftEndExtend</td><td>Move caret left one word, position cursor at end of word, extending selection to new caret position.</td></tr>
|
||||||
|
<tr><td>2309</td><td>WordLeftExtend</td><td>Move caret left one word extending selection to new caret position.</td></tr>
|
||||||
|
<tr><td>2390</td><td>WordPartLeft</td><td>Move to the previous change in capitalisation.</td></tr>
|
||||||
|
<tr><td>2391</td><td>WordPartLeftExtend</td><td>Move to the previous change in capitalisation extending selection to new caret position.</td></tr>
|
||||||
|
<tr><td>2392</td><td>WordPartRight</td><td>Move to the change next in capitalisation.</td></tr>
|
||||||
|
<tr><td>2393</td><td>WordPartRightExtend</td><td>Move to the next change in capitalisation extending selection to new caret position.</td></tr>
|
||||||
|
<tr><td>2310</td><td>WordRight</td><td>Move caret right one word.</td></tr>
|
||||||
|
<tr><td>2441</td><td>WordRightEnd</td><td>Move caret right one word, position cursor at end of word.</td></tr>
|
||||||
|
<tr><td>2442</td><td>WordRightEndExtend</td><td>Move caret right one word, position cursor at end of word, extending selection to new caret position.</td></tr>
|
||||||
|
<tr><td>2311</td><td>WordRightExtend</td><td>Move caret right one word extending selection to new caret position.</td></tr>
|
||||||
|
<tr><td>2333</td><td>ZoomIn</td><td>Magnify the displayed text by increasing the sizes by 1 point.</td></tr>
|
||||||
|
<tr><td>2334</td><td>ZoomOut</td><td>Make the displayed text smaller by decreasing the sizes by 1 point.</td></tr>
|
||||||
|
</table>
|
||||||
|
</body>
|
||||||
|
</html>
|
After Width: | Height: | Size: 2.5 KiB |
After Width: | Height: | Size: 24 KiB |
|
@ -0,0 +1,173 @@
|
||||||
|
<?xml version="1.0"?>
|
||||||
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
||||||
|
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||||
|
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||||
|
<head>
|
||||||
|
<meta name="generator" content="HTML Tidy, see www.w3.org" />
|
||||||
|
<meta name="generator" content="SciTE" />
|
||||||
|
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
||||||
|
<meta name="keywords" content="Scintilla, SciTE, Editing Component, Text Editor" />
|
||||||
|
<meta name="Description"
|
||||||
|
content="www.scintilla.org is the home of the Scintilla editing component and SciTE text editor application." />
|
||||||
|
<meta name="Date.Modified" content="20071122" />
|
||||||
|
<script>
|
||||||
|
function IsRemote() {
|
||||||
|
var loc = '' + window.location;
|
||||||
|
return loc.indexOf('http:') != -1;
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
<style type="text/css">
|
||||||
|
.versionlist {
|
||||||
|
color: #FFCC99;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
<title>
|
||||||
|
Scintilla and SciTE
|
||||||
|
</title>
|
||||||
|
</head>
|
||||||
|
<body bgcolor="#FFFFFF" text="#000000">
|
||||||
|
<table bgcolor="#000000" width="100%" cellspacing="0" cellpadding="0" border="0">
|
||||||
|
<tr>
|
||||||
|
<td width="256">
|
||||||
|
<img src="http://scintilla.sourceforge.net/SciTEWord.jpg" height="85" width="200" alt="Scintilla" />
|
||||||
|
</td>
|
||||||
|
<td width="40%" align="left">
|
||||||
|
<font color="#FFCC99" size="4"> A free source code editor for Win32 and
|
||||||
|
X</font>
|
||||||
|
</td>
|
||||||
|
<td width="40%" align="right">
|
||||||
|
<span class="versionlist"> Release version 1.75<br />
|
||||||
|
Site last modified November 22 2007</span>
|
||||||
|
</td>
|
||||||
|
<td width="20%">
|
||||||
|
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
<table bgcolor="#000000" width="100%" cellspacing="0" cellpadding="0" border="0">
|
||||||
|
<tr>
|
||||||
|
<td width="100%" alt="Sci Break" style="background: url(http://scintilla.sourceforge.net/SciBreak2.jpg) no-repeat;height:150px;">
|
||||||
|
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
<table bgcolor="#000000" width="100%" cellspacing="0" cellpadding="6" border="0">
|
||||||
|
<tr>
|
||||||
|
<td width="100%">
|
||||||
|
<span class="versionlist">Version 1.75 displays invalid UTF-8 bytes as hexadecimal and
|
||||||
|
can show indentation guides on completely empty lines..</span>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td width="100%">
|
||||||
|
<span class="versionlist">Version 1.74 includes Lua 5.1 and is faster for wide lines.
|
||||||
|
The session file format has changed and SciTE will not load old .ses files.</span>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td width="100%">
|
||||||
|
<span class="versionlist">Version 1.73 uses a Directory properties file to configure behaviour for
|
||||||
|
files in a directory and its subdirectories.</span>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td width="100%">
|
||||||
|
<span class="versionlist">Version 1.72 improves performance, enables incremental search on GTK+ and
|
||||||
|
allows Find in Files to ignore binary files and directories starting with ".".</span>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td width="100%">
|
||||||
|
<span class="versionlist">Version 1.71 contains minor fixes and enhancements.</span>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td width="100%">
|
||||||
|
<span class="versionlist">Version 1.70 allows, on GTK+, approximate character set conversions
|
||||||
|
for pasting and uses internationalised input at all times.</span>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
<table bgcolor="#CCCCCC" width="100%" cellspacing="0" cellpadding="8" border="0">
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
<font size="4"> <a href="http://scintilla.sourceforge.net/SciTEImage.html">Screenshot</a>
|
||||||
|
<script type="text/javascript" language="JavaScript"><!--
|
||||||
|
if (IsRemote()) {
|
||||||
|
document.write('<a href="http://scintilla.sourceforge.net/SciTEDownload.html">Download</a> ');
|
||||||
|
}
|
||||||
|
//--></script>
|
||||||
|
|
||||||
|
<a href="http://scintilla.sourceforge.net/SciTEDoc.html">
|
||||||
|
Documentation</a>
|
||||||
|
<script type="text/javascript" language="JavaScript"><!--
|
||||||
|
if (IsRemote()) {
|
||||||
|
document.write('<a href="http://scintilla.sourceforge.net/index.html">Scintilla</a> ');
|
||||||
|
}
|
||||||
|
//--></script>
|
||||||
|
<a href="http://groups.google.com/group/scite-interest/web/extras">
|
||||||
|
Extras</a>
|
||||||
|
<a href="http://scintilla.sourceforge.net/SciTETranslation.html">
|
||||||
|
Translations</a>
|
||||||
|
<a href="http://scintilla.sourceforge.net/SciTEFAQ.html">
|
||||||
|
Frequently Asked Questions</a>
|
||||||
|
</font>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
<p>
|
||||||
|
<a href="http://scintilla.sourceforge.net/SciTEDoc.html">SciTE</a> is a SCIntilla based Text Editor. Originally built to
|
||||||
|
demonstrate <a href="http://www.scintilla.org">Scintilla</a>, it has grown to be a generally useful editor with facilities for
|
||||||
|
building and running programs. It is best used for jobs with simple configurations - I use it
|
||||||
|
for building test and demonstration programs as well as SciTE and Scintilla, themselves.
|
||||||
|
</p>
|
||||||
|
<p>
|
||||||
|
SciTE is currently available for Intel Win32 and Linux compatible operating
|
||||||
|
systems with GTK+. It has been run on Windows 95, NT 4.0, Windows 2000, and on Red Hat
|
||||||
|
Linux 8 and 9 with GTK+ 1.2 and 2.0. <a href="http://scintilla.sourceforge.net/SciTEImage.html">Here is a screenshot of
|
||||||
|
SciTE.</a><br />
|
||||||
|
</p>
|
||||||
|
<p>
|
||||||
|
On Windows, there is a companion application
|
||||||
|
<a href="http://llt.chez.tiscali.fr/">Filerx</a>
|
||||||
|
which provides project management and macro features to SciTE.
|
||||||
|
</p>
|
||||||
|
<script type="text/javascript" language="JavaScript"><!--
|
||||||
|
if (IsRemote()) {
|
||||||
|
document.write('<p>You can <a href="http://scintilla.sourceforge.net/SciTEDownload.html">download Scintilla and SciTE.</a></p>');
|
||||||
|
}
|
||||||
|
//--></script>
|
||||||
|
<p>
|
||||||
|
There are some <a href="http://groups.google.com/group/scite-interest/web/extras">extra configuration files</a> that can
|
||||||
|
enhance SciTE for various languages and APIs.
|
||||||
|
</p>
|
||||||
|
<p>
|
||||||
|
The scite-interest mailing list has moved from lyra.org to Google Groups.
|
||||||
|
Questions and comments about SciTE should be directed to the
|
||||||
|
<a href="http://groups.google.com/group/scite-interest">scite-interest</a>
|
||||||
|
mailing list,
|
||||||
|
which is for discussion of SciTE and related projects, their bugs and future features.
|
||||||
|
This is a low traffic list, averaging less than 50 messages per week.
|
||||||
|
To avoid spam, only list members can write to the list.
|
||||||
|
New versions of SciTE are announced on scite-interest and may also be received by SourceForge
|
||||||
|
members by clicking on the Monitor column icon for "scite" on
|
||||||
|
<a href="https://sourceforge.net/project/showfiles.php?group_id=2439">the downloads page</a>.
|
||||||
|
Messages sent to my personal email address that could have been sent to the list
|
||||||
|
may receive no response.
|
||||||
|
<br />
|
||||||
|
</p>
|
||||||
|
<script type="text/javascript" language="JavaScript">
|
||||||
|
<!--
|
||||||
|
document.write('There is a <a href="https://sourceforge.net/project/?group_id=2439">Scintilla project page<\/a>');
|
||||||
|
document.write(' hosted on ');
|
||||||
|
if (IsRemote()) {
|
||||||
|
document.write('<a href="http://sourceforge.net">');
|
||||||
|
document.write('<img src="http://sourceforge.net/sflogo.php?group_id=2439&type=1" width="88" height="31" border="0" /><\/a> ');
|
||||||
|
} else {
|
||||||
|
document.write('<a href="http://sourceforge.net">SourceForge<\/a>');
|
||||||
|
}
|
||||||
|
//-->
|
||||||
|
</script>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
|
|
|
@ -0,0 +1,441 @@
|
||||||
|
<?xml version="1.0"?>
|
||||||
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
||||||
|
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||||
|
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||||
|
<head>
|
||||||
|
<meta name="generator" content="SciTE" />
|
||||||
|
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
||||||
|
<title>
|
||||||
|
SciTE Director Interface
|
||||||
|
</title>
|
||||||
|
<style type="text/css">
|
||||||
|
table {
|
||||||
|
border: 1px solid black;
|
||||||
|
border-collapse: collapse;
|
||||||
|
}
|
||||||
|
td {
|
||||||
|
border: 1px solid black;
|
||||||
|
padding: 1px 5px 1px 5px;
|
||||||
|
}
|
||||||
|
.S0 {
|
||||||
|
color: #808080;
|
||||||
|
}
|
||||||
|
.S1 {
|
||||||
|
font-family: Comic Sans MS;
|
||||||
|
color: #007F00;
|
||||||
|
font-size: 9pt;
|
||||||
|
}
|
||||||
|
.S2 {
|
||||||
|
font-family: Comic Sans MS;
|
||||||
|
color: #007F00;
|
||||||
|
font-size: 9pt;
|
||||||
|
}
|
||||||
|
.S3 {
|
||||||
|
font-family: Comic Sans MS;
|
||||||
|
color: #3F703F;
|
||||||
|
font-size: 9pt;
|
||||||
|
}
|
||||||
|
.S4 {
|
||||||
|
color: #007F7F;
|
||||||
|
}
|
||||||
|
.S5 {
|
||||||
|
font-weight: bold;
|
||||||
|
color: #00007F;
|
||||||
|
}
|
||||||
|
.S6 {
|
||||||
|
color: #7F007F;
|
||||||
|
}
|
||||||
|
.S7 {
|
||||||
|
color: #7F007F;
|
||||||
|
}
|
||||||
|
.S8 {
|
||||||
|
color: #804080;
|
||||||
|
}
|
||||||
|
.S9 {
|
||||||
|
color: #7F7F00;
|
||||||
|
}
|
||||||
|
.S10 {
|
||||||
|
font-weight: bold;
|
||||||
|
color: #000000;
|
||||||
|
}
|
||||||
|
.S12 {
|
||||||
|
font-family: Courier New;
|
||||||
|
color: #000000;
|
||||||
|
background: #E0C0E0;
|
||||||
|
font-size: 10pt;
|
||||||
|
}
|
||||||
|
.S13 {
|
||||||
|
font-family: Courier New;
|
||||||
|
color: #007F00;
|
||||||
|
background: #E0FFE0;
|
||||||
|
font-size: 10pt;
|
||||||
|
}
|
||||||
|
.S14 {
|
||||||
|
font-family: Courier New;
|
||||||
|
color: #3F7F3F;
|
||||||
|
background: #E0F0FF;
|
||||||
|
font-size: 10pt;
|
||||||
|
}
|
||||||
|
.S15 {
|
||||||
|
font-family: Comic Sans MS;
|
||||||
|
color: #3F703F;
|
||||||
|
font-size: 9pt;
|
||||||
|
}
|
||||||
|
SPAN {
|
||||||
|
font-family: Verdana;
|
||||||
|
font-size: 10pt;
|
||||||
|
}
|
||||||
|
.example {
|
||||||
|
color: #00A000;
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
DIV.example {
|
||||||
|
background: #F7FCF7;
|
||||||
|
border: 1px solid #C0D7C0;
|
||||||
|
margin: 0.3em 3em;
|
||||||
|
padding: 0.3em 0.6em;
|
||||||
|
font-size: 80%;
|
||||||
|
}
|
||||||
|
DIV.highlighted {
|
||||||
|
background: #F7FCF7;
|
||||||
|
border: 1px solid #C0D7C0;
|
||||||
|
margin: 0.3em 3em;
|
||||||
|
padding: 0.3em 0.6em;
|
||||||
|
font-size: 80%;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
</head>
|
||||||
|
<body bgcolor="#FFFFFF" text="#000000">
|
||||||
|
<table bgcolor="#000000" width="100%" cellspacing="0" cellpadding="0" border="0">
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
<img src="SciTEIco.png" border="3" height="64" width="64" alt="Scintilla icon" />
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<a href="index.html" style="color:white;text-decoration:none"><font size="5">
|
||||||
|
SciTE Director Interface</font></a>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
<h3>
|
||||||
|
Purpose.
|
||||||
|
</h3>
|
||||||
|
<p>Software development does not occur only at the single file level handled by SciTE.
|
||||||
|
A developer will generally work on a group of related files together in the context of one
|
||||||
|
project. Project manager functionality could be added to SciTE as it has to other editors
|
||||||
|
but this would impose a particular view of how projects are to be managed including the
|
||||||
|
format of project files. Instead, SciTE has an interface that can be used by project
|
||||||
|
managers or similar applications to control SciTE. Any application that controls SciTE is
|
||||||
|
referred to as a "Director".</p>
|
||||||
|
<p>The current Director interface only works on Windows. In the future, it should be
|
||||||
|
possible to replace the low level interface and so make this interface available on other
|
||||||
|
platforms.</p>
|
||||||
|
<p>There is currently one director application,
|
||||||
|
<a href="http://llt.chez.tiscali.fr/">Filerx</a>, available.</p>
|
||||||
|
<p>This interface is implemented on top of the
|
||||||
|
<a href="SciTEExtension.html">SciTE Extension Interface</a>, in the
|
||||||
|
file scite\win32\DirectorExtension.cxx.</p>
|
||||||
|
<h3>
|
||||||
|
Direct connection, broadcasting and explicit return addresses.
|
||||||
|
</h3>
|
||||||
|
<p>One application at a time is <i>the director</i> of SciTE,
|
||||||
|
controlling SciTE as it wishes. To support other communications techniques
|
||||||
|
applications may broadcast to all active director interfaces. When doing so,
|
||||||
|
each message should contain an explicit return address where replies to the
|
||||||
|
broadcast message will be sent.
|
||||||
|
</p>
|
||||||
|
<h3>
|
||||||
|
Low level interface on Windows.
|
||||||
|
</h3>
|
||||||
|
<p>The Windows WM_COPYDATA message is used to transfer data between
|
||||||
|
SciTE and a Director. The messages are sent between windows created by the two
|
||||||
|
applications. SciTE uses a window that has no other purpose than to receive these
|
||||||
|
messages.
|
||||||
|
The lpData and cbData fields of the COPYDATASTRUCT
|
||||||
|
are used to transfer a string between the two processes, with cbData holding the length
|
||||||
|
of the string pointed to by lpData. The string does not have to be terminated with '\0'.
|
||||||
|
The dwData should be 0.</p>
|
||||||
|
<p>Before messages can be sent from one application to the other, the window handle
|
||||||
|
of the window to receive the message must be found. This is normally transferred when
|
||||||
|
starting the other application as a command line parameter. Either application may
|
||||||
|
start the other. SciTE makes its window handle available in the WindowID
|
||||||
|
property and accepts a director.hwnd property as the window handle to which it
|
||||||
|
sends data.</p>
|
||||||
|
<p>As an example of communicating the window handle, to install Filerx in the Tools
|
||||||
|
menu of SciTE these properties could be used:</p>
|
||||||
|
<div class="example">
|
||||||
|
command.name.0.*=Project Editor<br/>
|
||||||
|
command.0.*="C:\os\scite\bin\filerx.exe" "$(FileDir)" "$(WindowID)"<br/>
|
||||||
|
command.subsystem.0.*=2
|
||||||
|
</div>
|
||||||
|
<p>In the opposite direction, Filerx can start up SciTE with a command line that
|
||||||
|
specifies its window handle as well as the file it wants edited:</p>
|
||||||
|
<div class="example">
|
||||||
|
SciTE -director.hwnd=937846 c:\os\scite\src\SciTEBase.cxx
|
||||||
|
</div>
|
||||||
|
<p>Once one application has the window handle of the other application, it should send
|
||||||
|
its window handle to the other application using an identity message as described later.
|
||||||
|
Then both sides are able to send messages.</p>
|
||||||
|
<p>To broadcast a message on Windows, the set of active director
|
||||||
|
interfaces can be found by broadcasting the "SciTEDirectorInterface"
|
||||||
|
message and seeing which windows reply with the same value as that message.
|
||||||
|
Example broadcast code:</p>
|
||||||
|
<div class="highlighted">
|
||||||
|
<SPAN class=S0></SPAN><SPAN class=S5>unsigned</SPAN><SPAN class=S0> </SPAN><SPAN class=S5>int</SPAN><SPAN class=S0> </SPAN><SPAN class=S11>SDI</SPAN><SPAN class=S0> </SPAN><SPAN class=S10>=</SPAN><SPAN class=S0> </SPAN><SPAN class=S10>::</SPAN><SPAN class=S11>RegisterWindowMessage</SPAN><SPAN class=S10>(</SPAN><SPAN class=S0></SPAN><SPAN class=S6>"SciTEDirectorInterface"</SPAN><SPAN class=S10>);</SPAN><SPAN class=S0><BR>
|
||||||
|
</SPAN><SPAN class=S11>HWND</SPAN><SPAN class=S0> </SPAN><SPAN class=S11>w</SPAN><SPAN class=S0> </SPAN><SPAN class=S10>=</SPAN><SPAN class=S0> </SPAN><SPAN class=S10>::</SPAN><SPAN class=S11>GetWindow</SPAN><SPAN class=S10>(::</SPAN><SPAN class=S11>GetDesktopWindow</SPAN><SPAN class=S10>(),</SPAN><SPAN class=S0></SPAN><SPAN class=S11>GW_CHILD</SPAN><SPAN class=S10>);</SPAN><SPAN class=S0><BR>
|
||||||
|
</SPAN><SPAN class=S5>while</SPAN><SPAN class=S0> </SPAN><SPAN class=S10>(</SPAN><SPAN class=S11>w</SPAN><SPAN class=S10>)</SPAN><SPAN class=S0> </SPAN><SPAN class=S10>{</SPAN><SPAN class=S0><BR>
|
||||||
|
</SPAN><SPAN class=S11>DWORD</SPAN><SPAN class=S0> </SPAN><SPAN class=S11>res</SPAN><SPAN class=S0> </SPAN><SPAN class=S10>=</SPAN><SPAN class=S0> </SPAN><SPAN class=S4>0</SPAN><SPAN class=S10>;</SPAN><SPAN class=S0><BR>
|
||||||
|
</SPAN><SPAN class=S2>// Need time out to avoid hung applications</SPAN><SPAN class=S0><BR>
|
||||||
|
</SPAN><SPAN class=S10>::</SPAN><SPAN class=S11>SendMessageTimeout</SPAN><SPAN class=S10>(</SPAN><SPAN class=S11>w</SPAN><SPAN class=S10>,</SPAN><SPAN class=S0> </SPAN><SPAN class=S11>SDI</SPAN><SPAN class=S10>,</SPAN><SPAN class=S0> </SPAN><SPAN class=S4>0</SPAN><SPAN class=S10>,</SPAN><SPAN class=S0> </SPAN><SPAN class=S4>0</SPAN><SPAN class=S10>,</SPAN><SPAN class=S0><BR>
|
||||||
|
</SPAN><SPAN class=S11>SMTO_NORMAL</SPAN><SPAN class=S10>,</SPAN><SPAN class=S0> </SPAN><SPAN class=S4>1000</SPAN><SPAN class=S10>,</SPAN><SPAN class=S0> </SPAN><SPAN class=S10>&</SPAN><SPAN class=S11>res</SPAN><SPAN class=S10>);</SPAN><SPAN class=S0><BR>
|
||||||
|
</SPAN><SPAN class=S5>if</SPAN><SPAN class=S0> </SPAN><SPAN class=S10>(</SPAN><SPAN class=S11>res</SPAN><SPAN class=S0> </SPAN><SPAN class=S10>==</SPAN><SPAN class=S0> </SPAN><SPAN class=S5>static_cast</SPAN><SPAN class=S10><</SPAN><SPAN class=S11>DWORD</SPAN><SPAN class=S10>>(</SPAN><SPAN class=S11>SDI</SPAN><SPAN class=S10>))</SPAN><SPAN class=S0> </SPAN><SPAN class=S10>{</SPAN><SPAN class=S0><BR>
|
||||||
|
</SPAN><SPAN class=S2>// Replied with same SDI code so should</SPAN><SPAN class=S0><BR>
|
||||||
|
</SPAN><SPAN class=S2>// understand SDI's version of WM_COPYDATA</SPAN><SPAN class=S0><BR>
|
||||||
|
</SPAN><SPAN class=S10>::</SPAN><SPAN class=S11>SendMessage</SPAN><SPAN class=S10>(</SPAN><SPAN class=S11>w</SPAN><SPAN class=S10>,</SPAN><SPAN class=S11>WM_COPYDATA</SPAN><SPAN class=S10>,</SPAN><SPAN class=S0><BR>
|
||||||
|
</SPAN><SPAN class=S10>(</SPAN><SPAN class=S11>UINT</SPAN><SPAN class=S10>)</SPAN><SPAN class=S11>m_hWnd</SPAN><SPAN class=S10>,(</SPAN><SPAN class=S5>long</SPAN><SPAN class=S10>)&</SPAN><SPAN class=S11>cds</SPAN><SPAN class=S10>);</SPAN><SPAN class=S0><BR>
|
||||||
|
</SPAN><SPAN class=S10>}</SPAN><SPAN class=S0><BR>
|
||||||
|
</SPAN><SPAN class=S11>w</SPAN><SPAN class=S0> </SPAN><SPAN class=S10>=</SPAN><SPAN class=S0> </SPAN><SPAN class=S10>::</SPAN><SPAN class=S11>GetWindow</SPAN><SPAN class=S10>(</SPAN><SPAN class=S11>w</SPAN><SPAN class=S10>,</SPAN><SPAN class=S0> </SPAN><SPAN class=S11>GW_HWNDNEXT</SPAN><SPAN class=S10>);</SPAN><SPAN class=S0><BR>
|
||||||
|
</SPAN><SPAN class=S10>}</SPAN><SPAN class=S0><BR>
|
||||||
|
</SPAN>
|
||||||
|
</div>
|
||||||
|
<p>To advertise that a top level window supports the Director interface:</p>
|
||||||
|
<div class="highlighted">
|
||||||
|
<SPAN class=S0></SPAN><SPAN class=S11>LRESULT</SPAN><SPAN class=S0> </SPAN><SPAN class=S11>PASCAL</SPAN><SPAN class=S0> </SPAN><SPAN class=S11>DirectorExtension_WndProc</SPAN><SPAN class=S10>(</SPAN><SPAN class=S11>HWND</SPAN><SPAN class=S0> </SPAN><SPAN class=S11>hWnd</SPAN><SPAN class=S10>,</SPAN><SPAN class=S0> <BR>
|
||||||
|
</SPAN><SPAN class=S11>UINT</SPAN><SPAN class=S0> </SPAN><SPAN class=S11>iMessage</SPAN><SPAN class=S10>,</SPAN><SPAN class=S0> </SPAN><SPAN class=S11>WPARAM</SPAN><SPAN class=S0> </SPAN><SPAN class=S11>wParam</SPAN><SPAN class=S10>,</SPAN><SPAN class=S0> </SPAN><SPAN class=S11>LPARAM</SPAN><SPAN class=S0> </SPAN><SPAN class=S11>lParam</SPAN><SPAN class=S10>)</SPAN><SPAN class=S0> </SPAN><SPAN class=S10>{</SPAN><SPAN class=S0><BR>
|
||||||
|
</SPAN><SPAN class=S5>unsigned</SPAN><SPAN class=S0> </SPAN><SPAN class=S5>int</SPAN><SPAN class=S0> </SPAN><SPAN class=S11>SDI</SPAN><SPAN class=S0> </SPAN><SPAN class=S10>=</SPAN><SPAN class=S0> </SPAN><SPAN class=S10>::</SPAN><SPAN class=S11>RegisterWindowMessage</SPAN><SPAN class=S10>(</SPAN><SPAN class=S6>"SciTEDirectorInterface"</SPAN><SPAN class=S10>);</SPAN><SPAN class=S0><BR>
|
||||||
|
</SPAN><SPAN class=S5>if</SPAN><SPAN class=S0> </SPAN><SPAN class=S10>(</SPAN><SPAN class=S11>iMessage</SPAN><SPAN class=S0> </SPAN><SPAN class=S10>==</SPAN><SPAN class=S0> </SPAN><SPAN class=S11>SDI</SPAN><SPAN class=S10>)</SPAN><SPAN class=S0> </SPAN><SPAN class=S10>{</SPAN><SPAN class=S0><BR>
|
||||||
|
</SPAN><SPAN class=S5>return</SPAN><SPAN class=S0> </SPAN><SPAN class=S11>SDI</SPAN><SPAN class=S10>;</SPAN><SPAN class=S0><BR>
|
||||||
|
</SPAN><SPAN class=S10>}</SPAN><SPAN class=S0><BR>
|
||||||
|
</SPAN><SPAN class=S5>return</SPAN><SPAN class=S0> </SPAN><SPAN class=S10>::</SPAN><SPAN class=S11>DefWindowProc</SPAN><SPAN class=S10>(</SPAN><SPAN class=S11>hWnd</SPAN><SPAN class=S10>,</SPAN><SPAN class=S0> </SPAN><SPAN class=S11>iMessage</SPAN><SPAN class=S10>,</SPAN><SPAN class=S0> </SPAN><SPAN class=S11>wParam</SPAN><SPAN class=S10>,</SPAN><SPAN class=S0></SPAN><SPAN class=S11>lParam</SPAN><SPAN class=S10>);</SPAN><SPAN class=S0><BR>
|
||||||
|
</SPAN><SPAN class=S10>}</SPAN><BR>
|
||||||
|
</div>
|
||||||
|
<h3>
|
||||||
|
Low level interface on GTK+.
|
||||||
|
</h3>
|
||||||
|
<p>This is not yet implemented.
|
||||||
|
The proposed design uses an input fifo for each application supporting the director
|
||||||
|
interface located in /tmp with a name using a pattern such as
|
||||||
|
"/tmp/SciTE<PID>.director".
|
||||||
|
This allows enumerating all active director interfaces and also opening
|
||||||
|
a specific interface when the fifo name has been communicated through some
|
||||||
|
other means such as a command line argument or an identity: command.</p>
|
||||||
|
<h3>
|
||||||
|
High level interface.
|
||||||
|
</h3>
|
||||||
|
<p>Messages use C style escapes to represent control characters and
|
||||||
|
ensure that only visible characters are transmitted apart from the use
|
||||||
|
of '\n' to separate messages.</p>
|
||||||
|
<p>The string transmitted by the low level interface contains an optional
|
||||||
|
return address surrounded by ':' characters, an action, a ':' character and
|
||||||
|
an optional argument. The argument is often a file path. The ':' must be present even if there
|
||||||
|
is no argument. For example, SciTE understands the message</p>
|
||||||
|
<div class="example">
|
||||||
|
open:c:\\os\\scintilla\\include\\Scintilla.iface
|
||||||
|
</div>
|
||||||
|
<p>as a command to open the file "c:\os\scintilla\include\Scintilla.iface" just as if the user
|
||||||
|
had performed this operation.</p>
|
||||||
|
<p>If the first character of the message is a ':' then up to the next ':' is a return
|
||||||
|
address, so SciTE will reply to the message</p>
|
||||||
|
<div class="example">
|
||||||
|
:73658:askfilename:
|
||||||
|
</div>
|
||||||
|
<p>by sending the filename being edited to the return address 73658
|
||||||
|
rather than to its director.</p>
|
||||||
|
<h4>The actions understood by SciTE are:</h4>
|
||||||
|
<table border="1">
|
||||||
|
<tr>
|
||||||
|
<td>askfilename:</td>
|
||||||
|
<td>Return the name of the file being edited.</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>askproperty:<key></td>
|
||||||
|
<td>Return the value of a property.</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>close:</td>
|
||||||
|
<td>Close the current file.</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>closing:</td>
|
||||||
|
<td>Director is closing - SciTE closes if it was started by the director.</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>currentmacro:<string></td>
|
||||||
|
<td>Set the current macro to name.</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>cwd:</td>
|
||||||
|
<td>Change the working directory.</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>enumproperties:dyn|local|user|base|embed</td>
|
||||||
|
<td>Enumerate all the properties in the argument set.</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>exportashtml:<path></td>
|
||||||
|
<td>Save the document in HTML format as the indicated file.</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>exportasrtf:<path></td>
|
||||||
|
<td>Save the document in RTF format as the indicated file.</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>exportaspdf:<path></td>
|
||||||
|
<td>Save the document in PDF format as the indicated file.</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>exportaslatex:<path></td>
|
||||||
|
<td>Save the document in LaTeX format as the indicated file.</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>exportasxml:<path></td>
|
||||||
|
<td>Save the document in XML format as the indicated file.</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>extender:<command></td>
|
||||||
|
<td>Call the extension interface with the given command.</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>find:<string></td>
|
||||||
|
<td>Search for a string, select and show it.</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>focus:<timeStamp></td>
|
||||||
|
<td>On GTK+ bring this SciTE window to the front.
|
||||||
|
The timeStamp is from the window manager and ensures that windows are only
|
||||||
|
activated because of a user command.
|
||||||
|
Has no effect on Windows as applications on Windows can only donate focus, not take focus.</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>goto:<lineNumber>[,<columnNumber>]</td>
|
||||||
|
<td>Move caret to a particular line and make it visible.<br>
|
||||||
|
If there is a column number then select the word at that column number
|
||||||
|
or move the caret there if no word is present.</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>identity:<hwndDirector></td>
|
||||||
|
<td>Sets the director window handle to which SciTE sends messages.
|
||||||
|
The argument is in decimal.</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>insert:<value></td>
|
||||||
|
<td>Display the value in the editor pane replacing the selection.</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>loadsession:<path></td>
|
||||||
|
<td>Load a session as given by the indicated file.</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>macrocommand:<command></td>
|
||||||
|
<td>Execute a macro command.
|
||||||
|
See the SciTE source code for the syntax of the
|
||||||
|
command argument.</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>macroenable:<enable></td>
|
||||||
|
<td>If enable, display menu commands in SciTE for recording
|
||||||
|
and playing macros.</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>macrolist:<list></td>
|
||||||
|
<td>Display a list for the user to choose from.</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>menucommand:<cmd></td>
|
||||||
|
<td>Execute a menu command based on numeric ID.</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>open:<path></td>
|
||||||
|
<td>Open the indicated file.</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>output:<value></td>
|
||||||
|
<td>Display the value in the output pane replacing the selection.</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>property:<key>=<value></td>
|
||||||
|
<td>Set a property to a value.</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>quit:</td>
|
||||||
|
<td>Shut down SciTE.</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>reloadproperties:</td>
|
||||||
|
<td>Reload properties from files.</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>replaceall:<search>\000<replace></td>
|
||||||
|
<td>Replace all instances of he search string in the
|
||||||
|
document with the replace string.</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>saveas:<path></td>
|
||||||
|
<td>Save the document as the indicated file.</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>savesession:<path></td>
|
||||||
|
<td>Save a session as given by the indicated file.</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
<h4>The actions sent by SciTE are:</h4>
|
||||||
|
<table border="1">
|
||||||
|
<tr>
|
||||||
|
<td>closed:<path></td>
|
||||||
|
<td>SciTE has closed the indicated file.</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>closing:</td>
|
||||||
|
<td>SciTE is closing.</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>dyn|local|user|base|embed:<key>=<value></td>
|
||||||
|
<td>Set a property in a set to a value.</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>filename:<path></td>
|
||||||
|
<td>The file being edited is path.
|
||||||
|
This is the reply to the askfilename: command.</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>identity:<hwndSciTEReceiving></td>
|
||||||
|
<td>SciTE indicates to the director the window handle to which it should send
|
||||||
|
messages. The argument is in decimal.</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>macro:getlist</td>
|
||||||
|
<td>Retrieve the list of available macros which will be
|
||||||
|
returned by the macrolist command.</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>macro:record:<details></td>
|
||||||
|
<td>Start recording a macro.
|
||||||
|
See the SciTE source code for the syntax of the
|
||||||
|
details argument.</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>macro:run:<macroName></td>
|
||||||
|
<td>Run the named macro.</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>macro:stoprecord</td>
|
||||||
|
<td>Stop recording a macro.</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>opened:<path></td>
|
||||||
|
<td>SciTE has opened the indicated file.</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>switched:<path></td>
|
||||||
|
<td>SciTE has switched buffers to the indicated file.</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>saved:<path></td>
|
||||||
|
<td>SciTE has saved the indicated file.</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
<p>In the future, more actions will be defined. Applications should ignore any
|
||||||
|
actions that they do not understand.</p>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
|
|
|
@ -0,0 +1,151 @@
|
||||||
|
<?xml version="1.0"?>
|
||||||
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
||||||
|
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||||
|
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||||
|
<head>
|
||||||
|
<meta name="generator" content="HTML Tidy, see www.w3.org" />
|
||||||
|
<meta name="generator" content="SciTE" />
|
||||||
|
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
||||||
|
<title>
|
||||||
|
Download Scintilla and SciTE
|
||||||
|
</title>
|
||||||
|
<style type="text/css">
|
||||||
|
h3 {
|
||||||
|
background-color: #CCCCFF;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
</head>
|
||||||
|
<body bgcolor="#FFFFFF" text="#000000">
|
||||||
|
<table bgcolor="#000000" width="100%" cellspacing="0" cellpadding="0" border="0">
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
<img src="SciTEIco.png" border="3" height="64" width="64" alt="Scintilla icon" />
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<a href="index.html" style="color:white;text-decoration:none"><font size="5">Download
|
||||||
|
Scintilla and SciTE</font></a>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
<table bgcolor="#CCCCCC" width="100%" cellspacing="0" cellpadding="8" border="0">
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
<font size="4"> <a href="http://prdownloads.sourceforge.net/scintilla/scite175.zip?download">
|
||||||
|
Windows</a>
|
||||||
|
<a href="http://prdownloads.sourceforge.net/scintilla/scite175.tgz?download">
|
||||||
|
GTK+/Linux</a> </font>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
<h2>
|
||||||
|
Download
|
||||||
|
</h2>
|
||||||
|
<p>
|
||||||
|
The <a href="License.txt">license</a> for using Scintilla or SciTE is similar to that of Python
|
||||||
|
containing very few restrictions.
|
||||||
|
</p>
|
||||||
|
<h2>
|
||||||
|
Release 1.75
|
||||||
|
</h2>
|
||||||
|
<h3>
|
||||||
|
Source Code
|
||||||
|
</h3>
|
||||||
|
The source code package contains all of the source code for Scintilla and SciTE but no binary
|
||||||
|
executable code and is available in
|
||||||
|
<ul>
|
||||||
|
<li><a href="http://prdownloads.sourceforge.net/scintilla/scite175.zip?download">zip format</a> (1720K) commonly used on Windows</li>
|
||||||
|
<li><a href="http://prdownloads.sourceforge.net/scintilla/scite175.tgz?download">tgz format</a> (1500K) commonly used on Linux and compatible operating systems</li>
|
||||||
|
</ul>
|
||||||
|
Instructions for building on both Windows and Linux are included in the readme file.
|
||||||
|
<h3>
|
||||||
|
Windows
|
||||||
|
</h3>
|
||||||
|
<h4>
|
||||||
|
Windows Executables
|
||||||
|
</h4>
|
||||||
|
<p>
|
||||||
|
A <a href="http://prdownloads.sourceforge.net/scintilla/wscite175.zip?download">full download</a> (820K) includes the SciTE executable, any required DLLs,
|
||||||
|
configuration files and documentation. After downloading the file, unzip it, and run
|
||||||
|
SciTE.EXE. The files required to run SciTE are SciTE.EXE, SciLexer.DLL, and
|
||||||
|
SciTEGlobal.properties and these are best located in one directory on the path.
|
||||||
|
</p>
|
||||||
|
<p>
|
||||||
|
A <a href="http://prdownloads.sourceforge.net/scintilla/Sc175.exe">single file executable called Sc1</a> (510K) does not need any DLL or
|
||||||
|
properties files as these are linked into the executable. You may still create properties
|
||||||
|
files if you wish.
|
||||||
|
Sc1.exe has been compressed with the
|
||||||
|
<a href="http://upx.sourceforge.net">UPX compressor</a>
|
||||||
|
so that it is a fast download. It does not need to be decompressed to be used.
|
||||||
|
</p>
|
||||||
|
<h4>
|
||||||
|
Windows Installers
|
||||||
|
</h4>
|
||||||
|
<p>
|
||||||
|
<a href="http://gisdeveloper.tripod.com/scite.html">An installer that includes extensions</a>
|
||||||
|
contributed by Bruce Dodson.
|
||||||
|
</p>
|
||||||
|
<p>
|
||||||
|
<a href="http://gnuwin.epfl.ch/apps/SciTE/en/index.html">An installer for SciTE on Windows</a>
|
||||||
|
that includes several languages. Part of the GNUWin project.
|
||||||
|
</p>
|
||||||
|
<p>
|
||||||
|
<a href="http://amip.tools-for.net/SciTE-CVS.exe">A distribution</a>
|
||||||
|
based on SciTE CVS snapshots which includes C++, Perl, PHP, Java and
|
||||||
|
nncron APIs. Syntax highlighting for Perl, PHP and C++ differs from
|
||||||
|
the original distribution and there are other cosmetic changes.
|
||||||
|
Contributed by Serge Baranov.
|
||||||
|
</p>
|
||||||
|
<h3>
|
||||||
|
GTK+ / Linux
|
||||||
|
</h3>
|
||||||
|
<h4>
|
||||||
|
Linux executable for Intel compatible processors
|
||||||
|
</h4>
|
||||||
|
<p>
|
||||||
|
This binary release requires GTK+ 2.8 or later and was tested on Fedora Core 5.
|
||||||
|
If you are using a Linux distribution more than a year old you probably
|
||||||
|
need to install GTK+ 2.8 or rebuild SciTE to use your existing version of GTK+.
|
||||||
|
</p>
|
||||||
|
<p>
|
||||||
|
A <a href="http://prdownloads.sourceforge.net/scintilla/gscite175.tgz?download">full download</a> (740K) includes the SciTE executable,
|
||||||
|
configuration files and documentation.
|
||||||
|
After downloading the file, gunzip and untar it, and run
|
||||||
|
SciTE. The files required to run SciTE are SciTE which is best located on the path
|
||||||
|
(I put it in /usr/local/bin) 40 properties files which should be located in the
|
||||||
|
/usr/share/scite directory, and Sci48M.png which should be copied to /usr/share/pixmaps.
|
||||||
|
</p>
|
||||||
|
<h4>
|
||||||
|
Debian Packages
|
||||||
|
</h4>
|
||||||
|
<p>
|
||||||
|
Official Debian Packages are available from Apt.
|
||||||
|
There is a
|
||||||
|
<a href="http://packages.debian.org/etch/scite">package page</a>.
|
||||||
|
</p>
|
||||||
|
<p>
|
||||||
|
Contributed by Aubin Paul.
|
||||||
|
</p>
|
||||||
|
<h4>
|
||||||
|
Linux RPMs
|
||||||
|
</h4>
|
||||||
|
<p>
|
||||||
|
Available from
|
||||||
|
<a href="http://www.dudex.net/rpms/">this site</a>
|
||||||
|
or from <a href="https://sourceforge.net/project/showfiles.php?group_id=2439">
|
||||||
|
the SourceForge Scintilla project files</a>.
|
||||||
|
</p>
|
||||||
|
<p>
|
||||||
|
Contributions by Tony Puglisi, Victor Soroka, Eran Man.
|
||||||
|
</p>
|
||||||
|
<h3>
|
||||||
|
SciTE localised for other languages
|
||||||
|
</h3>
|
||||||
|
<p>
|
||||||
|
SciTE can be and has been <a href="SciTETranslation.html">translated into other languages</a>.
|
||||||
|
</p>
|
||||||
|
<p>
|
||||||
|
Previous versions can be downloaded from the <a href="ScintillaHistory.html">history
|
||||||
|
page</a>.
|
||||||
|
</p>
|
||||||
|
</body>
|
||||||
|
</html>
|
|
@ -0,0 +1,188 @@
|
||||||
|
<?xml version="1.0"?>
|
||||||
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
||||||
|
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||||
|
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||||
|
<head>
|
||||||
|
<meta name="generator" content="SciTE" />
|
||||||
|
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
||||||
|
<title>
|
||||||
|
SciTE Extension Interface
|
||||||
|
</title>
|
||||||
|
<style type="text/css">
|
||||||
|
.example {
|
||||||
|
color: #00A000;
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
DIV.example {
|
||||||
|
background: #F7FCF7;
|
||||||
|
border: 1px solid #C0D7C0;
|
||||||
|
margin: 0.3em 3em;
|
||||||
|
padding: 0.3em 0.6em;
|
||||||
|
font-size: 80%;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
</head>
|
||||||
|
<body bgcolor="#FFFFFF" text="#000000">
|
||||||
|
<table bgcolor="#000000" width="100%" cellspacing="0" cellpadding="0" border="0">
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
<img src="SciTEIco.png" border="3" height="64" width="64" alt="Scintilla icon" />
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<a href="index.html" style="color:white;text-decoration:none"><font size="5">
|
||||||
|
SciTE Extension Interface</font></a>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
<h3>
|
||||||
|
Purpose.
|
||||||
|
</h3>
|
||||||
|
<p>Some people want to create enhanced versions of the SciTE editor, while
|
||||||
|
still receiving the benefits of new SciTE features. This could be for an
|
||||||
|
editor designed for a particular environment such as developing games,
|
||||||
|
to incorporate a scripting capability within SciTE or to allow SciTE to be
|
||||||
|
controlled by another process through an IPC mechanism.</p>
|
||||||
|
<p>There are two example extensions.
|
||||||
|
The <a href="SciTEDirector.html">SciTE Director Interface</a> allows
|
||||||
|
SciTE on Windows to be controlled by an external application such as a
|
||||||
|
project manager.
|
||||||
|
The <a href="SciTELua.html">SciTE Lua Scripting Extension</a> is an
|
||||||
|
integration of the Lua scripting language into SciTE, done using the Extension
|
||||||
|
interface.</p>
|
||||||
|
<h3>
|
||||||
|
Extension Interface.
|
||||||
|
</h3>
|
||||||
|
<div class="example">
|
||||||
|
bool Initialise(ExtensionAPI *host_);<br />
|
||||||
|
bool Finalise();<br />
|
||||||
|
bool Clear();<br />
|
||||||
|
bool Load(const char *filename);<br />
|
||||||
|
bool InitBuffer(int index);<br />
|
||||||
|
bool ActivateBuffer(int index);<br />
|
||||||
|
bool RemoveBuffer(int index);<br />
|
||||||
|
bool OnOpen(const char *path);<br />
|
||||||
|
bool OnSwitchFile(const char *path);<br />
|
||||||
|
bool OnSave(const char *path);<br />
|
||||||
|
bool OnChar(char ch);<br />
|
||||||
|
bool OnExecute(const char *s);<br />
|
||||||
|
bool OnSavePointReached();<br />
|
||||||
|
bool OnSavePointLeft();<br />
|
||||||
|
bool OnStyle(unsigned int, int, int, Accessor *);<br />
|
||||||
|
bool OnDoubleClick();<br />
|
||||||
|
bool OnUpdateUI();<br />
|
||||||
|
bool OnMarginClick();<br />
|
||||||
|
bool OnMacro(const char *, const char *);<br />
|
||||||
|
bool SendProperty(const char *);<br />
|
||||||
|
bool OnKey(int keyval, int modifiers);<br />
|
||||||
|
bool OnDwellStart(int pos, const char *word);<br />
|
||||||
|
bool OnClose(const char *filename);<br />
|
||||||
|
</div>
|
||||||
|
<p>An extension must implement the Extension interface defined in scite/src/Extender.h
|
||||||
|
Only the first 4 methods must be implemented although an implementation can be as
|
||||||
|
simple as just returning false. The other methods have empty default implementations.
|
||||||
|
Methods added to this interface in the future should have default implementations so
|
||||||
|
existing extensions will continue to compile.</p>
|
||||||
|
<p>Each method returns a bool indicating whether the method handled all processing that
|
||||||
|
is needed and so no additional processing is required. Normally, false is returned to indicate
|
||||||
|
that further processing may be done.</p>
|
||||||
|
<p>The extension should use the Initialise and Finalise methods to allocate
|
||||||
|
and deallocate resources. The ExtensionAPI pointer should be saved in the
|
||||||
|
Initialise method so the extension can communicate back to SciTE.</p>
|
||||||
|
<p>The Clear and Load methods are used to support extensions that need
|
||||||
|
to load a resource such as a script file when a file is opened. When a file is
|
||||||
|
opened in SciTE, first the extension is asked to clear any data associated with
|
||||||
|
the previous file through Clear. Then SciTE checks for a property called
|
||||||
|
"extension" which matches the file name, so for x.cpp, looks for extension.*.cpp.
|
||||||
|
A file with this name is searched for in standard property file locations and if found
|
||||||
|
Load is called with the path as an argument.</p>
|
||||||
|
<p>The InitBuffer, ActivateBuffer, and RemoveBuffer methods provide the necessary hooks
|
||||||
|
so that extensions have a mechanism to associate data with a specific buffer, similar
|
||||||
|
to the way SciTE itself remembers the monospace setting of each buffer. InitBuffer is
|
||||||
|
called whenever a new document is opened in a given buffer. The buffer might be a newly
|
||||||
|
allocated one, or it might be recycled if the maximum number of buffers has been reached.
|
||||||
|
Once the buffer has been initialized, it will be the active buffer. Thereafter,
|
||||||
|
ActivateBuffer is called whenever the user switches to another loaded buffer.
|
||||||
|
RemoveBuffer is called when an existing buffer is closed. Thereafter, the indexes of
|
||||||
|
the buffers that come after the removed buffer are shifted down by one. After
|
||||||
|
RemoveBuffer, the extension will receive an InitBuffer or ActivateBuffer to establish
|
||||||
|
the new active buffer.</p>
|
||||||
|
<p>OnExecute is called only when an extension command is executed. These are
|
||||||
|
indicated in properties as subsystem 3.</p>
|
||||||
|
<p>Other methods are called upon events occurring in SciTE allowing an extension
|
||||||
|
to respond to those events.</p>
|
||||||
|
<h3>
|
||||||
|
ExtensionAPI Interface.
|
||||||
|
</h3>
|
||||||
|
<div class="example">
|
||||||
|
enum Pane { paneEditor=1, paneOutput=2, paneFindOutput=3 };<br />
|
||||||
|
sptr_t Send(Pane p, unsigned int msg, uptr_t wParam=0, sptr_t lParam=0);<br />
|
||||||
|
char *Range(Pane p, int start, int end);<br />
|
||||||
|
void Remove(Pane p, int start, int end);<br />
|
||||||
|
void Insert(Pane p, int pos, const char *s);<br />
|
||||||
|
void Trace(const char *s);<br />
|
||||||
|
char *Property(const char *key);<br />
|
||||||
|
void SetProperty(const char *key, const char *val);<br />
|
||||||
|
uptr_t GetInstance();<br />
|
||||||
|
void ShutDown();<br />
|
||||||
|
void Perform(const char *actions);<br />
|
||||||
|
void DoMenuCommand(int cmdID);<br />
|
||||||
|
void UpdateStatusBar(bool bUpdateSlowData);<br />
|
||||||
|
</div>
|
||||||
|
<p>An extension can call back into SciTE using this interface which is a simplified
|
||||||
|
way to access the functionality of SciTE.</p>
|
||||||
|
<p>As well as the normal editor pane and output pane, this interface allows for
|
||||||
|
a future feature where a third pane may be used for the output of search
|
||||||
|
commands. This is currently mapped to the output pane.</p>
|
||||||
|
<p>Send allows sending messages to the Scintilla control contained in each pane.</p>
|
||||||
|
<p>Range retrieves text from the pane. This must be deleted with delete[].
|
||||||
|
Remove and Insert are used to remove and insert text in a pane.</p>
|
||||||
|
<p>Trace displays a string at the end of the output pane.</p>
|
||||||
|
<p>SciTE's properties can be read and written with Property and
|
||||||
|
SetProperty. The result from Property should be deleted with delete[].</p>
|
||||||
|
<p>GetInstance is Windows specific and returns the HINSTANCE of
|
||||||
|
the application which is needed when accessing platform facilities.</p>
|
||||||
|
<p>ShutDown is equivalent to the user choosing the Quit menu item.
|
||||||
|
If there are any unsaved files loaded, then the user is asked whether to save them
|
||||||
|
and may cancel from this dialog. So under some circumstances, the application will
|
||||||
|
continue to run after ShutDown is called.</p>
|
||||||
|
<p>Perform takes a string containing an action, a ':' character, and an argument.
|
||||||
|
Currently the only known action is open and then the argument is a path.
|
||||||
|
This is used by the <a href="SciTEDirector.html">Director extension</a>
|
||||||
|
to relay commands from another application.
|
||||||
|
In the future more actions will be possible through this method.</p>
|
||||||
|
<h3>
|
||||||
|
Attaching the extension.
|
||||||
|
</h3>
|
||||||
|
<p>Extensions are currently added explicitly by code in the start up function.
|
||||||
|
On Windows, the DirectorExtension is attached with code similar to this simplified
|
||||||
|
example:</p>
|
||||||
|
<div class="example">
|
||||||
|
DirectorExtension director;<br />
|
||||||
|
Extension *extender = &director;<br />
|
||||||
|
//...<br />
|
||||||
|
SciTEWin MainWind(extender);
|
||||||
|
</div>
|
||||||
|
<p>It would be better to move to an implicit attachment mechanism similar to the
|
||||||
|
way lexers are attached to Scintilla, determining which extensions are used
|
||||||
|
by simply linking their object files into SciTE. It would also be good to
|
||||||
|
allow run-time attachment of extensions housed in DLLs or shared object libraries.</p>
|
||||||
|
<h3>
|
||||||
|
Multiplexing.
|
||||||
|
</h3>
|
||||||
|
<p>SciTE supports multiple extensions at a time. A multiplexer extension
|
||||||
|
maintains a list of extensions and calls each in turn for each method. Once an extension
|
||||||
|
returns true indicating processing should stop, the multiplexer returns without traversing
|
||||||
|
any remaining list members. However, for some methods such as Initialise and Finalise,
|
||||||
|
the remaining extensions are traversed regardless of the return value of the previous
|
||||||
|
extension.</p>
|
||||||
|
<h3>
|
||||||
|
Thread safety.
|
||||||
|
</h3>
|
||||||
|
<p>In general, SciTE is a single threaded application. However, on Windows, command
|
||||||
|
tools call OnExecute from a separate worker thread. The SingleThreadExtension adapter
|
||||||
|
class can be used to wrap an extension so that OnExecute calls are marshalled to the
|
||||||
|
main thread. Of course, this is not necessary if your extension is thread safe, or
|
||||||
|
if it does not implement OnExecute, or if it is a GTK-specific extension.
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
|
|
|
@ -0,0 +1,48 @@
|
||||||
|
<body bgcolor="#FFFFFF" text="#000000">
|
||||||
|
|
||||||
|
<table bgcolor="#000000" width="100%" cellspacing="0" cellpadding="0" border="0" id="table1">
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
<img src="SciTEIco.png" border="3" height="64" width="64" alt="Scintilla icon" />
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<a href="index.html" style="color:white;text-decoration:none"><font size="5">
|
||||||
|
Add an external lexer to SciTE</font></a>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
<h2>
|
||||||
|
Lexer addition.
|
||||||
|
</h2>
|
||||||
|
<p>This document assumes you know how to create a lexer. It only
|
||||||
|
covers information specific to making the changes necessary for that
|
||||||
|
lexer to work as an external lexer.</p>
|
||||||
|
<p>The lexer must export 4 functions (On Windows, it is necessary to create a
|
||||||
|
module definition file to export the symbols correctly). Below are the
|
||||||
|
proto-types for those functions (ExternalLexer.h must be included so that
|
||||||
|
EXT_LEXER_DECL can be resolved):</p>
|
||||||
|
<p>void EXT_LEXER_DECL Lex(unsigned int lexer, unsigned int startPos, int
|
||||||
|
length, int initStyle, char *words[],<br>
|
||||||
|
WindowID window, char *props);<br>
|
||||||
|
int EXT_LEXER_DECL GetLexerCount();<br>
|
||||||
|
void EXT_LEXER_DECL GetLexerName(unsigned int Index, char *name, int buflength);<br>
|
||||||
|
void EXT_LEXER_DECL Fold(unsigned int lexer, unsigned int startPos, int length,
|
||||||
|
int initStyle, char *words[],<br>
|
||||||
|
WindowID window, char *props);</p>
|
||||||
|
<p>Lex - This function is called whenever lexing needs to be done. The
|
||||||
|
first thing you may notice is the lack of an Accessor object to style with.
|
||||||
|
A WindowAccessor object can be created from the WindowID and props objects.
|
||||||
|
A PropSet object must be created from props, first, then that PropSet and the
|
||||||
|
WindowID are used to create a WindowAccessor. You will also need to create
|
||||||
|
your own WordList. (The last row in the words array is a NULL pointer, so
|
||||||
|
you can safely read 1 past the last row to determine how many rows there are).
|
||||||
|
Once you have the WordList and Accessor, you can pass them to your lexing
|
||||||
|
function just like using a built-in lexer. The only other difference is
|
||||||
|
you need to call Accessor::Flush() sometime before Lex returns, or not all text
|
||||||
|
may be updated. This is due to Scintilla's buffering.</p>
|
||||||
|
<p>GetLexerCount - This returns the number of individual lexers you want to
|
||||||
|
export from your module.</p>
|
||||||
|
<p>GetLexerName - Fill in the name field with the name of the lexer. This
|
||||||
|
is how it is later identified in SciTE properties.</p>
|
||||||
|
<p>Fold - The function called whenever SciTE requests folding be performed.
|
||||||
|
The same information found in Lex for creating a WindowAccessor apply here, too.</p>
|
|
@ -0,0 +1,201 @@
|
||||||
|
<?xml version="1.0"?>
|
||||||
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
||||||
|
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||||
|
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||||
|
<head>
|
||||||
|
<meta name="generator" content="SciTE" />
|
||||||
|
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
||||||
|
<title>
|
||||||
|
SciTE Extras
|
||||||
|
</title>
|
||||||
|
<style type="text/css">
|
||||||
|
table {
|
||||||
|
border: 1px solid black;
|
||||||
|
border-collapse: collapse;
|
||||||
|
}
|
||||||
|
td {
|
||||||
|
border: 1px solid black;
|
||||||
|
padding: 1px 5px 1px 5px;
|
||||||
|
}
|
||||||
|
th {
|
||||||
|
border: 1px solid black;
|
||||||
|
padding: 1px 5px 1px 5px;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
</head>
|
||||||
|
<body bgcolor="#FFFFFF" text="#000000">
|
||||||
|
<table bgcolor="#000000" width="100%" cellspacing="0" cellpadding="0" border="0">
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
<img src="SciTEIco.png" border="3" height="64" width="64" alt="Scintilla icon" />
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<a href="index.html" style="color:white;text-decoration:none"><font size="5">
|
||||||
|
API files and property files for SciTE</font></a>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
<h3>
|
||||||
|
This page contains various contributed files that can be used with SciTE.
|
||||||
|
</h3>
|
||||||
|
<h3>
|
||||||
|
Shells
|
||||||
|
</h3>
|
||||||
|
<ul>
|
||||||
|
<li><a href="http://llt.chez.tiscali.fr/">Filerx</a>
|
||||||
|
provides project management and macro features on Windows.</li>
|
||||||
|
<li><a href="http://www.frykholm.se/scitecmd.html">scitecmd</a>
|
||||||
|
is a simple utility for opening files as tabs in SciTE from the command line on Windows.</li>
|
||||||
|
</ul>
|
||||||
|
<h3>
|
||||||
|
APDL
|
||||||
|
</h3>
|
||||||
|
<ul>
|
||||||
|
<li><a href="http://scintilla.sourceforge.net/apdl.zip">APDL properties and API</a></li>
|
||||||
|
</ul>
|
||||||
|
<h3>
|
||||||
|
ASP
|
||||||
|
</h3>
|
||||||
|
<ul>
|
||||||
|
<li><a href="http://www.scintilla.org/asp.api">ASP API methods</a></li>
|
||||||
|
</ul>
|
||||||
|
<h3>
|
||||||
|
AutoHotkey
|
||||||
|
</h3>
|
||||||
|
<ul>
|
||||||
|
<li><a href="http://scintilla.sourceforge.net/ahk.properties">AutoHotkey properties</a></li>
|
||||||
|
</ul>
|
||||||
|
</ul>
|
||||||
|
<h3>
|
||||||
|
AutoIt3
|
||||||
|
</h3>
|
||||||
|
<ul>
|
||||||
|
<li><a href="http://www.autoitscript.com/autoit3/scite">SciTE4AutoIt3 Website containing AutoIt3 related properties and API files.</a></li>
|
||||||
|
</ul>
|
||||||
|
<h3>
|
||||||
|
C
|
||||||
|
</h3>
|
||||||
|
<ul>
|
||||||
|
<li><a href="http://scintilla.sourceforge.net/c.api">C standard library</a></li>
|
||||||
|
</ul>
|
||||||
|
<h3>
|
||||||
|
C++
|
||||||
|
</h3>
|
||||||
|
<ul>
|
||||||
|
<li><a href="http://www.nbk.orc.ru/scintilla/cpp.api.zip">Windows API</a></li>
|
||||||
|
<li><a href="http://scintilla.sourceforge.net/opengl.zip">OpenGL API</a></li>
|
||||||
|
<li><a href="http://scintilla.sourceforge.net/glut.zip">Glut API</a></li>
|
||||||
|
</ul>
|
||||||
|
<h3>
|
||||||
|
C#
|
||||||
|
</h3>
|
||||||
|
<ul>
|
||||||
|
<li><a href="http://scintilla.sourceforge.net/genapi.zip">C# API file and generator program.</a></li>
|
||||||
|
</ul>
|
||||||
|
<h3>
|
||||||
|
CIL
|
||||||
|
</h3>
|
||||||
|
<ul>
|
||||||
|
<li><a href="http://scintilla.sourceforge.net/il.properties">Properties for CIL/MSIL</a></li>
|
||||||
|
</ul>
|
||||||
|
<h3>
|
||||||
|
CMake
|
||||||
|
</h3>
|
||||||
|
<ul>
|
||||||
|
<li><a href="http://scintilla.sourceforge.net/cmake.api">CMake API</a></li>
|
||||||
|
</ul>
|
||||||
|
<h3>
|
||||||
|
FORTRAN
|
||||||
|
</h3>
|
||||||
|
<ul>
|
||||||
|
<li><a href="http://www.scintilla.org/fortran.api">Standard FORTRAN API functions</a></li>
|
||||||
|
</ul>
|
||||||
|
<h3>
|
||||||
|
Java
|
||||||
|
</h3>
|
||||||
|
<ul>
|
||||||
|
<li><a href="http://www.burgaud.com/scite.php">Java API and Java Help</a></li>
|
||||||
|
</ul>
|
||||||
|
<h3>
|
||||||
|
Lua
|
||||||
|
</h3>
|
||||||
|
<ul>
|
||||||
|
<li><a href="http://www.geocities.com/keinhong/scite/lua5api.zip">Lua 5 C API and Lua functions</a></li>
|
||||||
|
</ul>
|
||||||
|
<h3>
|
||||||
|
Microsoft SQL
|
||||||
|
</h3>
|
||||||
|
<ul>
|
||||||
|
<li><a href="http://www.scintilla.org/mssql.properties">Replaces sql.properties</a></li>
|
||||||
|
</ul>
|
||||||
|
<h3>
|
||||||
|
MySQL
|
||||||
|
</h3>
|
||||||
|
<ul>
|
||||||
|
<li><a href="http://jakub.vrana.cz/utility/scite_mysql.zip">Keywords</a></li>
|
||||||
|
</ul>
|
||||||
|
</ul>
|
||||||
|
<h3>
|
||||||
|
nncron
|
||||||
|
</h3>
|
||||||
|
<ul>
|
||||||
|
<li><a href="http://www.nbk.orc.ru/scintilla/nncron.api">nncron.api</a></li>
|
||||||
|
</ul>
|
||||||
|
<h3>
|
||||||
|
Oracle
|
||||||
|
</h3>
|
||||||
|
<ul>
|
||||||
|
<li><a href="http://scintilla.sourceforge.net/sql.properties_ext">Extended properties file</a>
|
||||||
|
with additional keywords and standard package names.</li>
|
||||||
|
</ul>
|
||||||
|
<h3>
|
||||||
|
osCommerce
|
||||||
|
</h3>
|
||||||
|
<ul>
|
||||||
|
<li><a href="http://www.rvdesign.de/index.php/SciTE">
|
||||||
|
API. German language site.</a></li>
|
||||||
|
</ul>
|
||||||
|
<h3>
|
||||||
|
Perl
|
||||||
|
</h3>
|
||||||
|
<ul>
|
||||||
|
<li><a href="http://scintilla.sourceforge.net/perl.api">Perl API</a></li>
|
||||||
|
</ul>
|
||||||
|
<h3>
|
||||||
|
PHP
|
||||||
|
</h3>
|
||||||
|
<ul>
|
||||||
|
<li><a href="http://www.scintilla.org/html.properties">html.properties</a></li>
|
||||||
|
<li><a href="http://www.scintilla.org/php.api">php.api for PHP 4.3.3</a></li>
|
||||||
|
<li><a href="http://www.scintilla.org/php.properties">PHP properties</a></li>
|
||||||
|
<li><a href="http://www.scintilla.org/phpfunctions.properties">PHP functions</a></li>
|
||||||
|
<li><a href="http://jakub.vrana.cz/utility/scite_php_t.zip">
|
||||||
|
Utilities for making PHP support files.</a></li>
|
||||||
|
<li><a href="http://scintilla.sourceforge.net/phpapi.php.txt">A script for creating api file
|
||||||
|
out of your own php source code</a></li>
|
||||||
|
</ul>
|
||||||
|
<h3>
|
||||||
|
POV-Ray
|
||||||
|
</h3>
|
||||||
|
<ul>
|
||||||
|
<li><a href="http://scintilla.sourceforge.net/pov.api">POV-Ray API</a></li>
|
||||||
|
</ul>
|
||||||
|
<h3>
|
||||||
|
TADS3
|
||||||
|
</h3>
|
||||||
|
<ul>
|
||||||
|
<li><a href="http://scintilla.sourceforge.net/tads3.properties">
|
||||||
|
TADS3 property file</a></li>
|
||||||
|
<li><a href="http://scintilla.sourceforge.net/TADS3.txt">
|
||||||
|
Explanation</a></li>
|
||||||
|
</ul>
|
||||||
|
<h3>
|
||||||
|
Windows Scripting
|
||||||
|
</h3>
|
||||||
|
<ul>
|
||||||
|
<li><a href="http://dev.remotenetworktechnology.com/SciTE/index.htm">
|
||||||
|
Properties files and scripts.</a></li>
|
||||||
|
</ul>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
|
|
|
@ -0,0 +1,312 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
||||||
|
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||||
|
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||||
|
<head>
|
||||||
|
<meta name="generator" content="HTML Tidy, see www.w3.org" />
|
||||||
|
<meta name="generator" content="SciTE" />
|
||||||
|
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
||||||
|
<title>
|
||||||
|
SciTE FAQ
|
||||||
|
</title>
|
||||||
|
<style type="text/css">
|
||||||
|
table {
|
||||||
|
border: 1px solid #1F1F1F;
|
||||||
|
border-collapse: collapse;
|
||||||
|
}
|
||||||
|
td {
|
||||||
|
border: 1px solid #1F1F1F;
|
||||||
|
padding: 1px 5px 1px 5px;
|
||||||
|
}
|
||||||
|
th {
|
||||||
|
border: 1px solid #1F1F1F;
|
||||||
|
padding: 1px 5px 1px 5px;
|
||||||
|
}
|
||||||
|
h4 {
|
||||||
|
background-color: #000000;
|
||||||
|
color: #FFFFFF;
|
||||||
|
padding: 2px 6px;
|
||||||
|
}
|
||||||
|
.example {
|
||||||
|
color: #00A000;
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
DIV.example {
|
||||||
|
background: #F7FCF7;
|
||||||
|
border: 1px solid #C0D7C0;
|
||||||
|
margin: 0.3em 3em;
|
||||||
|
padding: 0.3em 0.6em;
|
||||||
|
font-size: 80%;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
</head>
|
||||||
|
<body bgcolor="#FFFFFF" text="#000000">
|
||||||
|
<table bgcolor="#000000" width="100%" cellspacing="0" cellpadding="0" border="0" summary="banner">
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
<img src="SciTEIco.png" border="3" height="64" width="64" alt="Scintilla icon" />
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<a href="index.html" style="color:white;text-decoration:none"><font size="5">
|
||||||
|
SciTE</font></a>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
<h2>
|
||||||
|
SciTE Frequently Asked Question
|
||||||
|
</h2>
|
||||||
|
<ul>
|
||||||
|
<li><a class="toc" href="#FixedWidth">
|
||||||
|
How do I use a fixed width font for all text?</a></li>
|
||||||
|
<li><a class="toc" href="#Monospaced">
|
||||||
|
What happened to <span class="example">use.monospaced</span>?</a></li>
|
||||||
|
<li><a class="toc" href="#LineNumbers">
|
||||||
|
Why doesn't my <span class="example">line.numbers</span> setting work?</a></li>
|
||||||
|
<li><a class="toc" href="#BlackBackground">
|
||||||
|
How do I change SciTE to use black as the background colour?</a></li>
|
||||||
|
<li><a class="toc" href="#OutputColour">
|
||||||
|
How do I change the colours of the output pane?</a></li>
|
||||||
|
<li><a class="toc" href="#HorizontalScrollBar">
|
||||||
|
How do I make the horizontal scroll bar adjust to the width of text?</a></li>
|
||||||
|
<li><a class="toc" href="#TabbedMode">
|
||||||
|
How do I enable tabbed window mode in SciTE?</a></li>
|
||||||
|
<li><a class="toc" href="#Autocomplete">
|
||||||
|
How do I enable autocomplete?</a></li>
|
||||||
|
<li><a class="toc" href="#CannotFindFile">
|
||||||
|
When I try to compile/build/run my [some language] source files, I get the following error:
|
||||||
|
'The system cannot find the file specified'.</a></li>
|
||||||
|
<li><a class="toc" href="#ToolsMenu">
|
||||||
|
How can I add [some external application] to the Tools menu on SciTE?</a></li>
|
||||||
|
<li><a class="toc" href="#ToolsNoMenu">
|
||||||
|
How can I add a keyboard command without adding it to the Tools menu?</a></li>
|
||||||
|
<li><a class="toc" href="#ReplaceInFiles">
|
||||||
|
Is there a command to replace a string in multiple files together?</a></li>
|
||||||
|
<li><a class="toc" href="#SpeedUpGTK">
|
||||||
|
How do I make SciTE run faster on GTK+?</a></li>
|
||||||
|
<li><a class="toc" href="#NewlineInRegEx">
|
||||||
|
Is it possible to use the newline character (\n) in a regular expression?</a></li>
|
||||||
|
<li><a class="toc" href="#CompilerErrors">
|
||||||
|
How do I get SciTE to understand the error messages from my compiler?</a></li>
|
||||||
|
<li><a class="toc" href="#GCCUTF8">
|
||||||
|
Why do GCC error messages include ugly characters?</a></li>
|
||||||
|
<li><a class="toc" href="#WindowsSpaces">
|
||||||
|
How do I make Windows open a file associated with SciTE when its path contains spaces?</a></li>
|
||||||
|
</ul>
|
||||||
|
<h4 id="FixedWidth">
|
||||||
|
How do I use a fixed width font for all text?
|
||||||
|
</h4>
|
||||||
|
<p>
|
||||||
|
Use these properties:<div class="example">
|
||||||
|
font.base=$(font.monospace)<br />
|
||||||
|
font.small=$(font.monospace)<br />
|
||||||
|
font.comment=$(font.monospace)<br />
|
||||||
|
font.text=$(font.monospace)<br />
|
||||||
|
font.text.comment=$(font.monospace)<br />
|
||||||
|
font.embedded.base=$(font.monospace)<br />
|
||||||
|
font.embedded.comment=$(font.monospace)<br />
|
||||||
|
font.vbs=$(font.monospace)</div>
|
||||||
|
</p>
|
||||||
|
<h4 id="Monospaced">
|
||||||
|
What happened to <span class="example">use.monospaced</span>?
|
||||||
|
</h4>
|
||||||
|
<p>
|
||||||
|
The <span class="example">use.monospaced</span> property was removed as
|
||||||
|
people were using it to ask for fixed width fonts and then
|
||||||
|
requiring support to cope with its limitations. The correct way to
|
||||||
|
set fixed width fonts is <a class="toc" href="#FixedWidth">here</a>.
|
||||||
|
</p>
|
||||||
|
<h4 id="LineNumbers">
|
||||||
|
Why doesn't my <span class="example">line.numbers</span> setting work?
|
||||||
|
</h4>
|
||||||
|
<p>
|
||||||
|
<span class="example">line.numbers</span> has been replaced with two properties: <span class="example">line.margin.visible</span>
|
||||||
|
and <span class="example">line.margin.width</span> which are explained earlier in <a href="SciTEDoc.html">
|
||||||
|
the main SciTE document</a>.
|
||||||
|
</p>
|
||||||
|
<h4 id="BlackBackground">
|
||||||
|
How do I change SciTE to use black as the background colour?
|
||||||
|
</h4>
|
||||||
|
<p>
|
||||||
|
You need to change the style settings. The main change is in the user
|
||||||
|
options file to the global default style and caret colour but you may have
|
||||||
|
to change other style settings to make this work well:<div class="example">
|
||||||
|
style.*.32=$(font.base),back:#000000,fore:#ffffff<br />
|
||||||
|
style.*.33=back:#C0C0C0,$(font.base)<br />
|
||||||
|
style.*.37=fore:#939393<br />
|
||||||
|
caret.fore=#FFFFFF<br />
|
||||||
|
selection.alpha=75<br />
|
||||||
|
selection.back=#FFFFFF<br />
|
||||||
|
colour.keyword=fore:#649bff<br />
|
||||||
|
colour.operator=fore:#727272</div>
|
||||||
|
</p>
|
||||||
|
<h4 id="OutputColour">
|
||||||
|
How do I change the colours of the output pane?
|
||||||
|
</h4>
|
||||||
|
<p>
|
||||||
|
The output pane often lists error and warning messages and
|
||||||
|
is styled by the "errorlist" lexer. The default errorlist styles are found
|
||||||
|
in others.properties. To change the output pane background to black
|
||||||
|
and the default text to white set<div class="example">
|
||||||
|
style.errorlist.32=$(font.small),back:#000000<br />
|
||||||
|
style.errorlist.0=fore:#FFFFFF</div>
|
||||||
|
</p>
|
||||||
|
<h4 id="HorizontalScrollBar">
|
||||||
|
How do I make the horizontal scroll bar adjust to the width of text?
|
||||||
|
</h4>
|
||||||
|
<p>
|
||||||
|
To avoid slow performance the horizontal scroll bar does not automatically adjust.
|
||||||
|
You can use the <span class="example">horizontal.scroll.width</span> property to change the horizontal scroll range.
|
||||||
|
</p>
|
||||||
|
<h4 id="TabbedMode">
|
||||||
|
How do I enable tabbed window mode in SciTE?
|
||||||
|
</h4>
|
||||||
|
<p>
|
||||||
|
Multiple buffers must be allocated by setting, for example, <span class="example">buffers=10</span>
|
||||||
|
in your SciTEGlobal.properties. To have the tab bar visible upon starting
|
||||||
|
SciTE, set <span class="example">tabbar.visible=1</span>.
|
||||||
|
You can also set <span class="example">tabbar.hide.one=0</span> to always show tabs,
|
||||||
|
or 1 to hide when only one file is open.
|
||||||
|
<span class="example">tabbar.multiline=1</span> splits tabs across various lines if necessary.
|
||||||
|
</p>
|
||||||
|
<h4 id="Autocomplete">
|
||||||
|
How do I enable autocomplete?
|
||||||
|
</h4>
|
||||||
|
<p>
|
||||||
|
Goto Options | Open Global Options File and uncomment
|
||||||
|
<div class="example">autocompleteword.automatic=1</div>
|
||||||
|
</p>
|
||||||
|
<h4 id="CannotFindFile">
|
||||||
|
When I try to compile/build/run my [some language] source files, I get the following error:
|
||||||
|
'The system cannot find the file specified'.
|
||||||
|
</h4>
|
||||||
|
<p>
|
||||||
|
Make sure that the path to your compiler is set correctly on your system.
|
||||||
|
Try to execute from console the same command you get in SciTE and see if it works.
|
||||||
|
You can also search in your [language].properties for the compile
|
||||||
|
commands used. If you have a different compiler or use different arguments,
|
||||||
|
edit the commands to suit your needs.
|
||||||
|
The lines to look for:<div class="example">
|
||||||
|
command.compile.filepattern=<br />
|
||||||
|
command.build.filepattern=<br />
|
||||||
|
command.go.filepattern=</div>
|
||||||
|
</p>
|
||||||
|
<h4 id="ToolsMenu">
|
||||||
|
How can I add [some external application] to the Tools menu on SciTE?
|
||||||
|
</h4>
|
||||||
|
<p>
|
||||||
|
In your properties file, you'll need to add some lines:
|
||||||
|
</p>
|
||||||
|
<p>
|
||||||
|
<span class="example">command.name.number.filepattern</span><br />
|
||||||
|
(e.g.: <span class="example">command.name.1.$(file.patterns.web)=HTML Tidy</span>)<br />
|
||||||
|
This defines the Text that will appear on the Tools Menu.
|
||||||
|
</p>
|
||||||
|
<p>
|
||||||
|
<span class="example">command.number.filepattern</span><br />
|
||||||
|
(e.g.: <span class="example">command.1.$(file.patterns.web)=tidy -i -wrap 0 -m $(FilePath)</span> )<br />
|
||||||
|
This is the actual command that SciTE executes. You should provide the appropriate paths, options and parameters as you would from a command line. See SciTEDoc.html for more information on parameters and how to make SciTE prompt a Parameters Dialog.
|
||||||
|
</p>
|
||||||
|
<p>
|
||||||
|
<span class="example">command.is.filter.number.filepattern</span><br />
|
||||||
|
(e.g.: <span class="example">command.is.filter.1.$(file.patterns.web)=1</span>)<br />
|
||||||
|
The external application may have modified your file, so setting this to true makes SciTE reload the file after execution of the command.
|
||||||
|
</p>
|
||||||
|
<p>
|
||||||
|
<span class="example">command.subsystem.number.filepattern</span><br />
|
||||||
|
(e.g.: <span class="example">command.subsystem.1.$(file.patterns.web)=2</span>)<br />
|
||||||
|
This is for Windows and defines the subsystem through which the program is called. See SciTEDoc.html for more information on this.
|
||||||
|
</p>
|
||||||
|
<p>
|
||||||
|
You can set a command for all files using * as a file pattern. Up to 10 commands (0 - 9) can be defined in the Tools Menu at any time. Commands also get executed with Ctrl+number.
|
||||||
|
</p>
|
||||||
|
<h4 id="ToolsNoMenu">
|
||||||
|
How can I add a keyboard command without adding it to the Tools menu?
|
||||||
|
</h4>
|
||||||
|
<p>
|
||||||
|
This is similar to <a href="#ToolsMenu">adding to the tools menu</a> except that you set the name to be empty.
|
||||||
|
Then the command is included in <span class="example">user.shortcuts</span> by adding 1100 to produce its command ID. For example,
|
||||||
|
<div class="example">
|
||||||
|
command.name.21.*.properties=<br />
|
||||||
|
command.21.*.properties=cmd /c echo $(FileNameExt)<br />
|
||||||
|
user.shortcuts=\<br />
|
||||||
|
Ctrl+Shift+V|1121|<br />
|
||||||
|
</div>
|
||||||
|
</p>
|
||||||
|
<h4 id="ReplaceInFiles">
|
||||||
|
Is there a command to replace a string in multiple files together?
|
||||||
|
</h4>
|
||||||
|
<p>
|
||||||
|
It is possible to replace a string in all opened buffers with the Replace in Buffers
|
||||||
|
button in the Replace dialog.
|
||||||
|
However this button is hidden by default, it can be displayed with
|
||||||
|
<span class="example">find.replace.advanced=1</span>.
|
||||||
|
</p>
|
||||||
|
<h4 id="SpeedUpGTK">
|
||||||
|
How do I make SciTE run faster on GTK+?
|
||||||
|
</h4>
|
||||||
|
<p>
|
||||||
|
The default settings for SciTE were changed in version 1.63 to use the Pango font
|
||||||
|
system and antialiased fonts. You can return to using X core fonts which are faster
|
||||||
|
with these settings:<div class="example">
|
||||||
|
font.base=font:lucidatypewriter,size:12<br />
|
||||||
|
font.small=font:lucidatypewriter,size:10<br />
|
||||||
|
font.comment=font:new century schoolbook,size:12<br />
|
||||||
|
font.code.comment.box=$(font.comment)<br />
|
||||||
|
font.code.comment.line=$(font.comment)<br />
|
||||||
|
font.code.comment.doc=$(font.comment)<br />
|
||||||
|
font.text=font:times,size:14<br />
|
||||||
|
font.text.comment=font:lucidatypewriter,size:10<br />
|
||||||
|
font.embedded.base=font:lucidatypewriter,size:12<br />
|
||||||
|
font.embedded.comment=font:lucidatypewriter,size:12<br />
|
||||||
|
font.monospace=font:courier,size:12<br />
|
||||||
|
font.vbs=font:new century schoolbook,size:12<br />
|
||||||
|
</div>
|
||||||
|
Line wrapping also slows SciTE down and this can be turned off with <span class="example">wrap=0</span>.
|
||||||
|
</p>
|
||||||
|
<h4 id="NewlineInRegEx">
|
||||||
|
Is it possible to use the newline character (\n) in a regular expression?
|
||||||
|
</h4>
|
||||||
|
<p>
|
||||||
|
No.
|
||||||
|
</p>
|
||||||
|
<p>
|
||||||
|
The "Transform backslash expressions" option allows using \n and \r but that option does
|
||||||
|
not work with regular expressions.
|
||||||
|
</p>
|
||||||
|
<h4 id="CompilerErrors">
|
||||||
|
How do I get SciTE to understand the error messages from my compiler?
|
||||||
|
</h4>
|
||||||
|
<p>
|
||||||
|
The set of error message formats is embedded in the Scintilla and SciTE code.
|
||||||
|
To add support for another compiler, you will need to add a new style to
|
||||||
|
scintilla/include/Scintilla.iface after the other SCE_ERR_* values, run HFacer.py,
|
||||||
|
edit RecogniseErrorListLine in scintilla/src/LexOthers.cxx to recognise the error message,
|
||||||
|
and edit DecodeMessage in scite/src/SciTEBuffers.cxx to extract the file name and line
|
||||||
|
number.
|
||||||
|
</p>
|
||||||
|
<h4 id="GCCUTF8">
|
||||||
|
Why do GCC error messages include ugly characters?
|
||||||
|
</h4>
|
||||||
|
<p>
|
||||||
|
Linux distributions now often set the locale to UTF-8 by, for
|
||||||
|
example, setting LANG=en_US.UTF-8. gcc takes this as an indication
|
||||||
|
that it can use any Unicode character encoded as UTF-8 so quotes using
|
||||||
|
‘these’ rather than ASCII. To see these as intended, set
|
||||||
|
<div class="example">
|
||||||
|
output.code.page=65001</div>
|
||||||
|
</p>
|
||||||
|
<h4 id="WindowsSpaces">
|
||||||
|
How do I make Windows open a file associated with SciTE when its path contains spaces?
|
||||||
|
</h4>
|
||||||
|
<p>
|
||||||
|
On some versions of Windows, associating a particular file type
|
||||||
|
with SciTE does not allow paths containing spaces to work.
|
||||||
|
To fix this, the path variable %1 needs to be surrounded by double quotes.
|
||||||
|
This is done either directly in the registry or through the Explorer in
|
||||||
|
Tools | Folder Options | File Types | (Select type) | Advanced | open | Edit.
|
||||||
|
Change the "Application used to perform action" field to be similar to
|
||||||
|
<div class="example">"C:\bin\SciTE\SciTE.exe" "%1"</div>
|
||||||
|
</p>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
|
|
After Width: | Height: | Size: 9.9 KiB |
|
@ -0,0 +1,28 @@
|
||||||
|
<?xml version="1.0"?>
|
||||||
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
||||||
|
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||||
|
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||||
|
<head>
|
||||||
|
<meta name="generator" content="HTML Tidy, see www.w3.org" />
|
||||||
|
<meta name="generator" content="SciTE" />
|
||||||
|
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
||||||
|
<title>
|
||||||
|
Scintilla and SciTE
|
||||||
|
</title>
|
||||||
|
</head>
|
||||||
|
<body bgcolor="#FFFFFF" text="#000000">
|
||||||
|
<table bgcolor="#000000" width="100%" cellspacing="0" cellpadding="0" border="0">
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
<img src="SciTEIco.png" border="3" height="64" width="64" alt="Scintilla icon" />
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<a href="index.html" style="color:white;text-decoration:none"><font size="5">Scintilla
|
||||||
|
and SciTE</font></a>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
<br />
|
||||||
|
<img src="demo.png" />
|
||||||
|
</body>
|
||||||
|
</html>
|
|
@ -0,0 +1,112 @@
|
||||||
|
<?xml version="1.0"?>
|
||||||
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
||||||
|
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||||
|
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||||
|
<head>
|
||||||
|
<meta name="generator" content="HTML Tidy, see www.w3.org" />
|
||||||
|
<meta name="generator" content="SciTE" />
|
||||||
|
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
||||||
|
<title>
|
||||||
|
Download Scintilla and SciTE
|
||||||
|
</title>
|
||||||
|
</head>
|
||||||
|
<body bgcolor="#FFFFFF" text="#000000">
|
||||||
|
<table bgcolor="#000000" width="100%" cellspacing="0" cellpadding="0" border="0">
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
<img src="SciTEIco.png" border="3" height="64" width="64" alt="Scintilla icon" />
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<a href="index.html" style="color:white;text-decoration:none"><font size="5">
|
||||||
|
Add a lexer to Scintilla and SciTE</font></a>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
<h2>
|
||||||
|
Lexer addition.
|
||||||
|
</h2>
|
||||||
|
<p>The process of adding a new lexer to both Scintilla and SciTE
|
||||||
|
is fairly long. Here is my response when asked how to add a lexer for
|
||||||
|
Apache CONF files to SciTE. There is more information on writing the
|
||||||
|
lexer code (steps 4 and 5, here) in the documentation for Scintilla.</p>
|
||||||
|
<p>
|
||||||
|
Don't bother about steps which are for configurations you don't
|
||||||
|
use all 6 makefiles - I'll patch them up later if you want to
|
||||||
|
contribute the lexer.</p>
|
||||||
|
<ol>
|
||||||
|
<li>
|
||||||
|
In scintilla/include/Scintilla.iface, add a lexer ID value:<br />
|
||||||
|
val SCLEX_CONF=17
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
And any lexical class IDs:<br />
|
||||||
|
val SCE_CONF_DEFAULT=0<br />
|
||||||
|
val SCE_CONF_COMMENT=1
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
In the scintilla/include directory run HFacer.py to regenerate the
|
||||||
|
SciLexer.h file. Alternatively (if you don't want to run a Python script)
|
||||||
|
just add these values to SciLexer.h as #defines and I'll put them in
|
||||||
|
Scintilla.iface.
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
In the scintilla/src/LexOthers.cxx write a ColouriseConfDoc function
|
||||||
|
similar to one of the other functions such as ColouriseLatexDoc.<br />
|
||||||
|
static void ColouriseConfDoc (unsigned int startPos, int length, int
|
||||||
|
initStyle, WordList *[], Accessor &styler) {
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
At the end of the file associate the lexer ID and name with the function:<br />
|
||||||
|
LexerModule lmConf(SCLEX_CONF, ColouriseConfDoc, "conf");
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
If this is a complex lexer then it may be better off in its own file, in
|
||||||
|
which case clone one of the current files and then add the file to all of
|
||||||
|
the make files where LexOthers is currently referenced -
|
||||||
|
scintilla/win32/makefile, scintilla/win32/scintilla.mak,
|
||||||
|
scintilla/gtk/makefile, scite/win32/makefile, and scite/win32/scite.mak.
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
To the scite/src/others.properties add an entry to associate the file
|
||||||
|
extension with the lexer:<br />
|
||||||
|
lexer.*.conf=conf<br />
|
||||||
|
If a new lexer file was created instead of adding to LexOthers, then a
|
||||||
|
new properties file should be created by cloning scite/src/others.properties
|
||||||
|
and modifying that file in the following steps.
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
Set up the styles:<br />
|
||||||
|
# Default<br />
|
||||||
|
style.conf.0=fore:#FF0000,bold<br />
|
||||||
|
# Comment<br />
|
||||||
|
style.conf.1=fore:#007F7F,$(font.comment)<br />
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
If on Windows (someday this may work on GTK+ too), a filter should be
|
||||||
|
added for conf files in scite/src/others.properties:
|
||||||
|
filter.conf=Configuration (.conf)|*.conf|
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
In scite/src/SciTEGlobal.properties add $(filter.conf) to the definition
|
||||||
|
of open.filter.
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
To add this language to the Language menu of SciTE, add an entry to the menu.language
|
||||||
|
property including the name of the language and the file extension used most commonly
|
||||||
|
for it.
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
Build both Scintilla and SciTE.
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
Share and enjoy
|
||||||
|
</li>
|
||||||
|
</ol>
|
||||||
|
<p>
|
||||||
|
For more extensive information on building lexers, see the
|
||||||
|
<a href ="http://www.scintilla.org/ScintillaDoc.html#BuildingScintilla">
|
||||||
|
instructions in the Scintilla documentation</a>.
|
||||||
|
</p>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
|
|
|
@ -0,0 +1,328 @@
|
||||||
|
<?xml version="1.0"?>
|
||||||
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
||||||
|
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||||
|
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||||
|
<head>
|
||||||
|
<meta name="generator" content="SciTE" />
|
||||||
|
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
||||||
|
<title>
|
||||||
|
SciTE Lua Scripting Extension
|
||||||
|
</title>
|
||||||
|
<style type="text/css">
|
||||||
|
.example {
|
||||||
|
color: #00A000;
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
DIV.example {
|
||||||
|
background: #F7FCF7;
|
||||||
|
border: 1px solid #C0D7C0;
|
||||||
|
margin: 0.3em 3em;
|
||||||
|
padding: 0.3em 0.6em;
|
||||||
|
font-size: 80%;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
</head>
|
||||||
|
<body bgcolor="#FFFFFF" text="#000000">
|
||||||
|
<table bgcolor="#000000" width="100%" cellspacing="0" cellpadding="0" border="0">
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
<img src="SciTEIco.png" border="3" height="64" width="64" alt="Scintilla icon" />
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<a href="index.html" style="color:white;text-decoration:none"><font size="5">
|
||||||
|
SciTE Lua Scripting Extension</font></a>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
<h3>Lua Scripting Extension Notes</h3>
|
||||||
|
The SciTE Lua Scripting Extension uses a copy of Lua 5.1 as
|
||||||
|
its scripting engine. Currently, all of the standard libraries are
|
||||||
|
included, although this list may be trimmed in a future revision.
|
||||||
|
<p>
|
||||||
|
Lua is Copyright (C) 1994-2007 Lua.org, PUC-Rio. The complete Lua license
|
||||||
|
is included in <tt>luaCOPYRIGHT</tt> in the SciTE installation directory. To
|
||||||
|
find more information about Lua, including documentation for the
|
||||||
|
language itself, visit <a href="http://www.lua.org">www.lua.org</a>.
|
||||||
|
</p><p>
|
||||||
|
For more ideas about what Lua can do, you may also want to check out
|
||||||
|
the community portal, <a href="http://lua-users.org/">lua-users.org</a>,
|
||||||
|
<a href="http://lua-users.org/wiki/UsingLuaWithScite">an introduction to using Lua with SciTE,</a>
|
||||||
|
and <a href="http://lua-users.org/wiki/SciteScripts">some example scripts</a>.
|
||||||
|
</p>
|
||||||
|
<h4>SciTE Properties and Lua Event / Command Handlers</h4>
|
||||||
|
<p>
|
||||||
|
The properties ext.lua.startup.script and extension.<i>filepattern</i>
|
||||||
|
can be used to define commands and event handlers that will be called
|
||||||
|
by the SciTE. Other properties beginning with ext.lua may also
|
||||||
|
influence how Lua behaves. See the <a href="SciTEDoc.html">SciTE Documentation</a>
|
||||||
|
for more details on this.
|
||||||
|
</p><p>
|
||||||
|
By defining functions in the startup script or the active extension
|
||||||
|
script, you can tailor SciTE to your needs, adding new behavior and
|
||||||
|
functionality that is tightly integrated.
|
||||||
|
</p><p>
|
||||||
|
To begin, you can handle any many of the events exposed by the
|
||||||
|
<a href="SciTEExtension.html">SciTE Extension Interface</a>. You do
|
||||||
|
this simply by defining functions with the same name as the event.
|
||||||
|
Currently, <tt>OnOpen</tt>, <tt>OnClose</tt>, <tt>OnSwitchFile</tt>, <tt>OnSave</tt>,
|
||||||
|
<tt>OnBeforeSave</tt>, <tt>OnChar</tt>, <tt>OnKey</tt>,
|
||||||
|
<tt>OnSavePointReached</tt>, <tt>OnSavePointLeft</tt>, <tt>OnDwellStart</tt>,
|
||||||
|
<tt>OnDoubleClick</tt>, <tt>OnMarginClick</tt>,
|
||||||
|
and <tt>OnUserListSelection</tt> are supported.
|
||||||
|
</p><p>
|
||||||
|
For some of these events, SciTE will pass one or more arguments to
|
||||||
|
the event handler function: <tt>OnOpen</tt>, <tt>OnClose</tt>,
|
||||||
|
<tt>OnSwitchFile</tt>, <tt>OnSave</tt>, and
|
||||||
|
<tt>OnBeforeSave</tt> will receive the filename of the affected buffer as
|
||||||
|
their first argument.
|
||||||
|
An <tt>OnChar</tt> handler should expect a single-character string argument.
|
||||||
|
An <tt>OnKey</tt> handler should expect an integer keycode and boolean
|
||||||
|
shift, control, and alt arguments. The keycode is currently a platform specific value
|
||||||
|
but this may change in future.
|
||||||
|
<tt>OnDwellStart</tt> will receive the position of the mouse and the
|
||||||
|
word under the mouse as arguments and the word will be empty when the mouse starts moving.
|
||||||
|
<tt>OnUserListSelection</tt> receives two arguments: a number
|
||||||
|
indicating the list type, and a string indicating the selected
|
||||||
|
item text. The other event handlers will not be passed any arguments.
|
||||||
|
</p><p>
|
||||||
|
Event handlers return a boolean value to indicate whether SciTE should
|
||||||
|
continue processing the event. Return a true value to indicate that
|
||||||
|
the event has been fully handled, and that no further handlers should
|
||||||
|
be called. Return a false value to give other extensions a chance to
|
||||||
|
process the same event. In many but not all cases, a well behaved
|
||||||
|
event handler will return false. Remember that, in Lua, the only
|
||||||
|
non-true values are <tt>false</tt> and <tt>nil</tt>. Unlike in C++, Python and many
|
||||||
|
other languages, 0 evaluates to <tt>true</tt>.
|
||||||
|
</p><p>
|
||||||
|
There is one additional event handler, <tt>OnClear</tt>, that is not
|
||||||
|
expressly defined in the Extension interface, but is exposed to Lua.
|
||||||
|
Whenever SciTE re-reads the properties (which occurs every time you
|
||||||
|
switch buffers or open a new file, but can also occur at other times),
|
||||||
|
the Lua Extension removes any globals that were created since the last
|
||||||
|
time properties were read, and restores any globals that were
|
||||||
|
overwritten. Then, if the startup script defines a function
|
||||||
|
<tt>OnClear</tt>, that function will be called so that scripts have a
|
||||||
|
chance to clean up other changes they might have made outside of the
|
||||||
|
Lua global scope (e.g. dynamic properties modified through the props
|
||||||
|
object; see below) and/or to tailor the Lua environment according to
|
||||||
|
local properties for the current buffer.
|
||||||
|
</p><p>
|
||||||
|
After this, SciTE reads the properties and ultimately loads the
|
||||||
|
extension script, if one is defined. However, at the time when the
|
||||||
|
<tt>OnClear</tt> event fires, the extension script is not yet loaded.
|
||||||
|
Thus, <tt>OnClear</tt> can only be defined in the startup script,
|
||||||
|
not in an extension script.
|
||||||
|
</p><p>
|
||||||
|
In addition to event handlers, you can also use define new commands
|
||||||
|
that are available through the Tools menu or through keyboard shortcuts.
|
||||||
|
To specify that a command that will be handled by Lua, specify
|
||||||
|
subsystem 3 for the command. Then, to implement the command using Lua,
|
||||||
|
just define a global function. The command name is the function name.
|
||||||
|
</p><p>
|
||||||
|
You can also use predefined functions like <tt>dofile</tt> and <tt>dostring</tt> as tool
|
||||||
|
commands.
|
||||||
|
</p><p>
|
||||||
|
Anything specified after the command name is passed to the Lua function
|
||||||
|
as a single string argument. An example of a command, using the
|
||||||
|
built-in dofile command, is shown below.
|
||||||
|
</p>
|
||||||
|
<div class="example">
|
||||||
|
command.name.1.*=Run My Script<br />
|
||||||
|
command.subsystem.1.*=3<br />
|
||||||
|
command.1.*=dofile $(SciteDefaultHome)/My Script.lua<br />
|
||||||
|
</div>
|
||||||
|
<p>
|
||||||
|
Note that the command line is "not" evaluated directly
|
||||||
|
as a Lua script.
|
||||||
|
</p><p>
|
||||||
|
If there is no function matching the command name, no error will be
|
||||||
|
displayed. This is because Lua assumes in this case that the command
|
||||||
|
is meant for some other extension, such as the <a href="SciTEDirector.html">SciTE Director
|
||||||
|
Extension</a>. However, if the command function is found, but fails
|
||||||
|
to execute, an error is reported.
|
||||||
|
</p>
|
||||||
|
<h4>Multiple handlers</h4>
|
||||||
|
<p>
|
||||||
|
<a href="http://lua-users.org/wiki/SciteExtMan">Scite Ext Man</a> can help in
|
||||||
|
more complex applications where you have
|
||||||
|
multiple scripts needing to handle an event.
|
||||||
|
</p>
|
||||||
|
<hr noshade="noshade" width="80%" align="left" />
|
||||||
|
<h4>Predefined Lua Functions and Objects:</h4>
|
||||||
|
<p>
|
||||||
|
Within Lua scripts you can use the following functions / objects:
|
||||||
|
</p><pre><tt> trace(s) - writes s to the output pane (no prefix, no newlines)
|
||||||
|
dostring(s) - executes s as a Lua string, like Lua 4's dostring
|
||||||
|
editor - the editor pane
|
||||||
|
output - the output pane
|
||||||
|
props - a pseudo-table representing the SciTE properties
|
||||||
|
buffer - a table associated with the current buffer or document
|
||||||
|
scite - a namespace for functions which control SciTE.
|
||||||
|
</tt></pre><p>
|
||||||
|
In addition, all constants defined in Scintilla.iface are exposed as
|
||||||
|
Lua globals variables. Function names are exposed as their block
|
||||||
|
capital equivalents, with the SCI_ prefix.
|
||||||
|
</p><p>
|
||||||
|
All functions and objects defined in the Lua standard library are also
|
||||||
|
available. Although dostring was deprecated in Lua 5, it is restored
|
||||||
|
since some have said it would be useful in tool commands.
|
||||||
|
</p><p>
|
||||||
|
A function <tt>_ALERT()</tt> is also defined to be an alias for the built-in
|
||||||
|
<tt>print()</tt>, which prints the alert message (plus a newline) to the window.
|
||||||
|
This provides a reasonable way for Lua to present error messages to
|
||||||
|
the user. You are free to override <tt>_ALERT</tt> with a different definition
|
||||||
|
if you prefer.
|
||||||
|
</p><p>
|
||||||
|
The props pseudo-table allows you to read or write properties by name
|
||||||
|
using normal Lua table-access semantics, e.g. <tt>props["property.name"]</tt>.
|
||||||
|
As with Lua tables, you can also un-set a property by assigning nil to its key.
|
||||||
|
</p><p>
|
||||||
|
When you assign a value to a property from Lua, this overrides any values
|
||||||
|
specified in the configuration files for that setting. The underlying file
|
||||||
|
properties are not changed. If you later assign nil to the same property
|
||||||
|
from Lua, this removes the run-time setting, allowing any file-based
|
||||||
|
property setting to show through once again.
|
||||||
|
</p><p>
|
||||||
|
The editor and output panes support the following properties and
|
||||||
|
methods:
|
||||||
|
</p><pre><tt> textrange(startPos, endPos) - gets the text in the specified range
|
||||||
|
|
||||||
|
findtext(text, [flags], [startPos, [endPos]])
|
||||||
|
- returns the start and end of the first match, or nil if no match
|
||||||
|
- flags can be 0 (the default), or a combination of <a href="http://scintilla.sourceforge.net/ScintillaDoc.html#searchFlags">SCFIND constants</a>
|
||||||
|
such as SCFIND_WHOLEWORD, SCFIND_MATCHCASE, and SCFIND_REGEXP
|
||||||
|
|
||||||
|
match(text, [flags], [startPos])
|
||||||
|
- returns a generator that allows you to loop over the matches
|
||||||
|
i.e. for m in editor:match(text, flags) do ... end
|
||||||
|
- the match object (i.e. the loop counter m in the above
|
||||||
|
example) supports read-only properties pos, len, and text;
|
||||||
|
and also supports a function replace(replaceText) to
|
||||||
|
support search and replace.
|
||||||
|
- while looping through matches, if the document is modified
|
||||||
|
by any method other than the loop counter's replace method,
|
||||||
|
this may cause the match generator to lose its place.
|
||||||
|
- also, do not attempt to store the match object for later
|
||||||
|
access outside the loop; it will not be useable.
|
||||||
|
|
||||||
|
append(text) - appends text to the end of the document
|
||||||
|
insert(pos, text) - inserts text at the specified position
|
||||||
|
remove(startPos, endPos) - removes the text in the range
|
||||||
|
</tt></pre><p>
|
||||||
|
Most of the functions defined in Scintilla.iface are also be exposed
|
||||||
|
as pane methods. Those functions having simple parameters (string,
|
||||||
|
boolean, and numeric types) are fully supported. For example,
|
||||||
|
<tt>editor:InsertText(pos, text)</tt> does practically the same thing as
|
||||||
|
<tt>editor:insert(pos, text)</tt>. Functions having a stringresult parameter
|
||||||
|
will include a string in the return value. For both strings and
|
||||||
|
stringresults, if the function is documented as expecting a length
|
||||||
|
as its first parameter, you do not pass the length from Lua. Instead,
|
||||||
|
it is inferred from the context.
|
||||||
|
</p><p>
|
||||||
|
The keymod parameter type has partial support. When an iface function
|
||||||
|
is declared as taking a keymod, the Lua equivalent expects two
|
||||||
|
numbers: first the key code (e.g. <tt>SCK_LEFT</tt> or <tt>string.byte("'")</tt>, and
|
||||||
|
second the modifiers (e.g. <tt>SCMOD_CTRL</tt>).
|
||||||
|
</p><p>
|
||||||
|
Functions that have more complex parameters are not supported.
|
||||||
|
</p><p>
|
||||||
|
Functions that are declared to return a numeric type have the result
|
||||||
|
added to their return value. If the function also has a stringresult,
|
||||||
|
that comes first, followed by the numeric return value.
|
||||||
|
</p><p>
|
||||||
|
Some functions are declared as 'get' or 'set' rather than 'fun' in
|
||||||
|
the iface file. These are generally exposed to Lua as properties,
|
||||||
|
e.g. <tt>editor.TabSize = 8</tt>. Some of the getters and setters also have
|
||||||
|
a parameter. Where possible, these are exposed to Lua as indexed
|
||||||
|
properties, e.g. <tt>editor.StyleBold[SCE_PROPS_DEFAULT] = true</tt>.
|
||||||
|
However, if an iface function is declared as get / set but cannot be
|
||||||
|
mapped to a Lua property, it is exposed as a Lua function instead.
|
||||||
|
</p><p>
|
||||||
|
It is intended that a complete guide to the iface functions and
|
||||||
|
properties should be added to the documentation, so you don't have
|
||||||
|
to look at the iface file and do the mental text manipulation.
|
||||||
|
This is not done yet, but would be a good project for someone.
|
||||||
|
<a href="http://scintilla.sourceforge.net/ScintillaDoc.html">ScintillaDoc</a> would be a good template to follow. An api file
|
||||||
|
would also be a good addition.
|
||||||
|
</p>
|
||||||
|
The <tt>scite</tt> namespace includes the following functions:
|
||||||
|
</p><pre><tt> scite.Open(filename)
|
||||||
|
- opens a file in a new buffer
|
||||||
|
- activates the file's buffer if it is already opened.
|
||||||
|
|
||||||
|
scite.SendEditor(SCI_constant, ...)
|
||||||
|
- sends a message to the editor pane
|
||||||
|
- equivalent to the corresponding iface function or property
|
||||||
|
|
||||||
|
scite.SendOutput(SCI_constant, ...)
|
||||||
|
- sends a message to the output pane
|
||||||
|
|
||||||
|
scite.ConstantName(number)
|
||||||
|
- returns the symbolic name of a Scintilla / SciTE constant
|
||||||
|
|
||||||
|
scite.MenuCommand(IDM_constant)
|
||||||
|
- equivalent to the corresponding IDM_ command defined in SciTE.h
|
||||||
|
</tt></pre><p>
|
||||||
|
<tt>Open</tt> requires special care. When the buffer changes in SciTE, the
|
||||||
|
Lua global namespace is reset to its initial state, and any extension
|
||||||
|
script associated with the new buffer is loaded. Thus, when you call
|
||||||
|
Open, this may change the environment in which your current script is
|
||||||
|
running. When possible, you can avoid confusion by simply returning
|
||||||
|
after scite.Open, but when that is not possible, just bear in mind
|
||||||
|
that there are side effects. Local variables, unlike globals, will
|
||||||
|
be retained after the buffer change until your script returns.
|
||||||
|
</p><p>
|
||||||
|
The <tt>SendEditor</tt> and <tt>SendOuput</tt> functions duplicate the
|
||||||
|
functionality of the editor and output objects, providing access to these
|
||||||
|
through an interface that is more familiar to Scintilla C++ developers.
|
||||||
|
This may be useful for prototyping C++ code using Lua. Internally,
|
||||||
|
<tt>SendEditor</tt> and <tt>SendOutput</tt> are translated to the
|
||||||
|
corresponding iface function or property, so their arguments and
|
||||||
|
return types are identical. (Although the calling convention for
|
||||||
|
properties is obviously different.)
|
||||||
|
</p><p>
|
||||||
|
The <tt>ConstantName</tt> function may be useful when generating debug messages,
|
||||||
|
or if extending the SciTE LuaExtension to support macro recording.
|
||||||
|
</p><p>
|
||||||
|
The <tt>MenuCommand</tt> function enables usage of SciTE's menu commands
|
||||||
|
as defined in SciTE.h.
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<h4>Lua 5.1</h4>
|
||||||
|
<pre>
|
||||||
|
Despite some of the big changes in Lua 5.1 dealing with changes
|
||||||
|
in the language, most of the compatibility options have been
|
||||||
|
turned on.
|
||||||
|
Compatibilities:
|
||||||
|
- table.getn still works, but the '#' operator should be used
|
||||||
|
- Lua 5.0's varargs are still available
|
||||||
|
- Lua 5.0's math.mod is still available, as well as 5.1's
|
||||||
|
math.fmod
|
||||||
|
- Lua 5.0's string.gfind is still available, as well as 5.1's
|
||||||
|
string.gmatch
|
||||||
|
- [C API] Lua 5.0's luaL_openlib behavior is still available
|
||||||
|
Changes:
|
||||||
|
- table.setn was deprecated
|
||||||
|
- loadlib was moved into the package table (package.loadlib)
|
||||||
|
- Lua 5.0's long string nesting throws an error
|
||||||
|
</pre>
|
||||||
|
|
||||||
|
<hr noshade="noshade" width="80%" align="left" />
|
||||||
|
|
||||||
|
<h4>Disabling Lua</h4>
|
||||||
|
<p>
|
||||||
|
Lua is currently loaded just-in-time, before it is first used. The
|
||||||
|
ways that Lua can become are through the ext.lua.startup.script
|
||||||
|
property, by naming a lua file named in the extension.<i>filepattern</i>
|
||||||
|
property, or by using the extension mechanism to define tool commands
|
||||||
|
(i.e. subsystem 3). If you do not do any of these things, the Lua
|
||||||
|
scripting engine is not loaded, and for all practical purposes, SciTE
|
||||||
|
should behave as it did before Lua was added.
|
||||||
|
</p><p>
|
||||||
|
Nevertheless, it is still possible to build SciTE without the Lua
|
||||||
|
support. To do this, simply define the variable <tt>NO_LUA</tt> when you build
|
||||||
|
it, e.g. for MSVC, <tt>nmake -f scite.mak -DNO_LUA</tt>; or with GNU tools,
|
||||||
|
<tt>make NO_LUA=1</tt>.
|
||||||
|
</p>
|
||||||
|
</body>
|
||||||
|
</html>
|
|
@ -0,0 +1,163 @@
|
||||||
|
<?xml version="1.0"?>
|
||||||
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
||||||
|
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||||
|
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||||
|
<head>
|
||||||
|
<meta name="generator" content="SciTE" />
|
||||||
|
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
||||||
|
<title>
|
||||||
|
SciTE Regular Expressions
|
||||||
|
</title>
|
||||||
|
<style type="text/css">
|
||||||
|
h3 {
|
||||||
|
background-color: #FEC;
|
||||||
|
}
|
||||||
|
.ref {
|
||||||
|
color: #80C;
|
||||||
|
}
|
||||||
|
code {
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
dt {
|
||||||
|
margin-top: 15px;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
</head>
|
||||||
|
<body bgcolor="#FFFFFF" text="#000000">
|
||||||
|
<table bgcolor="#000000" width="100%" cellspacing="0" cellpadding="0" border="0">
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
<img src="SciTEIco.png" border="3" height="64" width="64" alt="Scintilla icon" />
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<a href="index.html" style="color:white;text-decoration:none"><font size="5">
|
||||||
|
Regular Expressions</font></a>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
<h2>
|
||||||
|
Regular Expressions in SciTE
|
||||||
|
</h2>
|
||||||
|
<h3>Purpose</h3>
|
||||||
|
<p>
|
||||||
|
Regular expressions can be used for searching for patterns
|
||||||
|
rather than literals. For example, it is possible to
|
||||||
|
search for variables in SciTE property files,
|
||||||
|
which look like $(name.subname) with the regular expression:<br />
|
||||||
|
<code>\$([a-z.]+)</code> (or <code>\$\([a-z.]+\)</code> in posix mode).
|
||||||
|
</p>
|
||||||
|
<p>
|
||||||
|
Replacement with regular expressions allows complex
|
||||||
|
transformations with the use of tagged expressions.
|
||||||
|
For example, pairs of numbers separated by a ',' could
|
||||||
|
be reordered by replacing the regular expression:<br />
|
||||||
|
<code>\([0-9]+\),\([0-9]+\)</code> (or <code>([0-9]+),([0-9]+)</code>
|
||||||
|
in posix mode, or even <code>(\d+),(\d+)</code>)<br />
|
||||||
|
with:<br />
|
||||||
|
<code>\2,\1</code>
|
||||||
|
</p>
|
||||||
|
<h3>Syntax</h3>
|
||||||
|
<p>
|
||||||
|
Regular expression syntax depends on a parameter: find.replace.regexp.posix<br />
|
||||||
|
If set to 0, syntax uses the old Unix style where <code>\(</code> and <code>\)</code>
|
||||||
|
mark capturing sections while <code>(</code> and <code>)</code> are themselves.<br />
|
||||||
|
If set to 1, syntax uses the more common style where <code>(</code> and <code>)</code>
|
||||||
|
mark capturing sections while <code>\(</code> and <code>\)</code> are plain parentheses.
|
||||||
|
</p>
|
||||||
|
<dl><dt><span class="ref">[1]</span> char</dt>
|
||||||
|
<dd>matches itself, unless it is a special character
|
||||||
|
(metachar): <code>. \ [ ] * + ^ $</code> and <code>( )</code> in posix mode.
|
||||||
|
</dd><dt><span class="ref">[2]</span> <code>.</code></dt>
|
||||||
|
<dd>matches any character.
|
||||||
|
</dd><dt><span class="ref">[3]</span> <code>\</code></dt>
|
||||||
|
<dd>matches the character following it, except:
|
||||||
|
<ul><li><code>\a</code>, <code>\b</code>, <code>\f</code>,
|
||||||
|
<code>\n</code>, <code>\r</code>, <code>\t</code>, <code>\v</code>
|
||||||
|
match the corresponding C escape char,
|
||||||
|
respectively BEL, BS, FF, LF, CR, TAB and VT;<br />
|
||||||
|
Note that <code>\r</code> and <code>\n</code> are never matched because in Scintilla,
|
||||||
|
regular expression searches are made line per line (stripped of end-of-line chars).
|
||||||
|
</li><li>if not in posix mode, when followed by a left or right round bracket (see <span class="ref">[7]</span>);
|
||||||
|
</li><li>when followed by a digit 1 to 9 (see <span class="ref">[8]</span>);
|
||||||
|
</li><li>when followed by a left or right angle bracket (see <span class="ref">[9]</span>);
|
||||||
|
</li><li>when followed by d, D, s, S, w or W (see <span class="ref">[10]</span>);
|
||||||
|
</li><li>when followed by x and two hexa digits (see <span class="ref">[11]</span>);
|
||||||
|
</li></ul>
|
||||||
|
Backslash is used as an escape character for all other meta-characters, and itself.
|
||||||
|
</dd><dt><span class="ref">[4]</span> <code>[</code>set<code>]</code></dt>
|
||||||
|
<dd>matches one of the characters in the set.
|
||||||
|
If the first character in the set is <code>^</code>, it matches the characters NOT in the set,
|
||||||
|
i.e. complements the set. A shorthand <code>S-E</code> (start dash end) is
|
||||||
|
used to specify a set of characters S up to E, inclusive. The special characters <code>]</code> and
|
||||||
|
<code>-</code> have no special meaning if they appear as the first chars in the set. To include both,
|
||||||
|
put - first: <code>[-]A-Z]</code> (or just backslash them).
|
||||||
|
<table><tr><td>example</td><td>match</td></tr>
|
||||||
|
<tr><td><code>[-]|]</code></td><td>matches these 3 chars,</td></tr>
|
||||||
|
<tr><td><code>[]-|]</code></td><td>matches from ] to | chars</td></tr>
|
||||||
|
<tr><td><code>[a-z]</code></td><td>any lowercase alpha</td></tr>
|
||||||
|
<tr><td><code>[^-]]</code></td><td>any char except - and ]</td></tr>
|
||||||
|
<tr><td><code>[^A-Z]</code></td><td>any char except uppercase alpha</td></tr>
|
||||||
|
<tr><td><code>[a-zA-Z]</code></td><td>any alpha</td></tr>
|
||||||
|
</table>
|
||||||
|
</dd><dt><span class="ref">[5]</span> <code>*</code></dt>
|
||||||
|
<dd>any regular expression form <span class="ref">[1]</span> to <span class="ref">[4]</span>
|
||||||
|
(except <span class="ref">[7]</span>, <span class="ref">[8]</span> and <span class="ref">[9]</span>
|
||||||
|
forms of <span class="ref">[3]</span>),
|
||||||
|
followed by closure char (<code>*</code>) matches zero or more matches of that form.
|
||||||
|
</dd><dt><span class="ref">[6]</span> <code>+</code></dt>
|
||||||
|
<dd>same as <span class="ref">[5]</span>, except it matches one or more.
|
||||||
|
Both <span class="ref">[5]</span> and <span class="ref">[6]</span> are greedy (they match as much as possible).
|
||||||
|
</dd><dt><span class="ref">[7]</span></dt>
|
||||||
|
<dd>a regular expression in the form <span class="ref">[1]</span> to <span class="ref">[12]</span>, enclosed
|
||||||
|
as <code>\(<i>form</i>\)</code> (or <code>(<i>form</i>)</code> with posix flag) matches
|
||||||
|
what <i>form</i> matches.
|
||||||
|
The enclosure creates a set of tags, used for <span class="ref">[8]</span> and for
|
||||||
|
pattern substitution. The tagged forms are numbered starting from 1.
|
||||||
|
</dd><dt><span class="ref">[8]</span></dt>
|
||||||
|
<dd>a <code>\</code> followed by a digit 1 to 9 matches whatever a
|
||||||
|
previously tagged regular expression (<span class="ref">[7]</span>) matched.
|
||||||
|
</dd><dt><span class="ref">[9]</span> <code>\< \></code></dt>
|
||||||
|
<dd>a regular expression starting with a <code>\<</code> construct
|
||||||
|
and/or ending with a <code>\></code> construct, restricts the
|
||||||
|
pattern matching to the beginning of a word, and/or
|
||||||
|
the end of a word. A word is defined to be a character
|
||||||
|
string beginning and/or ending with the characters
|
||||||
|
A-Z a-z 0-9 and _. Scintilla extends this definition
|
||||||
|
by user setting. The word must also be preceded and/or
|
||||||
|
followed by any character outside those mentioned.
|
||||||
|
</dd><dt><span class="ref">[10]</span> <code>\l</code></dt>
|
||||||
|
<dd>a backslash followed by d, D, s, S, w or W,
|
||||||
|
becomes a character class (both inside and outside sets []).
|
||||||
|
<ul><li>d: decimal digits
|
||||||
|
</li><li>D: any char except decimal digits
|
||||||
|
</li><li>s: whitespace (space, \t \n \r \f \v)
|
||||||
|
</li><li>S: any char except whitespace (see above)
|
||||||
|
</li><li>w: alphanumeric & underscore (changed by user setting)
|
||||||
|
</li><li>W: any char except alphanumeric & underscore (see above)
|
||||||
|
</li></ul>
|
||||||
|
</dd><dt><span class="ref">[11]</span> <code>\xHH</code></dt>
|
||||||
|
<dd>a backslash followed by x and two hexa digits,
|
||||||
|
becomes the character whose Ascii code is equal
|
||||||
|
to these digits. If not followed by two digits,
|
||||||
|
it is 'x' char itself.
|
||||||
|
</dd><dt><span class="ref">[12]</span></dt>
|
||||||
|
<dd>a composite regular expression xy where x and y
|
||||||
|
are in the form <span class="ref">[1]</span> to <span class="ref">[10]</span> matches the longest
|
||||||
|
match of x followed by a match for y.
|
||||||
|
</dd><dt><span class="ref">[13]</span> <code>^ $</code></dt>
|
||||||
|
<dd>a regular expression starting with a ^ character
|
||||||
|
and/or ending with a $ character, restricts the
|
||||||
|
pattern matching to the beginning of the line,
|
||||||
|
or the end of line. [anchors] Elsewhere in the
|
||||||
|
pattern, ^ and $ are treated as ordinary characters.
|
||||||
|
</dd></dl>
|
||||||
|
<h3>Acknowledgments</h3>
|
||||||
|
<p>
|
||||||
|
Most of this documentation was originally written by Ozan S. Yigit.<br />
|
||||||
|
Additions by Neil Hodgson and Philippe Lhoste.<br />
|
||||||
|
All of this document is in the public domain.
|
||||||
|
</p>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
|
|
||||||
|
|
After Width: | Height: | Size: 2.9 KiB |
After Width: | Height: | Size: 3.5 KiB |
After Width: | Height: | Size: 24 KiB |
|
@ -0,0 +1,6 @@
|
||||||
|
body {
|
||||||
|
padding-left: 2em;
|
||||||
|
}
|
||||||
|
pre {
|
||||||
|
background-color: #eeeeff
|
||||||
|
}
|
After Width: | Height: | Size: 658 B |
After Width: | Height: | Size: 603 B |
After Width: | Height: | Size: 369 B |
|
@ -0,0 +1,346 @@
|
||||||
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
|
||||||
|
<title>A Quick SciTE Tour</title>
|
||||||
|
<style type="text/css"><!--
|
||||||
|
body {
|
||||||
|
padding-left: 2em;
|
||||||
|
}
|
||||||
|
pre {
|
||||||
|
background-color: #eeeeff
|
||||||
|
}
|
||||||
|
|
||||||
|
--></style>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<h1 id="T1">A Quick SciTE Tour</h1>
|
||||||
|
|
||||||
|
<ul>
|
||||||
|
<li><a href="#T2">Editing With SciTE</a>
|
||||||
|
<ul>
|
||||||
|
<li><a href="#T3">Configuring SciTE</a></li>
|
||||||
|
<li><a href="#T4">Opening And Browsing Files</a></li>
|
||||||
|
<li><a href="#T5">Selecting Text</a></li>
|
||||||
|
<li><a href="#T6">Abbreviations and Completing Text</a></li>
|
||||||
|
</ul></li>
|
||||||
|
<li><a href="#T7">Running Programs</a></li>
|
||||||
|
<li><a href="#T8">Using Lua Interactively</a></li>
|
||||||
|
<li><a href="#T9">Debugging Programs</a></li>
|
||||||
|
</ul>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<p><img src="SciTEIco.png" alt="SciTE"/></p>
|
||||||
|
|
||||||
|
<p>SciTE is a general-purpose programmer's editor that also allows you to
|
||||||
|
debug Lua scripts. It is very extendable using its own built-in Lua
|
||||||
|
interpreter, in fact the debugger support is almost entirely done in Lua.
|
||||||
|
With SciTE as you can do step by step debugging of Lua source, set
|
||||||
|
breakpoints, watch variables, trace the stack, inspect variables and more.</p>
|
||||||
|
|
||||||
|
<h2 id="T2">Editing With SciTE</h2>
|
||||||
|
|
||||||
|
<p>The SciTE window consists of the following parts:</p>
|
||||||
|
|
||||||
|
<ul>
|
||||||
|
<li>caption bar ('title')</li>
|
||||||
|
<li>menu</li>
|
||||||
|
<li>toolbar (can hide this with <code>View|Tool Bar</code>)</li>
|
||||||
|
<li>tabbar (with a tab for each open file, or 'buffer')</li>
|
||||||
|
<li>edit window</li>
|
||||||
|
<li>output pane (will open automatically if any output or errors are generated)</li>
|
||||||
|
<li>status bar (usually shows line and column number)</li>
|
||||||
|
</ul>
|
||||||
|
|
||||||
|
<p>The edit window has three margins:</p>
|
||||||
|
|
||||||
|
<ul>
|
||||||
|
<li>line numbers (usually invisible, use <code>View|Line Numbers</code> to show)</li>
|
||||||
|
<li>marker margin (shows markers, breakpoints, etc. Can click here to select a line)</li>
|
||||||
|
<li>fold margin (clicking on a fold margin will 'collapse' the folded block)</li>
|
||||||
|
</ul>
|
||||||
|
|
||||||
|
<p>Simple editing with SciTE with easy because it uses standard Windows editing
|
||||||
|
conventions. In particular, if you have used Visual Studio you will find many of
|
||||||
|
the shortcuts familiar. However, it is a good exercise to know what an editor can
|
||||||
|
do for you, and learn a few shortcuts, because with a little work you can save a
|
||||||
|
lot of time when performing your editing tasks. The only way to learn is to experiment,
|
||||||
|
and always remember that <code>Edit|Undo (Ctrl+Z)</code> is your friend - no mistake is
|
||||||
|
permanent.</p>
|
||||||
|
|
||||||
|
<h3 id="T3">Configuring SciTE</h3>
|
||||||
|
|
||||||
|
<p><a name="options"/></p>
|
||||||
|
|
||||||
|
<p>SciTE is a very configurable editor. To set global options,
|
||||||
|
open the options file using <code>Options|Open Global Options File</code>.
|
||||||
|
If you prefer not to have the full file path in the caption bar, then you
|
||||||
|
would edit <code>title.full.path</code> to be 0 (zero) like so, and save this file.</p>
|
||||||
|
|
||||||
|
<pre><code>title.full.path=0
|
||||||
|
</code></pre>
|
||||||
|
|
||||||
|
<p>Simularly, if you would prefer not to see line numbers by default, then set
|
||||||
|
<code>line.margin.visible</code> to 0. View the SciTE Help file with <code>Help|SciTE Help</code> to see
|
||||||
|
a full list of available <em>properties</em>. Some changes will only be visible after restarting SciTE.</p>
|
||||||
|
|
||||||
|
<h3 id="T4">Opening And Browsing Files</h3>
|
||||||
|
|
||||||
|
<p>There will be a 'Edit with SciTE' on the right-mouse context menu when
|
||||||
|
selecting a Lua file. Once SciTE is launched, you can also drag and drop
|
||||||
|
files onto SciTE to open them. By default, <code>File|Open</code> will open files in the
|
||||||
|
same directory as the current file.</p>
|
||||||
|
|
||||||
|
<p>Once files are open, you can move to them by either clicking on the
|
||||||
|
appropriate tab, or going to the Buffers menu. Alt+1, Alt+2, etc will let you
|
||||||
|
go directly to the file in that particular tab. Ctrl+Tab will switch between the
|
||||||
|
two recently used buffers. F12 will provide a drop-down list
|
||||||
|
of open files in recently-used order; you can move in this list with the up
|
||||||
|
and down keys.</p>
|
||||||
|
|
||||||
|
<p>It is useful to set bookmarks in longer scripts, so you can revisit them
|
||||||
|
again. A bookmark can be set or unset with <code>Search|Toggle Bookmark (Ctrl-F2)</code>
|
||||||
|
and <code>Search|Next bookmark (F2)</code> will move to the next bookmark.
|
||||||
|
<code>Search|Go to... (Ctrl+G)</code> will take you to a specific line.
|
||||||
|
(To see line numbers, use <code>View|Line Numbers</code>)</p>
|
||||||
|
|
||||||
|
<p><code>File|Open Selected Filename (Ctrl+Shift+O)</code> will try to open a filename at the cursor.
|
||||||
|
For instance, if the line was <code>require "date"</code> and the cursor was on 'date', it will open
|
||||||
|
<code>date.lua</code>, either in the current directory, or on the Lua path.</p>
|
||||||
|
|
||||||
|
<p>A very useful operation is <code>Search|Find in Files (Ctrl+Shift+F)</code> which will search for a word
|
||||||
|
or phrase in the current directory and any subdirectories. The results will appear in
|
||||||
|
the Output Pane; double-clicking on a result will take you to that place in the file. (You can
|
||||||
|
use F4 to quickly go through all occurances.)</p>
|
||||||
|
|
||||||
|
<p>A good way to get an overview of a whole file is <code>View|Toggle All Folds</code>.</p>
|
||||||
|
|
||||||
|
<h3 id="T5">Selecting Text</h3>
|
||||||
|
|
||||||
|
<p>It is always possible to select text using the mouse, and to select a line
|
||||||
|
just click in the left-most margin. Dragging the mouse in the left-most margin will
|
||||||
|
select a range of lines. The usual meaning of double-clicking is to select a word,
|
||||||
|
but this SciTE version generalizes this action to select a whole string or comment.</p>
|
||||||
|
|
||||||
|
<p>If you have defined a bookmark, then you can select all the text following it up to the cursor.
|
||||||
|
This is useful if you want to move a section of a file; place the bookmark at
|
||||||
|
the top of the section, go to the end of the section, and then select with <code>Alt+F2</code>.</p>
|
||||||
|
|
||||||
|
<p>A useful shortcut is <code>Edit|Block Select (Ctrl+Shift+A)</code> which intelligently selects the current block; if you position the cursor on the first line of a function, it will select all of that function.
|
||||||
|
There is a complementary 'smart paste' operation <code>Edit|Smart Paste (Ctrl+Shift+V)</code> which
|
||||||
|
inserts the contents of the clipboard and tries to adjust the block to the current indentation, leaving the block selected in case the paste was not as smart as it thought! Once a block is
|
||||||
|
selected, it can be indented with <code>Tab</code> and un-indented with <code>Ctrl+Tab</code>.</p>
|
||||||
|
|
||||||
|
<h3 id="T6">Abbreviations and Completing Text</h3>
|
||||||
|
|
||||||
|
<p>Writing code involves a lot of repetitive typing, and SciTE can help you code faster. This version
|
||||||
|
comes with a set of predefined abbreviations to make Lua programming easier; for instance, if you type 'if' and press <code>Ctrl+B</code> (<code>Edit|Expand Abbreviation</code>) then SciTE will insert this:</p>
|
||||||
|
|
||||||
|
<pre><code>if then
|
||||||
|
|
||||||
|
end
|
||||||
|
</code></pre>
|
||||||
|
|
||||||
|
<p>and the cursor will be positioned just after 'if', ready for you to type the condition. Likewise, 'for' <code>Ctrl+B</code> will give you:</p>
|
||||||
|
|
||||||
|
<pre><code>for k,v in pairs( ) do
|
||||||
|
|
||||||
|
end
|
||||||
|
</code></pre>
|
||||||
|
|
||||||
|
<p>with the cursor placed in the brackets after 'pairs'. Please note that abbreviations are
|
||||||
|
inserted properly, respecting your indentation. If you find yourself typing some patterns out
|
||||||
|
repeatedly, then consider adding a custom abbreviation. To do this you can edit
|
||||||
|
<code>abbrev.properties</code> (in the same directory as <code>SciTE.exe</code>.)</p>
|
||||||
|
|
||||||
|
<p>Another general feature is <em>autocompletion</em>. This examines your document and provides a set of suggested complete words. Unlike the similar feature in OpenOffice, it will present you with a drop-down list of possible candidates. This can be a godsend if you find yourself writing long variable names like <code>SearchCompletedList</code> repeatedly. (If you prefer, you can switch off automatic word completion by
|
||||||
|
setting <code>autocompleteword.automatic</code> to 0 (<a href="#options">see setting options</a>), and then you can use
|
||||||
|
<code>Edit|Complete Word (Ctrl+Enter)</code> to get a list of suggested words.)</p>
|
||||||
|
|
||||||
|
<p>For working with Lua code specifically, there is also <code>Edit|Complete Symbol (Ctrl+I)</code>. This
|
||||||
|
uses the supplied Lua <em>api file</em> to complete the library function. For example,
|
||||||
|
if I type 'st' in a Lua file, then <code>Ctrl+I</code> will supply a drop-down list of all Lua library functions
|
||||||
|
that begin with 'st', such as 'string.byte','string.char', etc. Furthermore, if you then choose one of these functions, then as soon as you enter '(' SciTE will provide a <em>calltip</em> with
|
||||||
|
the parameters and a helpful one-line summary. This will also happen whenever you have typed
|
||||||
|
one of these library functions in directly.</p>
|
||||||
|
|
||||||
|
<p><img src="calltip.png" alt="calltip"/></p>
|
||||||
|
|
||||||
|
<h2 id="T7">Running Programs</h2>
|
||||||
|
|
||||||
|
<p><img src="toolbar.png" alt="toolbar"/></p>
|
||||||
|
|
||||||
|
<p><code>Tools|Go (F5)</code> <img src="run.png" alt="run"/> will run the current script. (This operation is also available
|
||||||
|
from the toolbar as the green arrow) If the script needs command-line
|
||||||
|
parameters, up to four parameters can be specified with <code>View|Parameters</code>.
|
||||||
|
If you have a runaway program stuck in a loop then <code>Tools|Stop Executing (Ctrl+Break)</code>
|
||||||
|
will kill it; the icon next to the Run icon will be enabled and can also be used.</p>
|
||||||
|
|
||||||
|
<p>Any output or errors will appear in the Output pane; If the execution of
|
||||||
|
a script fails, then the error line is automatically shown. This can also be achieved by
|
||||||
|
clicking on a error message. (Or by using <code>Tools|Next Message (F4)</code>, which is useful if
|
||||||
|
there are many compile errors. This also works for the results of <code>Search|Find in Files</code>)</p>
|
||||||
|
|
||||||
|
<p>The Output pane also supports the usual selection and clipboard operations; these are
|
||||||
|
also available through the right-click context menu. To open or close the
|
||||||
|
Output pane, use F8.</p>
|
||||||
|
|
||||||
|
<h2 id="T8">Using Lua Interactively</h2>
|
||||||
|
|
||||||
|
<p>The little prompt icon <img src="prompt.png" alt="prompt"/> will put you into a Lua interactive prompt. This
|
||||||
|
prompt is different from the usual Lua prompt because tables will be printed
|
||||||
|
out nicely. Plus, it is now easy to copy stuff to the clipboard.</p>
|
||||||
|
|
||||||
|
<pre><code>> = 5*2
|
||||||
|
10
|
||||||
|
> t = {1,2,3}
|
||||||
|
> = t
|
||||||
|
{1,2,3}
|
||||||
|
</code></pre>
|
||||||
|
|
||||||
|
<p>This Lua prompt will automatically stay in the same directory as the current
|
||||||
|
file, which is very useful for testing small bits of code. For instance, save
|
||||||
|
this as 'sqr.lua':</p>
|
||||||
|
|
||||||
|
<pre><code>function sqr(x)
|
||||||
|
return x*x
|
||||||
|
end
|
||||||
|
</code></pre>
|
||||||
|
|
||||||
|
<p>You can now move to the output pane (just click it with the mouse, or
|
||||||
|
<code>Ctrl-F6</code> if you prefer using the keyboard), load the file using <code>dofile "sqr.lua"</code>
|
||||||
|
and type <code>sqr(10)</code></p>
|
||||||
|
|
||||||
|
<pre><code>> dofile 'sqr.lua'
|
||||||
|
> sqr(10)
|
||||||
|
100
|
||||||
|
> sqr('10')
|
||||||
|
100
|
||||||
|
> sqr('bonzo')
|
||||||
|
stdin:1: attempt to perform arithmetic on local 'x' (a string value)
|
||||||
|
...
|
||||||
|
</code></pre>
|
||||||
|
|
||||||
|
<p>You now understand the limitations of your simple function; it cannot
|
||||||
|
square things which cannot be converted into numbers. (The icon next
|
||||||
|
to the Lua prompt icon has the same effect as typing <code>dofile</code> directly.</p>
|
||||||
|
|
||||||
|
<p>Another feature which can be very useful is that three commands are
|
||||||
|
available (<code>cd</code>, <code>dir</code> and <code>edit</code>) which work like DOS commands.
|
||||||
|
For example:</p>
|
||||||
|
|
||||||
|
<pre><code>> dir *.lua
|
||||||
|
controller.lua
|
||||||
|
remdebug
|
||||||
|
remdebug.lua
|
||||||
|
> cd
|
||||||
|
C:\Program Files\SciTE\scite-debug\remDebug
|
||||||
|
> cd remdebug
|
||||||
|
> dir
|
||||||
|
engine.lua
|
||||||
|
> edit engine.lua
|
||||||
|
</code></pre>
|
||||||
|
|
||||||
|
<p>Where <code>edit</code> will open the file in SciTE.</p>
|
||||||
|
|
||||||
|
<p>Generally, interactive Lua is the best place to learn about the available
|
||||||
|
libraries and to test out things like string patterns, etc. The idea is that
|
||||||
|
writing longer programs is easier once you have tested tricky bits
|
||||||
|
interactively.</p>
|
||||||
|
|
||||||
|
<p>To leave the Lua prompt, just type quit.</p>
|
||||||
|
|
||||||
|
<h2 id="T9">Debugging Programs</h2>
|
||||||
|
|
||||||
|
<p>Debugging involves running your program in a controlled environment where
|
||||||
|
you can stop at specified lines called breakpoints, and then move a line at
|
||||||
|
a time, called stepping. Single-stepping goes to the next line that will be
|
||||||
|
executed, and will enter functions, whereas 'stepping over' will step over
|
||||||
|
any function calls and stop at the line after the call. Here is an example
|
||||||
|
script ('script1.lua'); note that the line numbers are not part of the program!
|
||||||
|
(script1.lua is available in the scite-debug\tests directory)</p>
|
||||||
|
|
||||||
|
<pre><code>01 function two(x)
|
||||||
|
02 print(x)
|
||||||
|
03 end
|
||||||
|
04 function one(y)
|
||||||
|
05 print(y)
|
||||||
|
06 two('go')
|
||||||
|
07 print('there')
|
||||||
|
08 end
|
||||||
|
09
|
||||||
|
10 one('dolly')
|
||||||
|
</code></pre>
|
||||||
|
|
||||||
|
<p>When you start the debugger, it will stop at the first executable line.
|
||||||
|
You can now single-step your way to the code of interest, but it's easier
|
||||||
|
to set a breakpoint using F9 and then use <code>Debug|Run</code> again to continue.
|
||||||
|
The stopped line is shown with a green background, and the text on the
|
||||||
|
status bar changes to 'active'. Set a breakpoint for line 10 and continue.</p>
|
||||||
|
|
||||||
|
<p>Single-stepping will then lead you to line 5; stepping again will put
|
||||||
|
you on line 6. If you now single-step again, you will enter the function two
|
||||||
|
at line 2; if you had stepped over, you would have directly proceeded to
|
||||||
|
line 7.</p>
|
||||||
|
|
||||||
|
<p>When stopped, you can inspect any value in two different ways; by letting
|
||||||
|
the mouse hover over a variable (called 'tooltip evaluation') or explicitly
|
||||||
|
using <code>Debug|Inspect</code> or the toolbar inspect icon. In this case the value will
|
||||||
|
be written out to the Output pane. For example, when stopped at line 2,
|
||||||
|
hovering the mouse over 'x' will give the tooltip "x = 'go'". Hovering over 'y'
|
||||||
|
in line 4 will give no value, because y is a local variable which is only
|
||||||
|
meaningful when you are in function one.</p>
|
||||||
|
|
||||||
|
<p>When you are stopped at line 2, you can print out the call stack
|
||||||
|
<code>Debug|Backtrace, ctrl+alt+B</code>:</p>
|
||||||
|
|
||||||
|
<pre><code>[1] two in script1.lua:2 ***
|
||||||
|
[2] one in script1.lua:6
|
||||||
|
[3] main in script1.lua:10
|
||||||
|
[4] C in [C]:-1
|
||||||
|
</code></pre>
|
||||||
|
|
||||||
|
<p>Moving 'up' (alt+U) means going back to the point where two() was called;
|
||||||
|
moving up again gets you to where one() was called at line 10. Simularly,
|
||||||
|
you can now move down. The call stack gets <em>deeper</em>, which is why
|
||||||
|
moving <em>down</em> gets you back to the current position. You can always
|
||||||
|
move to a particular stack frame by double-clicking on one of the lines in
|
||||||
|
the stack trace. When you have moved to a particular stack frame, the
|
||||||
|
context changes so that the local variables at that point become available
|
||||||
|
again. But note that in this case the execution point is still at line 2, so if
|
||||||
|
you single-step again you will go back to the 'bottom' of the stack and
|
||||||
|
move onto line 3.</p>
|
||||||
|
|
||||||
|
<p>If your program crashes at any point, the line changes to red and a stack
|
||||||
|
trace is automatically printed. Note that the program is not dead! You can
|
||||||
|
inspect any values you like, move up and down the stacktrace, etc. To
|
||||||
|
finish the program, either kill it with <code>Debug|Kill (alt+K)</code> or just by contining
|
||||||
|
<code>Debug|Run, alt+R</code>. (The red icon at the end of the toolbar achieves the
|
||||||
|
same result.)</p>
|
||||||
|
|
||||||
|
<p>It is often useful to watch how a variable changes, which is set with
|
||||||
|
<code>Debug|Watch</code>. Each time you stop at a line, watch expressions will be
|
||||||
|
printed out in the Output Pane.</p>
|
||||||
|
|
||||||
|
<p>All these operations are available on the toolbar, but there are keyboard
|
||||||
|
shortcuts as well:</p>
|
||||||
|
|
||||||
|
<pre><code>F9 set breakpoint at current line
|
||||||
|
alt+R start debugging; if stopped at a line, continue execution.
|
||||||
|
alt+C single step to the next line
|
||||||
|
alt+N step over functions ('next line')
|
||||||
|
alt+G run until cursor ('go to')
|
||||||
|
alt+I inspect expression at cursor
|
||||||
|
alt+W add expression to watches
|
||||||
|
alt+U go up to the function that called this function
|
||||||
|
alt+D go down to the function that was called from here
|
||||||
|
ctrl+alt+B backtrace
|
||||||
|
</code></pre>
|
||||||
|
|
||||||
|
<p>Once your Lua script is fully debugged, you can run it from the command
|
||||||
|
line by typing in the name of the script at the command line or double
|
||||||
|
clicking on the Lua script file from Windows Explorer.</p>
|
||||||
|
|
||||||
|
|
||||||
|
</body></html>
|
|
@ -0,0 +1,299 @@
|
||||||
|
# A Quick SciTE Tour
|
||||||
|
|
||||||
|
![SciTE](SciTEIco.png)
|
||||||
|
|
||||||
|
SciTE is a general-purpose programmer's editor that also allows you to
|
||||||
|
debug Lua scripts. It is very extendable using its own built-in Lua
|
||||||
|
interpreter, in fact the debugger support is almost entirely done in Lua.
|
||||||
|
With SciTE as you can do step by step debugging of Lua source, set
|
||||||
|
breakpoints, watch variables, trace the stack, inspect variables and more.
|
||||||
|
|
||||||
|
## Editing With SciTE
|
||||||
|
|
||||||
|
The SciTE window consists of the following parts:
|
||||||
|
|
||||||
|
* caption bar ('title')
|
||||||
|
* menu
|
||||||
|
* toolbar (can hide this with `View|Tool Bar`)
|
||||||
|
* tabbar (with a tab for each open file, or 'buffer')
|
||||||
|
* edit window
|
||||||
|
* output pane (will open automatically if any output or errors are generated)
|
||||||
|
* status bar (usually shows line and column number)
|
||||||
|
|
||||||
|
The edit window has three margins:
|
||||||
|
|
||||||
|
* line numbers (usually invisible, use `View|Line Numbers` to show)
|
||||||
|
* marker margin (shows markers, breakpoints, etc. Can click here to select a line)
|
||||||
|
* fold margin (clicking on a fold margin will 'collapse' the folded block)
|
||||||
|
|
||||||
|
Simple editing with SciTE with easy because it uses standard Windows editing
|
||||||
|
conventions. In particular, if you have used Visual Studio you will find many of
|
||||||
|
the shortcuts familiar. However, it is a good exercise to know what an editor can
|
||||||
|
do for you, and learn a few shortcuts, because with a little work you can save a
|
||||||
|
lot of time when performing your editing tasks. The only way to learn is to experiment,
|
||||||
|
and always remember that `Edit|Undo (Ctrl+Z)` is your friend - no mistake is
|
||||||
|
permanent.
|
||||||
|
|
||||||
|
### Configuring SciTE
|
||||||
|
|
||||||
|
<a name="options"/>
|
||||||
|
|
||||||
|
SciTE is a very configurable editor. To set global options,
|
||||||
|
open the options file using `Options|Open Global Options File`.
|
||||||
|
If you prefer not to have the full file path in the caption bar, then you
|
||||||
|
would edit `title.full.path` to be 0 (zero) like so, and save this file.
|
||||||
|
|
||||||
|
title.full.path=0
|
||||||
|
|
||||||
|
Simularly, if you would prefer not to see line numbers by default, then set
|
||||||
|
`line.margin.visible` to 0. View the SciTE Help file with `Help|SciTE Help` to see
|
||||||
|
a full list of available _properties_. Some changes will only be visible after restarting SciTE.
|
||||||
|
|
||||||
|
### Opening And Browsing Files
|
||||||
|
|
||||||
|
There will be a 'Edit with SciTE' on the right-mouse context menu when
|
||||||
|
selecting a Lua file. Once SciTE is launched, you can also drag and drop
|
||||||
|
files onto SciTE to open them. By default, `File|Open` will open files in the
|
||||||
|
same directory as the current file.
|
||||||
|
|
||||||
|
Once files are open, you can move to them by either clicking on the
|
||||||
|
appropriate tab, or going to the Buffers menu. Alt+1, Alt+2, etc will let you
|
||||||
|
go directly to the file in that particular tab. Ctrl+Tab will switch between the
|
||||||
|
two recently used buffers. F12 will provide a drop-down list
|
||||||
|
of open files in recently-used order; you can move in this list with the up
|
||||||
|
and down keys.
|
||||||
|
|
||||||
|
It is useful to set bookmarks in longer scripts, so you can revisit them
|
||||||
|
again. A bookmark can be set or unset with `Search|Toggle Bookmark (Ctrl-F2)`
|
||||||
|
and `Search|Next bookmark (F2)` will move to the next bookmark.
|
||||||
|
`Search|Go to... (Ctrl+G)` will take you to a specific line.
|
||||||
|
(To see line numbers, use `View|Line Numbers`)
|
||||||
|
|
||||||
|
`File|Open Selected Filename (Ctrl+Shift+O)` will try to open a filename at the cursor.
|
||||||
|
For instance, if the line was `require "date"` and the cursor was on 'date', it will open
|
||||||
|
`date.lua`, either in the current directory, or on the Lua path.
|
||||||
|
|
||||||
|
A very useful operation is `Search|Find in Files (Ctrl+Shift+F)` which will search for a word
|
||||||
|
or phrase in the current directory and any subdirectories. The results will appear in
|
||||||
|
the Output Pane; double-clicking on a result will take you to that place in the file. (You can
|
||||||
|
use F4 to quickly go through all occurances.)
|
||||||
|
|
||||||
|
A good way to get an overview of a whole file is `View|Toggle All Folds`.
|
||||||
|
|
||||||
|
### Selecting Text
|
||||||
|
|
||||||
|
It is always possible to select text using the mouse, and to select a line
|
||||||
|
just click in the left-most margin. Dragging the mouse in the left-most margin will
|
||||||
|
select a range of lines. The usual meaning of double-clicking is to select a word,
|
||||||
|
but this SciTE version generalizes this action to select a whole string or comment.
|
||||||
|
|
||||||
|
If you have defined a bookmark, then you can select all the text following it up to the cursor.
|
||||||
|
This is useful if you want to move a section of a file; place the bookmark at
|
||||||
|
the top of the section, go to the end of the section, and then select with `Alt+F2`.
|
||||||
|
|
||||||
|
A useful shortcut is `Edit|Block Select (Ctrl+Shift+A)` which intelligently selects the current block; if you position the cursor on the first line of a function, it will select all of that function.
|
||||||
|
There is a complementary 'smart paste' operation `Edit|Smart Paste (Ctrl+Shift+V)` which
|
||||||
|
inserts the contents of the clipboard and tries to adjust the block to the current indentation, leaving the block selected in case the paste was not as smart as it thought! Once a block is
|
||||||
|
selected, it can be indented with `Tab` and un-indented with `Ctrl+Tab`.
|
||||||
|
|
||||||
|
### Abbreviations and Completing Text
|
||||||
|
|
||||||
|
Writing code involves a lot of repetitive typing, and SciTE can help you code faster. This version
|
||||||
|
comes with a set of predefined abbreviations to make Lua programming easier; for instance, if you type 'if' and press `Ctrl+B` (`Edit|Expand Abbreviation`) then SciTE will insert this:
|
||||||
|
|
||||||
|
if then
|
||||||
|
|
||||||
|
end
|
||||||
|
|
||||||
|
and the cursor will be positioned just after 'if', ready for you to type the condition. Likewise, 'for' `Ctrl+B` will give you:
|
||||||
|
|
||||||
|
for k,v in pairs( ) do
|
||||||
|
|
||||||
|
end
|
||||||
|
|
||||||
|
with the cursor placed in the brackets after 'pairs'. Please note that abbreviations are
|
||||||
|
inserted properly, respecting your indentation. If you find yourself typing some patterns out
|
||||||
|
repeatedly, then consider adding a custom abbreviation. To do this you can edit
|
||||||
|
`abbrev.properties` (in the same directory as `SciTE.exe`.)
|
||||||
|
|
||||||
|
Another general feature is _autocompletion_. This examines your document and provides a set of suggested complete words. Unlike the similar feature in OpenOffice, it will present you with a drop-down list of possible candidates. This can be a godsend if you find yourself writing long variable names like `SearchCompletedList` repeatedly. (If you prefer, you can switch off automatic word completion by
|
||||||
|
setting `autocompleteword.automatic` to 0 ([see setting options](#options)), and then you can use
|
||||||
|
`Edit|Complete Word (Ctrl+Enter)` to get a list of suggested words.)
|
||||||
|
|
||||||
|
For working with Lua code specifically, there is also `Edit|Complete Symbol (Ctrl+I)`. This
|
||||||
|
uses the supplied Lua _api file_ to complete the library function. For example,
|
||||||
|
if I type 'st' in a Lua file, then `Ctrl+I` will supply a drop-down list of all Lua library functions
|
||||||
|
that begin with 'st', such as 'string.byte','string.char', etc. Furthermore, if you then choose one of these functions, then as soon as you enter '(' SciTE will provide a _calltip_ with
|
||||||
|
the parameters and a helpful one-line summary. This will also happen whenever you have typed
|
||||||
|
one of these library functions in directly.
|
||||||
|
|
||||||
|
![calltip](calltip.png)
|
||||||
|
|
||||||
|
## Running Programs
|
||||||
|
|
||||||
|
![toolbar](toolbar.png)
|
||||||
|
|
||||||
|
`Tools|Go (F5)` ![run](run.png) will run the current script. (This operation is also available
|
||||||
|
from the toolbar as the green arrow) If the script needs command-line
|
||||||
|
parameters, up to four parameters can be specified with `View|Parameters`.
|
||||||
|
If you have a runaway program stuck in a loop then `Tools|Stop Executing (Ctrl+Break)`
|
||||||
|
will kill it; the icon next to the Run icon will be enabled and can also be used.
|
||||||
|
|
||||||
|
Any output or errors will appear in the Output pane; If the execution of
|
||||||
|
a script fails, then the error line is automatically shown. This can also be achieved by
|
||||||
|
clicking on a error message. (Or by using `Tools|Next Message (F4)`, which is useful if
|
||||||
|
there are many compile errors. This also works for the results of `Search|Find in Files`)
|
||||||
|
|
||||||
|
The Output pane also supports the usual selection and clipboard operations; these are
|
||||||
|
also available through the right-click context menu. To open or close the
|
||||||
|
Output pane, use F8.
|
||||||
|
|
||||||
|
## Using Lua Interactively
|
||||||
|
|
||||||
|
The little prompt icon ![prompt](prompt.png) will put you into a Lua interactive prompt. This
|
||||||
|
prompt is different from the usual Lua prompt because tables will be printed
|
||||||
|
out nicely. Plus, it is now easy to copy stuff to the clipboard.
|
||||||
|
|
||||||
|
> = 5*2
|
||||||
|
10
|
||||||
|
> t = {1,2,3}
|
||||||
|
> = t
|
||||||
|
{1,2,3}
|
||||||
|
|
||||||
|
This Lua prompt will automatically stay in the same directory as the current
|
||||||
|
file, which is very useful for testing small bits of code. For instance, save
|
||||||
|
this as 'sqr.lua':
|
||||||
|
|
||||||
|
function sqr(x)
|
||||||
|
return x*x
|
||||||
|
end
|
||||||
|
|
||||||
|
You can now move to the output pane (just click it with the mouse, or
|
||||||
|
`Ctrl-F6` if you prefer using the keyboard), load the file using `dofile "sqr.lua"`
|
||||||
|
and type `sqr(10)`
|
||||||
|
|
||||||
|
> dofile 'sqr.lua'
|
||||||
|
> sqr(10)
|
||||||
|
100
|
||||||
|
> sqr('10')
|
||||||
|
100
|
||||||
|
> sqr('bonzo')
|
||||||
|
stdin:1: attempt to perform arithmetic on local 'x' (a string value)
|
||||||
|
...
|
||||||
|
|
||||||
|
You now understand the limitations of your simple function; it cannot
|
||||||
|
square things which cannot be converted into numbers. (The icon next
|
||||||
|
to the Lua prompt icon has the same effect as typing `dofile` directly.
|
||||||
|
|
||||||
|
Another feature which can be very useful is that three commands are
|
||||||
|
available (`cd`, `dir` and `edit`) which work like DOS commands.
|
||||||
|
For example:
|
||||||
|
|
||||||
|
> dir *.lua
|
||||||
|
controller.lua
|
||||||
|
remdebug
|
||||||
|
remdebug.lua
|
||||||
|
> cd
|
||||||
|
C:\Program Files\SciTE\scite-debug\remDebug
|
||||||
|
> cd remdebug
|
||||||
|
> dir
|
||||||
|
engine.lua
|
||||||
|
> edit engine.lua
|
||||||
|
|
||||||
|
Where `edit` will open the file in SciTE.
|
||||||
|
|
||||||
|
Generally, interactive Lua is the best place to learn about the available
|
||||||
|
libraries and to test out things like string patterns, etc. The idea is that
|
||||||
|
writing longer programs is easier once you have tested tricky bits
|
||||||
|
interactively.
|
||||||
|
|
||||||
|
To leave the Lua prompt, just type quit.
|
||||||
|
|
||||||
|
## Debugging Programs
|
||||||
|
|
||||||
|
Debugging involves running your program in a controlled environment where
|
||||||
|
you can stop at specified lines called breakpoints, and then move a line at
|
||||||
|
a time, called stepping. Single-stepping goes to the next line that will be
|
||||||
|
executed, and will enter functions, whereas 'stepping over' will step over
|
||||||
|
any function calls and stop at the line after the call. Here is an example
|
||||||
|
script ('script1.lua'); note that the line numbers are not part of the program!
|
||||||
|
(script1.lua is available in the scite-debug\tests directory)
|
||||||
|
|
||||||
|
01 function two(x)
|
||||||
|
02 print(x)
|
||||||
|
03 end
|
||||||
|
04 function one(y)
|
||||||
|
05 print(y)
|
||||||
|
06 two('go')
|
||||||
|
07 print('there')
|
||||||
|
08 end
|
||||||
|
09
|
||||||
|
10 one('dolly')
|
||||||
|
|
||||||
|
When you start the debugger, it will stop at the first executable line.
|
||||||
|
You can now single-step your way to the code of interest, but it's easier
|
||||||
|
to set a breakpoint using F9 and then use `Debug|Run` again to continue.
|
||||||
|
The stopped line is shown with a green background, and the text on the
|
||||||
|
status bar changes to 'active'. Set a breakpoint for line 10 and continue.
|
||||||
|
|
||||||
|
Single-stepping will then lead you to line 5; stepping again will put
|
||||||
|
you on line 6. If you now single-step again, you will enter the function two
|
||||||
|
at line 2; if you had stepped over, you would have directly proceeded to
|
||||||
|
line 7.
|
||||||
|
|
||||||
|
When stopped, you can inspect any value in two different ways; by letting
|
||||||
|
the mouse hover over a variable (called 'tooltip evaluation') or explicitly
|
||||||
|
using `Debug|Inspect` or the toolbar inspect icon. In this case the value will
|
||||||
|
be written out to the Output pane. For example, when stopped at line 2,
|
||||||
|
hovering the mouse over 'x' will give the tooltip "x = 'go'". Hovering over 'y'
|
||||||
|
in line 4 will give no value, because y is a local variable which is only
|
||||||
|
meaningful when you are in function one.
|
||||||
|
|
||||||
|
When you are stopped at line 2, you can print out the call stack
|
||||||
|
`Debug|Backtrace, ctrl+alt+B`:
|
||||||
|
|
||||||
|
[1] two in script1.lua:2 ***
|
||||||
|
[2] one in script1.lua:6
|
||||||
|
[3] main in script1.lua:10
|
||||||
|
[4] C in [C]:-1
|
||||||
|
|
||||||
|
Moving 'up' (alt+U) means going back to the point where two() was called;
|
||||||
|
moving up again gets you to where one() was called at line 10. Simularly,
|
||||||
|
you can now move down. The call stack gets _deeper_, which is why
|
||||||
|
moving _down_ gets you back to the current position. You can always
|
||||||
|
move to a particular stack frame by double-clicking on one of the lines in
|
||||||
|
the stack trace. When you have moved to a particular stack frame, the
|
||||||
|
context changes so that the local variables at that point become available
|
||||||
|
again. But note that in this case the execution point is still at line 2, so if
|
||||||
|
you single-step again you will go back to the 'bottom' of the stack and
|
||||||
|
move onto line 3.
|
||||||
|
|
||||||
|
If your program crashes at any point, the line changes to red and a stack
|
||||||
|
trace is automatically printed. Note that the program is not dead! You can
|
||||||
|
inspect any values you like, move up and down the stacktrace, etc. To
|
||||||
|
finish the program, either kill it with `Debug|Kill (alt+K)` or just by contining
|
||||||
|
`Debug|Run, alt+R`. (The red icon at the end of the toolbar achieves the
|
||||||
|
same result.)
|
||||||
|
|
||||||
|
It is often useful to watch how a variable changes, which is set with
|
||||||
|
`Debug|Watch`. Each time you stop at a line, watch expressions will be
|
||||||
|
printed out in the Output Pane.
|
||||||
|
|
||||||
|
All these operations are available on the toolbar, but there are keyboard
|
||||||
|
shortcuts as well:
|
||||||
|
|
||||||
|
F9 set breakpoint at current line
|
||||||
|
alt+R start debugging; if stopped at a line, continue execution.
|
||||||
|
alt+C single step to the next line
|
||||||
|
alt+N step over functions ('next line')
|
||||||
|
alt+G run until cursor ('go to')
|
||||||
|
alt+I inspect expression at cursor
|
||||||
|
alt+W add expression to watches
|
||||||
|
alt+U go up to the function that called this function
|
||||||
|
alt+D go down to the function that was called from here
|
||||||
|
ctrl+alt+B backtrace
|
||||||
|
|
||||||
|
Once your Lua script is fully debugged, you can run it from the command
|
||||||
|
line by typing in the name of the script at the command line or double
|
||||||
|
clicking on the Lua script file from Windows Explorer.
|
||||||
|
|
After Width: | Height: | Size: 4.6 KiB |
|
@ -0,0 +1,522 @@
|
||||||
|
# Define SciTE settings for HTML files.
|
||||||
|
|
||||||
|
# vxml added by lseredi
|
||||||
|
|
||||||
|
# tpl is X and Mail specific
|
||||||
|
file.patterns.web=*.html;*.htm;*.asp;*.shtml;*.htd;*.jsp
|
||||||
|
file.patterns.php=*.php3;*.phtml;*.php
|
||||||
|
file.patterns.html=$(file.patterns.web);$(file.patterns.php);*.htt;*.cfm;*.tpl;*.dtd;*.hta
|
||||||
|
file.patterns.vxml=*.vxml
|
||||||
|
file.patterns.xml=*.xml;*.xsl;*.svg;*.xul;*.xsd;*.dtd;*.xslt;*.axl;*.xrc;*.rdf
|
||||||
|
file.patterns.docbook=*.docbook
|
||||||
|
|
||||||
|
lexer.$(file.patterns.html)=hypertext
|
||||||
|
lexer.$(file.patterns.vxml)=hypertext
|
||||||
|
lexer.$(file.patterns.xml)=xml
|
||||||
|
lexer.$(file.patterns.docbook)=hypertext
|
||||||
|
|
||||||
|
filter.web=Web (html htm asp shtml css xml docbook jsp)|$(file.patterns.web);*.css;*.xml;*.docbook|
|
||||||
|
filter.php=PHP (php php3 phtml)|$(file.patterns.php)|
|
||||||
|
|
||||||
|
fold.html=1
|
||||||
|
#fold.html.preprocessor=0
|
||||||
|
|
||||||
|
#Default Language=1 for JS, 2 for VBS.
|
||||||
|
#asp.default.language=2
|
||||||
|
#html.tags.case.sensitive=1
|
||||||
|
|
||||||
|
#xml.auto.close.tags=1
|
||||||
|
|
||||||
|
# All hypertext elements and attributes must be listed in lower case
|
||||||
|
hypertext.elements=\
|
||||||
|
a abbr acronym address applet area b base basefont \
|
||||||
|
bdo big blockquote body br button caption center \
|
||||||
|
cite code col colgroup dd del dfn dir div dl dt em \
|
||||||
|
fieldset font form frame frameset h1 h2 h3 h4 h5 h6 \
|
||||||
|
head hr html i iframe img input ins isindex kbd label \
|
||||||
|
legend li link map menu meta noframes noscript \
|
||||||
|
object ol optgroup option p param pre q s samp \
|
||||||
|
script select small span strike strong style sub sup \
|
||||||
|
table tbody td textarea tfoot th thead title tr tt u ul \
|
||||||
|
var xml xmlns
|
||||||
|
|
||||||
|
hypertext.attributes=\
|
||||||
|
abbr accept-charset accept accesskey action align alink \
|
||||||
|
alt archive axis background bgcolor border \
|
||||||
|
cellpadding cellspacing char charoff charset checked cite \
|
||||||
|
class classid clear codebase codetype color cols colspan \
|
||||||
|
compact content coords \
|
||||||
|
data datafld dataformatas datapagesize datasrc datetime \
|
||||||
|
declare defer dir disabled enctype event \
|
||||||
|
face for frame frameborder \
|
||||||
|
headers height href hreflang hspace http-equiv \
|
||||||
|
id ismap label lang language leftmargin link longdesc \
|
||||||
|
marginwidth marginheight maxlength media method multiple \
|
||||||
|
name nohref noresize noshade nowrap \
|
||||||
|
object onblur onchange onclick ondblclick onfocus \
|
||||||
|
onkeydown onkeypress onkeyup onload onmousedown \
|
||||||
|
onmousemove onmouseover onmouseout onmouseup \
|
||||||
|
onreset onselect onsubmit onunload \
|
||||||
|
profile prompt readonly rel rev rows rowspan rules \
|
||||||
|
scheme scope selected shape size span src standby start style \
|
||||||
|
summary tabindex target text title topmargin type usemap \
|
||||||
|
valign value valuetype version vlink vspace width \
|
||||||
|
text password checkbox radio submit reset \
|
||||||
|
file hidden image
|
||||||
|
|
||||||
|
# As defined in "Web Applications 1.0" Working Draft
|
||||||
|
# http://www.whatwg.org/specs/web-apps/current-work/
|
||||||
|
html5.elements=\
|
||||||
|
article aside calendar canvas card command commandset datagrid datatree \
|
||||||
|
footer gauge header m menubar menulabel nav progress section switch tabbox
|
||||||
|
|
||||||
|
html5.attributes=\
|
||||||
|
active command contenteditable ping
|
||||||
|
|
||||||
|
keywordclass.hypertext=\
|
||||||
|
$(hypertext.elements) $(hypertext.attributes) $(html5.elements) $(html5.attributes) public !doctype
|
||||||
|
|
||||||
|
vxml.elements=\
|
||||||
|
assign audio block break catch choice clear disconnect else elseif \
|
||||||
|
emphasis enumerate error exit field filled form goto grammar help \
|
||||||
|
if initial link log menu meta noinput nomatch object option p paragraph \
|
||||||
|
param phoneme prompt property prosody record reprompt return s say-as \
|
||||||
|
script sentence subdialog submit throw transfer value var voice vxml
|
||||||
|
|
||||||
|
vxml.attributes=\
|
||||||
|
accept age alphabet anchor application base beep bridge category charset \
|
||||||
|
classid cond connecttimeout content contour count dest destexpr dtmf dtmfterm \
|
||||||
|
duration enctype event eventexpr expr expritem fetchtimeout finalsilence \
|
||||||
|
gender http-equiv id level maxage maxstale maxtime message messageexpr \
|
||||||
|
method mime modal mode name namelist next nextitem ph pitch range rate \
|
||||||
|
scope size sizeexpr skiplist slot src srcexpr sub time timeexpr timeout \
|
||||||
|
transferaudio type value variant version volume xml:lang
|
||||||
|
|
||||||
|
keywordclass.vxml=\
|
||||||
|
$(vxml.elements) $(vxml.attributes) public !doctype
|
||||||
|
|
||||||
|
# List from http://www.php.net/manual/en/reserved.php (updated for PHP 5)
|
||||||
|
# For a list with functions http://groups.google.com/group/scite-interest/web/extras
|
||||||
|
# All words should be lower case to ensure case insensitivity when comparing
|
||||||
|
keywordclass.php=\
|
||||||
|
and array as bool boolean break case cfunction class const continue declare \
|
||||||
|
default die directory do double echo else elseif empty enddeclare endfor \
|
||||||
|
endforeach endif endswitch endwhile eval exit extends false float for \
|
||||||
|
foreach function global if include include_once int integer isset list new \
|
||||||
|
null object old_function or parent print real require require_once resource \
|
||||||
|
return static stdclass string switch true unset use var while xor \
|
||||||
|
abstract catch clone exception final implements interface php_user_filter \
|
||||||
|
private protected public this throw try \
|
||||||
|
__class__ __file__ __function__ __line__ __method__ __sleep __wakeup
|
||||||
|
|
||||||
|
# Override keywordclass.php with another file if present
|
||||||
|
import phpfunctions
|
||||||
|
|
||||||
|
keywords.$(file.patterns.html)=$(keywordclass.hypertext)
|
||||||
|
# JavaScript keywords are possible inside embedded Javascript
|
||||||
|
keywords2.$(file.patterns.html)=$(keywordclass.javascript)
|
||||||
|
# VBScript keywords are possible inside embedded VBScript
|
||||||
|
keywords3.$(file.patterns.html)=$(keywordclass.vb)
|
||||||
|
# Python keywords are possible inside embedded Python
|
||||||
|
keywords4.$(file.patterns.html)=$(keywordclass.python)
|
||||||
|
# PHP keywords are possible inside embedded PHP
|
||||||
|
keywords5.$(file.patterns.html)=$(keywordclass.php)
|
||||||
|
# SGML / DTD keywords
|
||||||
|
keywords6.$(file.patterns.html)=ELEMENT DOCTYPE ATTLIST ENTITY NOTATION
|
||||||
|
|
||||||
|
# START DocBook
|
||||||
|
docbook.elements42=\
|
||||||
|
abbrev abstract accel ackno acronym action address affiliation alt anchor \
|
||||||
|
answer appendix appendixinfo application area areaset areaspec arg article \
|
||||||
|
articleinfo artpagenums attribution audiodata audioobject author authorblurb \
|
||||||
|
authorgroup authorinitials beginpage bibliocoverage bibliodiv biblioentry \
|
||||||
|
bibliography bibliographyinfo biblioid bibliomisc bibliomixed bibliomset \
|
||||||
|
bibliorelation biblioset bibliosource blockinfo blockquote book bookinfo \
|
||||||
|
bridgehead callout calloutlist caption caution chapter chapterinfo citation \
|
||||||
|
citebiblioid citerefentry citetitle city classname classsynopsis classsynopsisinfo \
|
||||||
|
cmdsynopsis co collab collabname colophon colspec command computeroutput \
|
||||||
|
confdates confgroup confnum confsponsor conftitle constant constraint \
|
||||||
|
constraintdef constructorsynopsis contractnum contractsponsor contrib \
|
||||||
|
copyright coref corpauthor corpname country database date dedication \
|
||||||
|
destructorsynopsis edition editor email emphasis entry entrytbl envar \
|
||||||
|
epigraph equation errorcode errorname errortext errortype example \
|
||||||
|
exceptionname fax fieldsynopsis figure filename firstname firstterm \
|
||||||
|
footnote footnoteref foreignphrase formalpara funcdef funcparams \
|
||||||
|
funcprototype funcsynopsis funcsynopsisinfo function glossary glossaryinfo \
|
||||||
|
glossdef glossdiv glossentry glosslist glosssee glossseealso glossterm \
|
||||||
|
graphic graphicco group guibutton guiicon guilabel guimenu guimenuitem \
|
||||||
|
guisubmenu hardware highlights holder honorific htm imagedata imageobject \
|
||||||
|
imageobjectco important index indexdiv indexentry indexinfo indexterm \
|
||||||
|
informalequation informalexample informalfigure informaltable initializer \
|
||||||
|
inlineequation inlinegraphic inlinemediaobject interface interfacename \
|
||||||
|
invpartnumber isbn issn issuenum itemizedlist itermset jobtitle keycap \
|
||||||
|
keycode keycombo keysym keyword keywordset label legalnotice lhs lineage \
|
||||||
|
lineannotation link listitem iteral literallayout lot lotentry manvolnum \
|
||||||
|
markup medialabel mediaobject mediaobjectco member menuchoice methodname \
|
||||||
|
methodparam methodsynopsis mm modespec modifier ousebutton msg msgaud \
|
||||||
|
msgentry msgexplan msginfo msglevel msgmain msgorig msgrel msgset msgsub \
|
||||||
|
msgtext nonterminal note objectinfo olink ooclass ooexception oointerface \
|
||||||
|
option optional orderedlist orgdiv orgname otheraddr othercredit othername \
|
||||||
|
pagenums para paramdef parameter part partinfo partintro personblurb \
|
||||||
|
personname phone phrase pob postcode preface prefaceinfo primary primaryie \
|
||||||
|
printhistory procedure production productionrecap productionset productname \
|
||||||
|
productnumber programlisting programlistingco prompt property pubdate publisher \
|
||||||
|
publishername pubsnumber qandadiv qandaentry qandaset question quote refclass \
|
||||||
|
refdescriptor refentry refentryinfo refentrytitle reference referenceinfo \
|
||||||
|
refmeta refmiscinfo refname refnamediv refpurpose refsect1 refsect1info refsect2 \
|
||||||
|
refsect2info refsect3 refsect3info refsection refsectioninfo refsynopsisdiv \
|
||||||
|
refsynopsisdivinfo releaseinfo remark replaceable returnvalue revdescription \
|
||||||
|
revhistory revision revnumber revremark rhs row sbr screen screenco screeninfo \
|
||||||
|
screenshot secondary secondaryie sect1 sect1info sect2 sect2info sect3 sect3info \
|
||||||
|
sect4 sect4info sect5 sect5info section sectioninfo see seealso seealsoie \
|
||||||
|
seeie seg seglistitem segmentedlist segtitle seriesvolnums set setindex \
|
||||||
|
setindexinfo setinfo sgmltag shortaffil shortcut sidebar sidebarinfo simpara \
|
||||||
|
simplelist simplemsgentry simplesect spanspec state step street structfield \
|
||||||
|
structname subject subjectset subjectterm subscript substeps subtitle \
|
||||||
|
superscript surname sv symbol synopfragment synopfragmentref synopsis \
|
||||||
|
systemitem table tbody term tertiary tertiaryie textdata textobject tfoot \
|
||||||
|
tgroup thead tip title titleabbrev toc tocback tocchap tocentry tocfront \
|
||||||
|
toclevel1 toclevel2 toclevel3 toclevel4 toclevel5 tocpart token trademark \
|
||||||
|
type ulink userinput varargs variablelist varlistentry varname videodata \
|
||||||
|
videoobject void volumenum warning wordasword xref year
|
||||||
|
|
||||||
|
docbook.attributes=\
|
||||||
|
arch condition conformance id lang os remap role revision revisionflag security \
|
||||||
|
userlevel vendor xreflabel \
|
||||||
|
status label endterm linkend space width
|
||||||
|
|
||||||
|
keywordclass.docbook=\
|
||||||
|
$(docbook.elements42) $(docbook.attributes)
|
||||||
|
|
||||||
|
keywords.$(file.patterns.docbook)=$(keywordclass.docbook)
|
||||||
|
keywords6.$(file.patterns.docbook)=ELEMENT DOCTYPE ATTLIST ENTITY NOTATION
|
||||||
|
# END DocBook
|
||||||
|
|
||||||
|
word.characters.$(file.patterns.html)=$(chars.alpha)$(chars.numeric)_-
|
||||||
|
comment.stream.start.hypertext=<!--
|
||||||
|
comment.stream.end.hypertext=-->
|
||||||
|
comment.block.hypertext=//~
|
||||||
|
|
||||||
|
# No keyword for xml, as it accepts any keyword
|
||||||
|
keywords.$(file.patterns.xml)=
|
||||||
|
# SGML / DTD keywords
|
||||||
|
keywords6.$(file.patterns.xml)=ELEMENT DOCTYPE ATTLIST ENTITY NOTATION
|
||||||
|
|
||||||
|
word.characters.$(file.patterns.xml)=$(chars.alpha)$(chars.numeric)_-
|
||||||
|
|
||||||
|
keywords.$(file.patterns.vxml)=$(keywordclass.vxml)
|
||||||
|
keywords2.$(file.patterns.vxml)=$(keywordclass.javascript)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
word.characters.$(file.patterns.vxml)=$(chars.alpha)$(chars.numeric)_-
|
||||||
|
|
||||||
|
# HTML and XML share lexing code so use the same style numbers
|
||||||
|
# Hypertext Markup Language
|
||||||
|
|
||||||
|
# Text
|
||||||
|
style.hypertext.0=$(stdstyle.default)
|
||||||
|
# Tags
|
||||||
|
style.hypertext.1=$(stdstyle.keyword1)
|
||||||
|
# Unknown Tags
|
||||||
|
style.hypertext.2=$(stdstyle.error)
|
||||||
|
# Attributes
|
||||||
|
style.hypertext.3=$(stdstyle.keyword2)
|
||||||
|
# Unknown Attributes
|
||||||
|
style.hypertext.4=$(stdstyle.error)
|
||||||
|
# Numbers
|
||||||
|
style.hypertext.5=$(stdstyle.number1)
|
||||||
|
# Double quoted strings
|
||||||
|
style.hypertext.6=$(stdstyle.string1)
|
||||||
|
# Single quoted strings
|
||||||
|
style.hypertext.7=$(stdstyle.char1)
|
||||||
|
# Other inside tag
|
||||||
|
style.hypertext.8=$(stdstyle.keyword2)
|
||||||
|
# Comment
|
||||||
|
style.hypertext.9=$(stdstyle.comment1)
|
||||||
|
# Entities
|
||||||
|
style.hypertext.10=$(stdstyle.preprocessor2)
|
||||||
|
# XML style tag ends '/>'
|
||||||
|
style.hypertext.11=$(stdstyle.preprocessor1)
|
||||||
|
# XML identifier start '<?'
|
||||||
|
style.hypertext.12=$(stdstyle.preprocessor1)
|
||||||
|
# XML identifier end '?>'
|
||||||
|
style.hypertext.13=$(stdstyle.preprocessor1)
|
||||||
|
# SCRIPT
|
||||||
|
style.hypertext.14=fore:#000080
|
||||||
|
# ASP <% ... %>
|
||||||
|
style.hypertext.15=back:#FFFF00
|
||||||
|
# ASP <% ... %>
|
||||||
|
style.hypertext.16=back:#FFDF00
|
||||||
|
# CDATA
|
||||||
|
style.hypertext.17=back:#FFDF00
|
||||||
|
# PHP
|
||||||
|
style.hypertext.18=fore:#0000FF,back:#FFEFBF
|
||||||
|
# Unquoted values
|
||||||
|
style.hypertext.19=fore:#FF00FF,back:#FFEFFF
|
||||||
|
# JSP Comment <%-- ... --%>
|
||||||
|
style.hypertext.20=fore:#000000,back:#FFFFD0
|
||||||
|
# SGML tags <! ... >
|
||||||
|
style.hypertext.21=fore:#000080,back:#EFEFFF
|
||||||
|
# SGML command
|
||||||
|
style.hypertext.22=fore:#000080,back:#EFEFFF,bold
|
||||||
|
# SGML 1st param
|
||||||
|
style.hypertext.23=fore:#006600,back:#EFEFFF
|
||||||
|
# SGML double string
|
||||||
|
style.hypertext.24=fore:#800000,back:#EFEFFF
|
||||||
|
# SGML single string
|
||||||
|
style.hypertext.25=fore:#993300,back:#EFEFFF
|
||||||
|
# SGML error
|
||||||
|
style.hypertext.26=fore:#800000,back:#FF6666
|
||||||
|
# SGML special (#xxxx type)
|
||||||
|
style.hypertext.27=fore:#3366FF,back:#EFEFFF
|
||||||
|
# SGML entity
|
||||||
|
style.hypertext.28=fore:#333333,back:#EFEFFF
|
||||||
|
# SGML comment
|
||||||
|
style.hypertext.29=fore:#808000,back:#EFEFFF
|
||||||
|
# SGML block
|
||||||
|
style.hypertext.31=fore:#000066,back:#CCCCE0
|
||||||
|
# Some reasonable background colours found in the default Windows palette
|
||||||
|
# Off White #FFFBF0 Light green #C0DCC0 Light Blue #A6CAF0
|
||||||
|
# Matched Operators
|
||||||
|
style.hypertext.34=$(stdstyle.default)
|
||||||
|
style.hypertext.35=$(stdstyle.default)
|
||||||
|
|
||||||
|
# Embedded Javascript
|
||||||
|
fontcolour.js=$(colour.embedded.js),$(font.js)
|
||||||
|
# JS Start - allows eol filled background to not start on same line as SCRIPT tag
|
||||||
|
style.hypertext.40=fore:#7F7F00
|
||||||
|
# JS Default
|
||||||
|
style.hypertext.41=fore:#000000,bold,$(fontcolour.js),eolfilled
|
||||||
|
# JS Comment
|
||||||
|
style.hypertext.42=$(colour.code.comment.box),$(fontcolour.js),eolfilled
|
||||||
|
# JS Line Comment
|
||||||
|
style.hypertext.43=$(colour.code.comment.line),$(fontcolour.js)
|
||||||
|
# JS Doc comment
|
||||||
|
style.hypertext.44=$(colour.code.comment.doc),bold,$(fontcolour.js),eolfilled
|
||||||
|
# JS Number
|
||||||
|
style.hypertext.45=$(colour.number),$(fontcolour.js)
|
||||||
|
# JS Word
|
||||||
|
style.hypertext.46=fore:#000000,$(fontcolour.js)
|
||||||
|
# JS Keyword
|
||||||
|
style.hypertext.47=$(colour.keyword),bold,$(fontcolour.js)
|
||||||
|
# JS Double quoted string
|
||||||
|
style.hypertext.48=$(colour.string),$(fontcolour.js)
|
||||||
|
# JS Single quoted string
|
||||||
|
style.hypertext.49=$(colour.string),$(fontcolour.js)
|
||||||
|
# JS Symbols
|
||||||
|
style.hypertext.50=$(colour.operator),bold,$(fontcolour.js)
|
||||||
|
# JavaScript EOL
|
||||||
|
style.hypertext.51=back:#BFBBB0,eolfilled
|
||||||
|
# JavaScript RegEx
|
||||||
|
style.hypertext.52=back:#FFBBB0
|
||||||
|
|
||||||
|
# ASP Javascript
|
||||||
|
# JS Start - allows eol filled background to not start on same line as SCRIPT tag
|
||||||
|
style.hypertext.55=fore:#7F7F00
|
||||||
|
# JS Default
|
||||||
|
style.hypertext.56=fore:#000000,bold,$(font.js),back:#DFDF7F,eolfilled
|
||||||
|
# JS Comment
|
||||||
|
style.hypertext.57=fore:#007F00,$(font.js),back:#DFDF7F,eolfilled
|
||||||
|
# JS Line Comment
|
||||||
|
style.hypertext.58=fore:#007F00,$(font.js),back:#DFDF7F
|
||||||
|
# JS Doc comment
|
||||||
|
style.hypertext.59=fore:#7F7F7F,bold,$(font.js),back:#DFDF7F,eolfilled
|
||||||
|
# JS Number
|
||||||
|
style.hypertext.60=fore:#007F7F,$(font.js),back:#DFDF7F
|
||||||
|
# JS Word
|
||||||
|
style.hypertext.61=fore:#000000,$(font.js),back:#DFDF7F
|
||||||
|
# JS Keyword
|
||||||
|
style.hypertext.62=fore:#00007F,bold,$(font.js),back:#DFDF7F
|
||||||
|
# JS Double quoted string
|
||||||
|
style.hypertext.63=fore:#7F007F,$(font.js),back:#DFDF7F
|
||||||
|
# JS Single quoted string
|
||||||
|
style.hypertext.64=fore:#7F007F,$(font.js),back:#DFDF7F
|
||||||
|
# JS Symbols
|
||||||
|
style.hypertext.65=fore:#000000,bold,$(font.js),back:#DFDF7F
|
||||||
|
# JavaScript EOL
|
||||||
|
style.hypertext.66=back:#BFBBB0,eolfilled
|
||||||
|
# JavaScript RegEx
|
||||||
|
style.hypertext.67=back:#FFBBB0
|
||||||
|
|
||||||
|
# Embedded VBS
|
||||||
|
# Start
|
||||||
|
style.hypertext.70=
|
||||||
|
# Default
|
||||||
|
style.hypertext.71=$(font.vbs),back:#EFEFFF,fore:#000000,eolfilled
|
||||||
|
# Comment
|
||||||
|
style.hypertext.72=$(font.comment),back:#EFEFFF,fore:#008000,eolfilled
|
||||||
|
# Number
|
||||||
|
style.hypertext.73=$(font.vbs),back:#EFEFFF,fore:#008080,eolfilled
|
||||||
|
# KeyWord
|
||||||
|
style.hypertext.74=$(font.vbs),back:#EFEFFF,fore:#000080,bold,eolfilled
|
||||||
|
# String
|
||||||
|
style.hypertext.75=$(font.vbs),back:#EFEFFF,fore:#800080,eolfilled
|
||||||
|
# Identifier
|
||||||
|
style.hypertext.76=$(font.vbs),back:#EFEFFF,fore:#000080,eolfilled
|
||||||
|
# Unterminated string
|
||||||
|
style.hypertext.77=$(font.vbs),back:#7F7FFF,fore:#000080,eolfilled
|
||||||
|
|
||||||
|
# ASP VBS
|
||||||
|
# Start
|
||||||
|
style.hypertext.80=
|
||||||
|
# Default
|
||||||
|
style.hypertext.81=$(font.vbs),back:#CFCFEF,fore:#000000,eolfilled
|
||||||
|
# Comment
|
||||||
|
style.hypertext.82=$(font.comment),back:#CFCFEF,fore:#008000,eolfilled
|
||||||
|
# Number
|
||||||
|
style.hypertext.83=$(font.vbs),back:#CFCFEF,fore:#008080,eolfilled
|
||||||
|
# KeyWord
|
||||||
|
style.hypertext.84=$(font.vbs),back:#CFCFEF,fore:#000080,bold,eolfilled
|
||||||
|
# String
|
||||||
|
style.hypertext.85=$(font.vbs),back:#CFCFEF,fore:#800080,eolfilled
|
||||||
|
# Identifier
|
||||||
|
style.hypertext.86=$(font.vbs),back:#CFCFEF,fore:#000080,eolfilled
|
||||||
|
# Unterminated string
|
||||||
|
style.hypertext.87=$(font.vbs),back:#7F7FBF,fore:#000080,eolfilled
|
||||||
|
|
||||||
|
# Embedded Python
|
||||||
|
style.hypertext.90=fore:#808080
|
||||||
|
style.hypertext.91=fore:#808080,back:#EFFFEF,eolfilled
|
||||||
|
# Comment
|
||||||
|
style.hypertext.92=fore:#007F00,$(font.comment),back:#EFFFEF,eolfilled
|
||||||
|
# Number
|
||||||
|
style.hypertext.93=fore:#007F7F,back:#EFFFEF,eolfilled
|
||||||
|
# String
|
||||||
|
style.hypertext.94=fore:#7F007F,$(font.monospace),back:#EFFFEF,eolfilled
|
||||||
|
# Single quoted string
|
||||||
|
style.hypertext.95=fore:#7F007F,$(font.monospace),back:#EFFFEF,eolfilled
|
||||||
|
# Keyword
|
||||||
|
style.hypertext.96=fore:#00007F,bold,back:#EFFFEF,eolfilled
|
||||||
|
# Triple quotes
|
||||||
|
style.hypertext.97=fore:#7F0000,back:#EFFFEF,eolfilled
|
||||||
|
# Triple double quotes
|
||||||
|
style.hypertext.98=fore:#7F0000,back:#EFFFEF,eolfilled
|
||||||
|
# Class name definition
|
||||||
|
style.hypertext.99=fore:#0000FF,bold,back:#EFFFEF,eolfilled
|
||||||
|
# Function or method name definition
|
||||||
|
style.hypertext.100=fore:#007F7F,bold,back:#EFFFEF,eolfilled
|
||||||
|
# Operators
|
||||||
|
style.hypertext.101=bold,back:#EFFFEF,eolfilled
|
||||||
|
# Identifiers
|
||||||
|
style.hypertext.102=back:#EFFFEF,eolfilled
|
||||||
|
|
||||||
|
# PHP complex variable
|
||||||
|
style.hypertext.104=fore:#007F00,italics,back:#FFF8F8
|
||||||
|
|
||||||
|
# ASP Python
|
||||||
|
style.hypertext.105=fore:#808080
|
||||||
|
style.hypertext.106=fore:#808080,back:#CFEFCF,eolfilled
|
||||||
|
# Comment
|
||||||
|
style.hypertext.107=fore:#007F00,$(font.comment),back:#CFEFCF,eolfilled
|
||||||
|
# Number
|
||||||
|
style.hypertext.108=fore:#007F7F,back:#CFEFCF,eolfilled
|
||||||
|
# String
|
||||||
|
style.hypertext.109=fore:#7F007F,$(font.monospace),back:#CFEFCF,eolfilled
|
||||||
|
# Single quoted string
|
||||||
|
style.hypertext.110=fore:#7F007F,$(font.monospace),back:#CFEFCF,eolfilled
|
||||||
|
# Keyword
|
||||||
|
style.hypertext.111=fore:#00007F,bold,back:#CFEFCF,eolfilled
|
||||||
|
# Triple quotes
|
||||||
|
style.hypertext.112=fore:#7F0000,back:#CFEFCF,eolfilled
|
||||||
|
# Triple double quotes
|
||||||
|
style.hypertext.113=fore:#7F0000,back:#CFEFCF,eolfilled
|
||||||
|
# Class name definition
|
||||||
|
style.hypertext.114=fore:#0000FF,bold,back:#CFEFCF,eolfilled
|
||||||
|
# Function or method name definition
|
||||||
|
style.hypertext.115=fore:#007F7F,bold,back:#CFEFCF,eolfilled
|
||||||
|
# Operators
|
||||||
|
style.hypertext.116=bold,back:#CFEFCF,eolfilled
|
||||||
|
# Identifiers
|
||||||
|
style.hypertext.117=back:#CFEFCF,eolfilled
|
||||||
|
|
||||||
|
# PHP
|
||||||
|
# Default
|
||||||
|
style.hypertext.118=fore:#000033,back:#FFF8F8,eolfilled
|
||||||
|
# Double quoted String
|
||||||
|
style.hypertext.119=fore:#007F00,back:#FFF8F8
|
||||||
|
# Single quoted string
|
||||||
|
style.hypertext.120=fore:#009F00,back:#FFF8F8
|
||||||
|
# Keyword
|
||||||
|
style.hypertext.121=fore:#7F007F,italics,back:#FFF8F8
|
||||||
|
# Number
|
||||||
|
style.hypertext.122=fore:#CC9900,back:#FFF8F8
|
||||||
|
# Variable
|
||||||
|
style.hypertext.123=fore:#00007F,italics,back:#FFF8F8
|
||||||
|
# Comment
|
||||||
|
style.hypertext.124=fore:#999999,$(font.comment),back:#FFF8F8
|
||||||
|
# One line comment
|
||||||
|
style.hypertext.125=fore:#666666,italics,$(font.comment),back:#FFF8F8
|
||||||
|
# PHP variable in double quoted string
|
||||||
|
style.hypertext.126=fore:#007F00,italics,back:#FFF8F8
|
||||||
|
# PHP operator
|
||||||
|
style.hypertext.127=fore:#000000,back:#FFF8F8
|
||||||
|
|
||||||
|
# XML: eXtensible Markup Language
|
||||||
|
# For XML, there is no list of known tags or attributes so all are coloured known
|
||||||
|
|
||||||
|
# Default
|
||||||
|
style.xml.0=fore:#000000,$(font.text)
|
||||||
|
# Tags
|
||||||
|
style.xml.1=fore:#000080
|
||||||
|
# Unknown Tags
|
||||||
|
style.xml.2=fore:#000080
|
||||||
|
# Attributes
|
||||||
|
style.xml.3=fore:#008080
|
||||||
|
# Unknown Attributes
|
||||||
|
style.xml.4=fore:#008080
|
||||||
|
# Numbers
|
||||||
|
style.xml.5=$(colour.number)
|
||||||
|
# Double quoted strings
|
||||||
|
style.xml.6=$(colour.string)
|
||||||
|
# Single quoted strings
|
||||||
|
style.xml.7=$(colour.string)
|
||||||
|
# Other inside tag
|
||||||
|
style.xml.8=fore:#800080
|
||||||
|
# Comment
|
||||||
|
style.xml.9=fore:#808000
|
||||||
|
# Entities
|
||||||
|
style.xml.10=fore:#800080,$(font.text)
|
||||||
|
# XML style tag ends '/>'
|
||||||
|
style.xml.11=fore:#000080
|
||||||
|
# XML identifier start '<?'
|
||||||
|
style.xml.12=fore:#800080,bold
|
||||||
|
# XML identifier end '?>'
|
||||||
|
style.xml.13=fore:#800080,bold
|
||||||
|
# CDATA
|
||||||
|
style.xml.17=fore:#800000,back:#FFF0F0,$(font.text),eolfilled
|
||||||
|
# Question
|
||||||
|
style.xml.18=fore:#800000
|
||||||
|
# Unquoted Value
|
||||||
|
style.xml.19=fore:#608060
|
||||||
|
# SGML tags <! ... >
|
||||||
|
style.xml.21=fore:#000080,back:#EFEFFF
|
||||||
|
# SGML command
|
||||||
|
style.xml.22=fore:#000080,back:#EFEFFF,bold
|
||||||
|
# SGML 1st param
|
||||||
|
style.xml.23=fore:#006600,back:#EFEFFF
|
||||||
|
# SGML double string
|
||||||
|
style.xml.24=fore:#800000,back:#EFEFFF
|
||||||
|
# SGML single string
|
||||||
|
style.xml.25=fore:#993300,back:#EFEFFF
|
||||||
|
# SGML error
|
||||||
|
style.xml.26=fore:#800000,back:#FF6666
|
||||||
|
# SGML special (#xxxx type)
|
||||||
|
style.xml.27=fore:#3366FF,back:#EFEFFF
|
||||||
|
# SGML entity
|
||||||
|
style.xml.28=fore:#333333,back:#EFEFFF
|
||||||
|
# SGML comment
|
||||||
|
style.xml.29=fore:#808000,back:#EFEFFF
|
||||||
|
# SGML block
|
||||||
|
style.xml.31=fore:#000066,back:#CCCCE0
|
||||||
|
# No brace matching in XML
|
||||||
|
braces.xml.style=31
|
||||||
|
|
||||||
|
if PLAT_WIN
|
||||||
|
command.go.$(file.patterns.web)="file://$(FilePath)"
|
||||||
|
command.go.subsystem.$(file.patterns.web)=2
|
||||||
|
if PLAT_GTK
|
||||||
|
command.go.$(file.patterns.web)=netscape "file://$(FilePath)"
|
||||||
|
|
||||||
|
command.go.$(file.patterns.php)=php -f "$(FileNameExt)"
|
||||||
|
command.compile.$(file.patterns.php)=php -l "$(FileNameExt)"
|
After Width: | Height: | Size: 1.4 KiB |
After Width: | Height: | Size: 1.4 KiB |
|
@ -0,0 +1,164 @@
|
||||||
|
# Define SciTE settings for Lua files.
|
||||||
|
|
||||||
|
file.patterns.lua=*.lua;*.wlua;*.lexe;*.glua;*.gluaw;*.mlua;*.clua
|
||||||
|
|
||||||
|
shbang.lua=lua
|
||||||
|
|
||||||
|
filter.lua=Lua (lua)|$(file.patterns.lua)|
|
||||||
|
|
||||||
|
lexer.$(file.patterns.lua)=lua
|
||||||
|
|
||||||
|
open.suffix.*.lua=.lua
|
||||||
|
openpath.$(file.patterns.lua)=$(lua.directory)\lua
|
||||||
|
|
||||||
|
word.chars.lua=$(chars.alpha)$(chars.numeric)$(chars.accented)_%
|
||||||
|
word.characters.$(file.patterns.lua)=$(word.chars.lua)
|
||||||
|
|
||||||
|
api.$(file.patterns.lua)=$(SciteDefaultHome)\lualib5_annot.api
|
||||||
|
calltip.lua.word.characters=.:$(word.chars.lua)
|
||||||
|
calltip.lua.end.definition=)
|
||||||
|
|
||||||
|
keywordclass.lua=and break do else elseif end false for function if \
|
||||||
|
in local nil not or repeat return then true until while
|
||||||
|
keywords.$(file.patterns.lua)=$(keywordclass.lua)
|
||||||
|
|
||||||
|
# Basic Functions (in both versions of Lua)
|
||||||
|
keywordclass2.lua=_VERSION assert collectgarbage dofile error gcinfo loadfile loadstring \
|
||||||
|
print rawget rawset require tonumber tostring type unpack
|
||||||
|
|
||||||
|
#### Lua 4.0
|
||||||
|
# Basic Functions
|
||||||
|
keywordclass2.lua4=_ALERT _ERRORMESSAGE _INPUT _PROMPT _OUTPUT \
|
||||||
|
_STDERR _STDIN _STDOUT call dostring foreach foreachi getn globals newtype \
|
||||||
|
sort tinsert tremove
|
||||||
|
|
||||||
|
# String Manipulation & Mathematical Functions
|
||||||
|
keywordclass3.lua4=abs acos asin atan atan2 ceil cos deg exp \
|
||||||
|
floor format frexp gsub ldexp log log10 max min mod rad random randomseed \
|
||||||
|
sin sqrt strbyte strchar strfind strlen strlower strrep strsub strupper tan
|
||||||
|
|
||||||
|
# Input and Output Facilities & System Facilities
|
||||||
|
keywordclass4.lua4=openfile closefile readfrom writeto appendto \
|
||||||
|
remove rename flush seek tmpfile tmpname read write \
|
||||||
|
clock date difftime execute exit getenv setlocale time
|
||||||
|
|
||||||
|
#### Lua 5.0
|
||||||
|
# Basic Functions
|
||||||
|
keywordclass2.lua5=_G getfenv getmetatable ipairs loadlib next pairs pcall \
|
||||||
|
rawequal setfenv setmetatable xpcall \
|
||||||
|
string table math coroutine io os debug \
|
||||||
|
load module select
|
||||||
|
# I put the library names here, so when highlighted standalone, they are probably variable name from Lua 4.0 times.
|
||||||
|
# Last line -> Lua 5.1 functions
|
||||||
|
|
||||||
|
# String Manipulation, Table Manipulation, Mathematical Functions (string & table & math)
|
||||||
|
keywordclass3.lua5=string.byte string.char string.dump string.find string.len \
|
||||||
|
string.lower string.rep string.sub string.upper string.format string.gfind string.gsub \
|
||||||
|
table.concat table.foreach table.foreachi table.getn table.sort table.insert table.remove table.setn \
|
||||||
|
math.abs math.acos math.asin math.atan math.atan2 math.ceil math.cos math.deg math.exp \
|
||||||
|
math.floor math.frexp math.ldexp math.log math.log10 math.max math.min math.mod \
|
||||||
|
math.pi math.pow math.rad math.random math.randomseed math.sin math.sqrt math.tan \
|
||||||
|
string.gmatch string.match string.reverse table.maxn \
|
||||||
|
math.cosh math.fmod math.modf math.sinh math.tanh math.huge
|
||||||
|
# Last 2 lines -> Lua 5.1 functions
|
||||||
|
|
||||||
|
# Coroutine Manipulation, Input and Output Facilities, System Facilities (coroutine & io & os)
|
||||||
|
keywordclass4.lua5=coroutine.create coroutine.resume coroutine.status \
|
||||||
|
coroutine.wrap coroutine.yield \
|
||||||
|
io.close io.flush io.input io.lines io.open io.output io.read io.tmpfile io.type io.write \
|
||||||
|
io.stdin io.stdout io.stderr \
|
||||||
|
os.clock os.date os.difftime os.execute os.exit os.getenv os.remove os.rename \
|
||||||
|
os.setlocale os.time os.tmpname \
|
||||||
|
coroutine.running package.cpath package.loaded package.loadlib package.path \
|
||||||
|
package.preload package.seeall io.popen
|
||||||
|
# Last 2 lines -> Lua 5.1 functions
|
||||||
|
# debug.debug debug.getfenv debug.gethook debug.getinfo debug.getlocal
|
||||||
|
# debug.getmetatable debug.getregistry debug.getupvalue debug.setfenv
|
||||||
|
# debug.sethook debug.setlocal debug.setmetatable debug.setupvalue debug.traceback
|
||||||
|
|
||||||
|
# I keep keywords5, 6, 7 & 8 for other libraries
|
||||||
|
# To make the change from Lua 4 to Lua 5 as smooth as possible, I made these properties
|
||||||
|
# modular and flexible.
|
||||||
|
# If you use only Lua 4, you can remove the lua5 keywords.
|
||||||
|
# If you use only Lua 5, you can either remove the lua4 keywords, or put them
|
||||||
|
# in another property to highlight them in a warning/error style.
|
||||||
|
# If you still use both, you can keep them like below, or use separate styles.
|
||||||
|
|
||||||
|
keywords2.$(file.patterns.lua)=$(keywordclass2.lua) $(keywordclass2.lua4) $(keywordclass2.lua5)
|
||||||
|
keywords3.$(file.patterns.lua)=$(keywordclass3.lua4) $(keywordclass3.lua5)
|
||||||
|
keywords4.$(file.patterns.lua)=$(keywordclass4.lua4) $(keywordclass4.lua5)
|
||||||
|
|
||||||
|
#~ statement.indent.$(file.patterns.lua)=5 do else function then
|
||||||
|
#~ statement.lookback.$(file.patterns.lua)=20
|
||||||
|
indent.maintain.$(file.patterns.lua)=1
|
||||||
|
|
||||||
|
comment.block.lua=--~
|
||||||
|
comment.block.at.line.start.lua=1
|
||||||
|
|
||||||
|
# Lua styles
|
||||||
|
|
||||||
|
#lua.stdstyle.blockcommentbg=1
|
||||||
|
#lua.stdstyle.mlstringbg=1
|
||||||
|
|
||||||
|
luastyle.blockcomment1=$(stdstyle.comment1)
|
||||||
|
luastyle.blockcomment2=$(stdstyle.comment2)
|
||||||
|
if lua.stdstyle.blockcommentbg
|
||||||
|
luastyle.blockcomment1=$(stdstyle.comment1),$(stdstyle.comment1.bg)
|
||||||
|
luastyle.blockcomment2=$(stdstyle.comment2),$(stdstyle.comment2.bg)
|
||||||
|
|
||||||
|
luastyle.mlstring1=$(stdstyle.mlstring1)
|
||||||
|
if lua.stdstyle.mlstringbg
|
||||||
|
luastyle.mlstring1=$(stdstyle.mlstring1),$(stdstyle.mlstring1.bg)
|
||||||
|
|
||||||
|
#Default
|
||||||
|
style.lua.32=$(stdstyle.default)
|
||||||
|
# White space: Visible only in View Whitespace mode (or if it has a back colour)
|
||||||
|
style.lua.0=$(stdstyle.whitespace)
|
||||||
|
# Block comment (Lua 5.0)
|
||||||
|
style.lua.1=$(luastyle.blockcomment1)
|
||||||
|
# Line comment
|
||||||
|
style.lua.2=$(stdstyle.eolcomment1)
|
||||||
|
# Doc comment -- Not used in Lua (yet?)
|
||||||
|
style.lua.3=$(stdstyle.doccomment1)
|
||||||
|
# Number
|
||||||
|
style.lua.4=$(stdstyle.number1)
|
||||||
|
# Keyword
|
||||||
|
style.lua.5=$(stdstyle.keyword1)
|
||||||
|
# (Double quoted) String
|
||||||
|
style.lua.6=$(stdstyle.string1)
|
||||||
|
# Character (Single quoted string)
|
||||||
|
style.lua.7=$(stdstyle.string1)
|
||||||
|
# Literal string
|
||||||
|
style.lua.8=$(luastyle.mlstring1)
|
||||||
|
# Preprocessor (obsolete in Lua 4.0 and up)
|
||||||
|
style.lua.9=$(stdstyle.preprocessor1)
|
||||||
|
# Operators
|
||||||
|
style.lua.10=$(stdstyle.operator1)
|
||||||
|
# Identifier (everything else...)
|
||||||
|
style.lua.11=$(stdstyle.default)
|
||||||
|
# End of line where string is not closed
|
||||||
|
style.lua.12=$(stdstyle.stringerror)
|
||||||
|
# Other keywords (bozo test colors, but toned down ;)
|
||||||
|
style.lua.13=$(stdstyle.keyword2)
|
||||||
|
style.lua.14=$(stdstyle.keyword3)
|
||||||
|
style.lua.15=$(stdstyle.keyword4)
|
||||||
|
style.lua.16=$(stdstyle.keyword2)
|
||||||
|
style.lua.17=$(stdstyle.keyword3)
|
||||||
|
style.lua.18=$(stdstyle.keyword4)
|
||||||
|
style.lua.19=$(stdstyle.keyword2)
|
||||||
|
# Braces are only matched in operator style
|
||||||
|
braces.lua.style=10
|
||||||
|
|
||||||
|
# compatible with LuaBinaries for Lua 5.1; will work on both platforms.
|
||||||
|
command.compile.*.lua=luac -o "$(FileName).luac" "$(FileNameExt)"
|
||||||
|
# Lua 5.1
|
||||||
|
command.go.*.lua=lua -e "io.stdout:setvbuf 'no'" "$(FileNameExt)"
|
||||||
|
command.go.*.mlua=metalua.bat "$(FileNameExt)"
|
||||||
|
command.go.*.wlua=wlua "$(FileNameExt)"
|
||||||
|
command.go.subsystem.*.wlua=1
|
||||||
|
command.build.*.lexe=lua -e "io.stdout:setvbuf 'no'" "$(FileNameExt)"
|
||||||
|
command.go.*.lexe=wlua "$(lua.directory)\lExecutor.wlua" "$(FileNameExt)"
|
||||||
|
command.go.subsystem.*.lexe=1
|
||||||
|
|
||||||
|
# Lua 4.0
|
||||||
|
#command.go.*.lua=Lua-4.0.exe -c -f "$(FileNameExt)"
|
|
@ -0,0 +1,146 @@
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
_G holds global environment, setfenv changes environments
|
||||||
|
_VERSION current interpreter version "Lua 5.0"
|
||||||
|
assert (v [, message]) error if v nil or false, otherwise returns v
|
||||||
|
bit.arshift(x, n) arithmetic right-shift
|
||||||
|
bit.band(x1 [,x2...]) bitwise 'and' of arguments
|
||||||
|
bit.bnot(x) bitwise 'not' of argument
|
||||||
|
bit.bor(x1 [,x2...]) bitwise 'or' of arguments
|
||||||
|
bit.bswap(x) swaps the bytes of the argument (32-bit little-endian/big-endian)
|
||||||
|
bit.bxor(x1 [,x2...]) bitwise 'xor' of arguments
|
||||||
|
bit.lshift(x, n) logical left-shift
|
||||||
|
bit.rol(x, n) bitwise left rotation
|
||||||
|
bit.ror(x, n) bitwise right rotation
|
||||||
|
bit.rshift(x, n) logical right-shift
|
||||||
|
bit.tohex(x [,n]) Converts its first argument to a hex string
|
||||||
|
collectgarbage ([limit]) set threshold to limit KBytes, default 0, may run GC
|
||||||
|
coroutine.create (f) creates coroutine from function f, returns coroutine
|
||||||
|
coroutine.resume (co, val1, ...) continues execution of co, returns bool status plus any values
|
||||||
|
coroutine.status (co) returns co status: "running", "suspended" or "dead"
|
||||||
|
coroutine.wrap (f) creates coroutine with body f, returns function that resumes co
|
||||||
|
coroutine.yield (val1, ...) suspend execution of calling coroutine
|
||||||
|
debug.debug () enters interactive debug mode, line with only "cont" terminates
|
||||||
|
debug.gethook () returns current hook function, hook mask, hook count
|
||||||
|
debug.getinfo (function [, what]) returns table with information about a function
|
||||||
|
debug.getlocal (level, local) returns name and value of local variable with index local at stack level
|
||||||
|
debug.getupvalue (func, up) returns name and value of upvalue with index up of function func
|
||||||
|
debug.sethook (hook, mask [, count]) sets given function as a hook, mask="[crl]"
|
||||||
|
debug.setlocal (level, local, value) sets local variable with index local at stack level with value
|
||||||
|
debug.setupvalue (func, up, value) sets upvalue with index up of function func with value
|
||||||
|
debug.traceback ([message]) returns a string with a traceback of the call stack
|
||||||
|
dofile (filename) executes as Lua chunk, default stdin, returns value
|
||||||
|
error (message [, level]) terminates protected func, never returns, level 1 (default), 2=parent
|
||||||
|
file:close () closes file
|
||||||
|
file:flush () saves any written data to file
|
||||||
|
file:lines () returns iterator function to return lines, nil ends
|
||||||
|
file:read (format1, ...) reads file according to given formats, returns read values or nil
|
||||||
|
file:seek ([whence] [, offset]) sets file pos, whence="set"|"cur"|"end", defaults "curr",0, returns file pos
|
||||||
|
file:write (value1, ...) writes strings or numbers to file
|
||||||
|
gcinfo () returns dynamic mem in use (KB), and current GC threshold (KB)
|
||||||
|
getfenv (f) gets env, f can be a function or number (stack level, default=1), 0=global env
|
||||||
|
getmetatable (object) returns metatable of given object, otherwise nil
|
||||||
|
io.close ([file]) closes file, or the default output file
|
||||||
|
io.flush () flushes the default output file
|
||||||
|
io.input ([file]) opens file in text mode, sets as default input file, or returns current default input file
|
||||||
|
io.lines ([filename]) open file in read mode, returns iterator function to return lines, nil ends
|
||||||
|
io.open (filename [, mode]) opens file in specified mode "[rawb+]", returns handle or nil
|
||||||
|
io.output ([file]) opens file in text mode, sets as default output file, or returns current default output file
|
||||||
|
io.read (format1, ...) reads file according to given formats, returns read values or nil
|
||||||
|
io.stderr file descriptor for STDERR
|
||||||
|
io.stdin file descriptor for STDIN
|
||||||
|
io.stdout file descriptor for STDOUT
|
||||||
|
io.tmpfile () returns a handle for a temporary file, opened in update mode
|
||||||
|
io.type (obj) returns "file" if obj is an open file handle, "close file" if closed, or nil if not a file handle
|
||||||
|
io.write (value1, ...) writes strings or numbers to file
|
||||||
|
ipairs (t) returns an iterator function, table t and 0
|
||||||
|
lfs.attributes (filepath [, aname]) returns a table with the file attributes corresponding to filepath
|
||||||
|
lfs.chdir (path) changes the current working directory to path
|
||||||
|
lfs.currentdir () returns a string with the current working directory or nil plus an error string.
|
||||||
|
lfs.dir (path) Lua iterator over the entries of a given directory
|
||||||
|
lfs.lock (filehandle, mode[, start[, length]]) Locks a file or a part of it
|
||||||
|
lfs.mkdir (dirname) creates a new directory
|
||||||
|
lfs.rmdir (dirname) removes an existing directory
|
||||||
|
lfs.touch (filepath [, atime [, mtime]]) set access and modification times of a file
|
||||||
|
lfs.unlock (filehandle[, start[, length]]) unlocks a file or a part of it. This function works on open files
|
||||||
|
loadfile (filename) loads chunk without execution, returns chunk as function, else nil plus error
|
||||||
|
loadlib (libname, funcname) links to dynamic library libname, returns funcname as a C function
|
||||||
|
loadstring (string [, chunkname]) loads string as chunk, returns chunk as function, else nil plus error
|
||||||
|
math.abs (v) returns absolute value of v
|
||||||
|
math.acos (v) returns arc cosine value of v in radians
|
||||||
|
math.asin (v) returns arc sine value of v in radians
|
||||||
|
math.atan (v) returns arc tangent value of v in radians
|
||||||
|
math.atan2 (v1, v2) returns arc tangent value of v1/v2 in radians
|
||||||
|
math.ceil (v) returns smallest integer >= v
|
||||||
|
math.cos (rad) returns cosine value of angle rad
|
||||||
|
math.deg (rad) returns angle in degrees of radians rad
|
||||||
|
math.exp (v) returns e^v
|
||||||
|
math.floor (v) returns largest integer <= v
|
||||||
|
math.frexp (v) returns mantissa [0.5,1) and exponent values of v
|
||||||
|
math.ldexp (v1, v2) returns v1*2^v2
|
||||||
|
math.log (v) returns natural logarithm of v
|
||||||
|
math.log10 (v) returns logarithm 10 of v
|
||||||
|
math.max (v1, ...) returns maximum in a list of one or more values
|
||||||
|
math.min (v1, ...) returns minimum in a list of one or more values
|
||||||
|
math.mod (v1, v2) returns remainder of v1/v2 which is v1 - iV2 for some integer i
|
||||||
|
math.pow (v1, v2) returns v1 raised to the power of v2
|
||||||
|
math.rad (deg) returns angle in radians of degrees deg
|
||||||
|
math.random ([n [, u]]) returns random real [0,1), integer [1,n] or real [1,u] (with n=1)
|
||||||
|
math.randomseed (seed) sets seed for pseudo-random number generator
|
||||||
|
math.sin (rad) returns sine value of angle rad
|
||||||
|
math.sqrt (v) returns square root of v
|
||||||
|
math.tan (rad) returns tangent value of angle rad
|
||||||
|
next (table [, index]) returns next index,value pair, if index=nil (default), returns first index
|
||||||
|
os.clock () returns CPU time used by program in seconds
|
||||||
|
os.date ([format [, time]]) returns a string or table containing date and time, "*t" returns a table
|
||||||
|
os.difftime (t2, t1) returns number of seconds from time t1 to time t2
|
||||||
|
os.execute (command) executes command using C function system, returns status code
|
||||||
|
os.exit ([code]) terminates host program with optional code, default is success code
|
||||||
|
os.getenv (varname) returns value of environment variable varname. nil if not defined
|
||||||
|
os.remove (filename) deletes file with given name, nil if fails
|
||||||
|
os.rename (oldname, newname) renames file oldname to newname, nil if fails
|
||||||
|
os.setenv(name,value) set an environment variable (ex)
|
||||||
|
os.setlocale (locale [, category]) set current locale of program, returns name of new locate or nil
|
||||||
|
os.sleep(seconds) pause for the given amount of seconds (can be fraction) (ex)
|
||||||
|
os.spawn(filename) create a child process (ex)
|
||||||
|
os.time ([table]) returns current time (usually seconds) or time as represented by table
|
||||||
|
os.tmpname () returns a string with a filename for a temporary file (dangerous! tmpfile is better)
|
||||||
|
pairs (t) returns the next function and table t plus a nil, iterates over all key-value pairs
|
||||||
|
pcall (f, arg1, arg2, ...) protected mode call, catches errors, returns status code first (true=success)
|
||||||
|
print (e1, e2, ...) prints values to stdout using tostring
|
||||||
|
rawequal (v1, v2) non-metamethod v1==v2, returns boolean
|
||||||
|
rawget (table, index) non-metamethod get value of table[index], index != nil
|
||||||
|
rawset (table, index, value) non-metamethod set value of table[index], index != nil
|
||||||
|
require (packagename) loads package, updates _LOADED, returns boolean
|
||||||
|
setfenv (f, table) sets env, f can be a function or number (stack level, default=1), 0=global env
|
||||||
|
setmetatable (table, metatable) sets metatable, nil to remove metatable
|
||||||
|
string.byte (s [, i]) returns numerical code, nil if index out of range, default i=1
|
||||||
|
string.char (i1, i2, ...) returns a string built from 0 or more integers
|
||||||
|
string.dump (function) returns binary representation of function, used with loadstring
|
||||||
|
string.find (s, pattern [, init [, plain]]) matches pattern in s, returns start,end indices, else nil
|
||||||
|
string.format (formatstring, e1, e2, ...) returns formatted string, printf-style
|
||||||
|
string.gfind (s, pat) returns iterator function that returns next captures from pattern pat on s
|
||||||
|
string.gsub (s, pat, repl [, n]) returns copy of s with pat replaced by repl, and substitutions made
|
||||||
|
string.len (s) returns string length
|
||||||
|
string.lower (s) returns string with letters in lower case
|
||||||
|
string.pack (fmt,...) pack arguments as a binary string using 'fmt' (pack)
|
||||||
|
string.rep (s, n) returns string with n copies of string s
|
||||||
|
string.sub (s, i [, j]) returns substring from index i to j of s, default j=-1 (string length)
|
||||||
|
string.unpack (s,fmt) unpack arguments from binary string according to 'fmt' (pack)
|
||||||
|
string.upper (s) returns string with letters in upper case
|
||||||
|
table.concat (table [, sep [, i [, j]]]) returns concatenated table elements i to j separated by sep
|
||||||
|
table.foreach (table, f) executes f(index,value) over all elements of table, returns first non-nil of f
|
||||||
|
table.foreachi (table, f) executes f(index,value) in sequential order 1 to n, returns first non-nil of f
|
||||||
|
table.getn (table) returns size of table, or n field, or table.setn value, or 1 less first index with nil value
|
||||||
|
table.insert (table, [pos,] value) insert value at location pos in table, default pos=n+1
|
||||||
|
table.remove (table [, pos]) removes element at pos from table, default pos=n
|
||||||
|
table.setn (table, n) sets size of table, n field of table if it exists
|
||||||
|
table.sort (table [, comp]) sorts in-place elements 1 to n, comp(v1,v2) true if v1<v2, default <
|
||||||
|
tonumber (e [, base]) convert to number, returns number, nil if non-convertible, 2<=base<=36
|
||||||
|
tostring (e) convert to string, returns string
|
||||||
|
type (v) returns type of v as a string
|
||||||
|
unpack (list) returns all elements from list
|
||||||
|
xpcall (f, err) pcall function f with new error handler err
|
|
@ -0,0 +1,185 @@
|
||||||
|
# Define SciTE settings for other simple files.
|
||||||
|
|
||||||
|
file.patterns.props=*.properties;*.session;*.ini;*.inf;*.reg;*.url;*.cfg;*.cnf;*.aut
|
||||||
|
file.patterns.text=*.txt;*.log;*.lst;*.doc;*.diz;*.nfo
|
||||||
|
file.patterns.batch=*.bat;*.cmd;*.nt
|
||||||
|
file.patterns.diff=*.diff;*.patch
|
||||||
|
file.patterns.make=makefile;Makefile;*.mak;configure
|
||||||
|
|
||||||
|
filter.properties=Properties (ini inf reg url cfg cnf)|$(file.patterns.props)|
|
||||||
|
filter.text=Text (txt log lst doc diz nfo)|$(file.patterns.text);make*|
|
||||||
|
filter.batch=Batch (bat cmd nt)|$(file.patterns.batch)|
|
||||||
|
filter.diff=Difference (diff patch)|$(file.patterns.diff)|
|
||||||
|
|
||||||
|
lexer.$(file.patterns.props)=props
|
||||||
|
lexer.$(file.patterns.batch)=batch
|
||||||
|
lexer.*.err=errorlist
|
||||||
|
lexer.$(file.patterns.make)=makefile
|
||||||
|
lexer.*.iface=makefile
|
||||||
|
lexer.$(file.patterns.diff)=diff
|
||||||
|
|
||||||
|
word.characters.$(file.patterns.text)=$(chars.alpha)$(chars.numeric)$(chars.accented)-'
|
||||||
|
|
||||||
|
colour.other.operator=$(stdstyle.operator1)
|
||||||
|
|
||||||
|
# Properties styles
|
||||||
|
|
||||||
|
style.props.32=$(stdstyle.default)
|
||||||
|
# Default
|
||||||
|
style.props.0=$(stdstyle.default)
|
||||||
|
# Comment
|
||||||
|
style.props.1=$(stdstyle.eolcomment1)
|
||||||
|
# Section
|
||||||
|
style.props.2=$(stdstyle.visualbreak1)
|
||||||
|
# Assignment operator
|
||||||
|
style.props.3=$(stdstyle.operator1)
|
||||||
|
# Default value (@)
|
||||||
|
style.props.4=$(stdstyle.preprocessor1)
|
||||||
|
# Key
|
||||||
|
style.props.5=$(stdstyle.identifier2)
|
||||||
|
# Matched Operators
|
||||||
|
style.props.34=$(stdstyle.bracematch1)
|
||||||
|
style.props.35=$(stdstyle.bracemismatch1)
|
||||||
|
comment.block.props=#~
|
||||||
|
preprocessor.symbol.$(file.patterns.make)=!
|
||||||
|
preprocessor.start.$(file.patterns.make)=IF IFDEF IFNDEF
|
||||||
|
preprocessor.middle.$(file.patterns.make)=ELSE ELSEIF ELSEIFDEF ELSEIFNDEF
|
||||||
|
preprocessor.end.$(file.patterns.make)=ENDIF
|
||||||
|
|
||||||
|
# Batch styles
|
||||||
|
|
||||||
|
# List from http://www.easydos.com/dosindex.html
|
||||||
|
# I limit here the commands to those built in command.com, ie. I don't list external Dos commands
|
||||||
|
# if [no] (test) (command) -- test is EXIST (filename) | (string1)==(string2) | ERRORLEVEL (number)
|
||||||
|
# for %%(variable) IN (set) DO (command) -- variable is [a-zA-Z] -- eg for %%X in (*.txt) do type %%X
|
||||||
|
keywordclass.batch=rem set if exist errorlevel for in do \
|
||||||
|
break call chcp cd chdir choice cls country ctty date del erase dir echo \
|
||||||
|
exit goto loadfix loadhigh mkdir md move path pause prompt rename ren \
|
||||||
|
rmdir rd shift time type ver verify vol \
|
||||||
|
com con lpt nul \
|
||||||
|
color copy defined else not start
|
||||||
|
keywords.$(file.patterns.batch)=$(keywordclass.batch)
|
||||||
|
|
||||||
|
# Optional list of external commands to highlight in style 5.
|
||||||
|
# If not set all commands are highlighted in style 5.
|
||||||
|
#keywords2.$(file.patterns.batch)=append attrib chkdsk comp diskcomp
|
||||||
|
|
||||||
|
style.batch.32=$(stdstyle.default)
|
||||||
|
# Default
|
||||||
|
style.batch.0=$(stdstyle.default)
|
||||||
|
# Comment (rem or ::)
|
||||||
|
style.batch.1=$(stdstyle.eolcomment1)
|
||||||
|
# Keywords
|
||||||
|
style.batch.2=$(stdstyle.keyword1)
|
||||||
|
# Label (line beginning with ':')
|
||||||
|
style.batch.3=$(stdstyle.visualbreak1)
|
||||||
|
# Hide command character ('@')
|
||||||
|
style.batch.4=$(stdstyle.preprocessor1)
|
||||||
|
# External commands
|
||||||
|
style.batch.5=$(stdstyle.keyword2)
|
||||||
|
# Variable: %%x (x is almost whatever, except space and %), %n (n in [0-9]), %EnvironmentVar%
|
||||||
|
style.batch.6=$(stdstyle.identifier2)
|
||||||
|
# Operator: * ? < > |
|
||||||
|
style.batch.7=$(stdstyle.importantoperator1)
|
||||||
|
|
||||||
|
comment.block.batch=REM ~
|
||||||
|
|
||||||
|
# Makefile styles
|
||||||
|
|
||||||
|
style.makefile.32=$(stdstyle.default)
|
||||||
|
# Default
|
||||||
|
style.makefile.0=$(stdstyle.default)
|
||||||
|
# Comment: #
|
||||||
|
style.makefile.1=$(stdstyle.eolcomment1)
|
||||||
|
# Pre-processor or other comment: !
|
||||||
|
style.makefile.2=$(stdstyle.preprocessor1)
|
||||||
|
# Variable: $(x)
|
||||||
|
style.makefile.3=$(stdstyle.identifier2)
|
||||||
|
# Operator
|
||||||
|
style.makefile.4=$(stdstyle.operator1)
|
||||||
|
# Target
|
||||||
|
style.makefile.5=f$(stdstyle.keyword1)
|
||||||
|
# Error
|
||||||
|
style.makefile.9=$(stdstyle.stringerror)
|
||||||
|
# Matched Operators
|
||||||
|
style.makefile.34=$(stdstyle.bracematch1)
|
||||||
|
style.makefile.35=$(stdstyle.bracemismatch1)
|
||||||
|
comment.block.makefile=#~
|
||||||
|
|
||||||
|
# Error list styles
|
||||||
|
style.errorlist.32=$(stdstyle.default)
|
||||||
|
# Default
|
||||||
|
style.errorlist.0=$(stdstyle.default)
|
||||||
|
# python Error
|
||||||
|
style.errorlist.1=$(stdstyle.error)
|
||||||
|
# gcc Error
|
||||||
|
style.errorlist.2=$(stdstyle.error)
|
||||||
|
# Microsoft Error
|
||||||
|
style.errorlist.3=$(stdstyle.error)
|
||||||
|
# command or return status
|
||||||
|
style.errorlist.4=$(stdstyle.command)
|
||||||
|
# Borland error and warning messages
|
||||||
|
style.errorlist.5=$(stdstyle.error)
|
||||||
|
# perl error and warning messages
|
||||||
|
style.errorlist.6=f$(stdstyle.error)
|
||||||
|
# .NET tracebacks
|
||||||
|
style.errorlist.7=$(stdstyle.error)
|
||||||
|
# Lua error and warning messages
|
||||||
|
style.errorlist.8=$(stdstyle.error)
|
||||||
|
# ctags
|
||||||
|
style.errorlist.9=$(stdstyle.error)
|
||||||
|
# diff changed !
|
||||||
|
style.errorlist.10=$(stdstyle.diff2)
|
||||||
|
# diff addition +
|
||||||
|
style.errorlist.11=$(stdstyle.diff6)
|
||||||
|
# diff deletion -
|
||||||
|
style.errorlist.12=$(stdstyle.diff5)
|
||||||
|
# diff message ---
|
||||||
|
style.errorlist.13=$(stdstyle.diff2)
|
||||||
|
# PHP error
|
||||||
|
style.errorlist.14=$(stdstyle.error)
|
||||||
|
# Essential Lahey Fortran 90 error
|
||||||
|
style.errorlist.15=$(stdstyle.error)
|
||||||
|
# Intel Fortran Compiler error
|
||||||
|
style.errorlist.16=$(stdstyle.error)
|
||||||
|
# Intel Fortran Compiler v8.0 error/warning
|
||||||
|
style.errorlist.17=$(stdstyle.error)
|
||||||
|
# Absoft Pro Fortran 90/95 v8.2 error or warning
|
||||||
|
style.errorlist.18=$(stdstyle.error)
|
||||||
|
# HTML Tidy
|
||||||
|
style.errorlist.19=$(stdstyle.error)
|
||||||
|
# Java runtime stack trace
|
||||||
|
style.errorlist.20=$(stdstyle.error)
|
||||||
|
# Text matched with find in files and message part of GCC errors
|
||||||
|
style.errorlist.21=$(stdstyle.default)
|
||||||
|
# Ensures that spacing is not affected by line number styles
|
||||||
|
#style.errorlist.33=$(font.small)
|
||||||
|
|
||||||
|
lexer.errorlist.value.separate=1
|
||||||
|
|
||||||
|
# Difference styles
|
||||||
|
|
||||||
|
# Default
|
||||||
|
style.diff.0=$(stdstyle.default)
|
||||||
|
# Comment (part before "diff ..." or "--- ..." and , Only in ..., Binary file...)
|
||||||
|
style.diff.1=$(stdstyle.diff1)
|
||||||
|
# Command (diff ...)
|
||||||
|
style.diff.2=$(stdstyle.diff2)
|
||||||
|
# Source file (--- ...) and Destination file (+++ ...)
|
||||||
|
style.diff.3=$(stdstyle.diff3)
|
||||||
|
# Position setting (@@ ...)
|
||||||
|
style.diff.4=$(stdstyle.diff4)
|
||||||
|
# Line removal (-...)
|
||||||
|
style.diff.5=$(stdstyle.diff5)
|
||||||
|
# Line addition (+...)
|
||||||
|
style.diff.6=$(stdstyle.diff6)
|
||||||
|
|
||||||
|
command.build.makefile=make
|
||||||
|
command.build.*.mak=make
|
||||||
|
|
||||||
|
if PLAT_WIN
|
||||||
|
command.go.*.bat=$(FileNameExt)
|
||||||
|
command.name.0.*.bat=Execute Selection
|
||||||
|
command.0.*.bat=$(CurrentSelection)
|
||||||
|
command.name.1.*.mak=nmake
|
||||||
|
command.1.*.mak=nmake -f $(FileNameExt)
|
After Width: | Height: | Size: 1.2 KiB |
|
@ -0,0 +1,165 @@
|
||||||
|
<head>
|
||||||
|
<title>SciTE Extman Documentation</title>
|
||||||
|
</head>
|
||||||
|
<html>
|
||||||
|
<body>
|
||||||
|
|
||||||
|
<H2>Extman: Making Scripts Play Nicely Together</H2>
|
||||||
|
|
||||||
|
The SciTE Lua interface is very powerful, but presently there is no way to make non-trivial scripts 'play nice' with each other. Consider SciteBufferSwitch; the handlers <code>OnOpen</code>,<code>OnSwitchFile</code> and <code>OnUserListSelection</code> are all overriden to keep track of buffer changes and present a drop-down list of buffers. Such a script would interfere with any other script that had a need to watch these events.
|
||||||
|
<p>
|
||||||
|
It is also awkward to package scripts for use by other people, since they must edit their property files. Extman scripts are self-contained; you simply drop them into your scite_lua directory and restart SciTE. (They may still of course override a shortcut you are already using, but this is easy to fix). For example, here is a script which surrounds the current selection with code HTML tags:
|
||||||
|
<p>
|
||||||
|
<pre>
|
||||||
|
scite_Command 'Surrond with code|do_code|Ctrl+J'
|
||||||
|
|
||||||
|
function do_code()
|
||||||
|
local txt = editor:GetSelText()
|
||||||
|
if txt then
|
||||||
|
editor:ReplaceSel('<code>'..txt..'</code>')
|
||||||
|
end
|
||||||
|
end
|
||||||
|
</pre>
|
||||||
|
Internally, extman keeps handler lists. For instance, <code>scite_OnOpen</code> will add a function to the list of handlers called by the <code>OnOpen event</code>. It is now perfectly possible for another script to listen to the <code>OnOpen</code> event, without causing conflict. In a similar fashion, there is <code>scite_OnChar</code>, <code>scite_OnSave</code>, etc - except for <code>OnUserListSelection</code>, which is handled differently.
|
||||||
|
<p>
|
||||||
|
|
||||||
|
<H3>Extended Events</H3>
|
||||||
|
|
||||||
|
In addition to the standard SciTE Lua events, extman provides <code>OnWord</code>, <code>OnEditorLine</code> and <code>OnOutputLine</code>. They are built on the basic events, and are included for convenience.
|
||||||
|
<p>
|
||||||
|
A simple example is <code>scite_OnOpenSwitch</code>, which is called when a file is made active, either by opening or by switching buffers. (Have a look at the switch_buffers.lua example)
|
||||||
|
<p>
|
||||||
|
|
||||||
|
Here is a 'lazy' word substitution script. The <code>OnWord</code> handler receives a table, which has fields word, startp, ch which are respectively the word found, its initial position, the final position, and the character found immediately after the word. You can now have your dyslexic typing automatically corrected!
|
||||||
|
<p>
|
||||||
|
<pre>
|
||||||
|
local substitutions = {teh='the',wd='would',cd='could'}
|
||||||
|
|
||||||
|
function word_substitute (w)
|
||||||
|
local subst = substituions[w]
|
||||||
|
if subst then return subst
|
||||||
|
else return w end
|
||||||
|
end
|
||||||
|
|
||||||
|
function on_word(w)
|
||||||
|
local subst = word_substitute(w.word)
|
||||||
|
if subst ~= w.word then
|
||||||
|
editor:SetSel(w.startp-1,w.endp-1)
|
||||||
|
local was_whitespace = string.find(w.ch,'%s')
|
||||||
|
if was_whitespace then
|
||||||
|
subst = subst..w.ch
|
||||||
|
end
|
||||||
|
editor:ReplaceSel(subst)
|
||||||
|
local word_end = editor.CurrentPos
|
||||||
|
if not was_whitespace then
|
||||||
|
editor:GotoPos(word_end + 1)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
scite_OnWord(on_word)
|
||||||
|
</pre>
|
||||||
|
|
||||||
|
<code>OnOutputLine</code> only fires when a line is typed into the output pane. Here is a simple but effective Lua console for SciTE:
|
||||||
|
<pre>
|
||||||
|
local prompt = '> '
|
||||||
|
print 'Scite/Lua'
|
||||||
|
trace(prompt)
|
||||||
|
|
||||||
|
scite_OnOutputLine (function (line)
|
||||||
|
local sub = string.sub
|
||||||
|
if sub(line,1,2) == prompt then
|
||||||
|
line = sub(line,3)
|
||||||
|
end
|
||||||
|
if sub(line,1,1) == '=' then
|
||||||
|
line = 'print('..sub(line,2)..')'
|
||||||
|
end
|
||||||
|
local f,err = loadstring(line,'local')
|
||||||
|
if not f then
|
||||||
|
print(err)
|
||||||
|
else
|
||||||
|
local ok,res = pcall(f)
|
||||||
|
if ok then
|
||||||
|
if res then print('result= '..res) end
|
||||||
|
else
|
||||||
|
print(res)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
trace(prompt)
|
||||||
|
return true
|
||||||
|
end)
|
||||||
|
</pre>
|
||||||
|
<code>OnEditorLine<code> is a similar event, except it happens when the user enters a line in the editor pane. One key difference is that it never interferes with normal character processing. One could use it to keep track of any declarations typed, etc. The following example is fairly strange, but shows how one can bind a shortcut followed by a letter to an operation.
|
||||||
|
<pre>
|
||||||
|
scite_Command 'AltX|do_altx_commands|Alt+X'
|
||||||
|
|
||||||
|
local function handle_line(line)
|
||||||
|
editor:EndUndoAction()
|
||||||
|
editor:Undo()
|
||||||
|
scite_OnEditorLine(handle_line,'remove')
|
||||||
|
scite.Open(line)
|
||||||
|
end
|
||||||
|
|
||||||
|
function do_altx_commands()
|
||||||
|
editor:BeginUndoAction()
|
||||||
|
scite_OnChar('once',function (ch)
|
||||||
|
editor:EndUndoAction()
|
||||||
|
editor:Undo()
|
||||||
|
if ch == 's' then
|
||||||
|
print('ess')
|
||||||
|
elseif ch == 'f' then
|
||||||
|
editor:BeginUndoAction()
|
||||||
|
scite_OnEditorLine(handle_line)
|
||||||
|
end
|
||||||
|
return true
|
||||||
|
end)
|
||||||
|
end
|
||||||
|
</pre>
|
||||||
|
After you type Alt+X, this function installs a run-once <code>OnChar handler</code>. It's only interested in 's' or 'f', but always 'eats up' the next character pressed. Emacs users may find such key combinations fairly natural, and they're probably easier to type than Alt+Ctrl+Shift combinations. <code>OnChar</code> will not see special characters, so one is limited to letters and punctuation. (My fingers still remember the Ctrl+Q followed by a digit to move to a marker in the Borland environments - see borland.lua in the examples).
|
||||||
|
<p>
|
||||||
|
Alt+X followed by 'f' is meant to allow a user to enter a filename in the buffer! The filename is immediately removed by <code>editor:Undo</code> and the file opened.
|
||||||
|
|
||||||
|
<H3>Utility Functions</H3>
|
||||||
|
|
||||||
|
extman also supplies some useful utility functions. In some cases (like file access) they make up for missing functionality in the Lua library. If (for instance) SciTE includes the lfs (Lua File System), then users can continue to use <code>scite_Files</code> even although the implementation changes.
|
||||||
|
<p>
|
||||||
|
<code>scite_UserListShow(list,start,fn)</code> is a simplified way to access Scintilla userlists - it will construct a properly separated string, etc. You can specify a start index for the list.
|
||||||
|
<p>
|
||||||
|
<code>scite_GetProp(key,default)</code> is a simple wrapper around the props pseudo-table. If a property key doesn't exist, then props[key] returns an empty string, not nil; if default isn't specified, then this function will indeed return nil if the property doesn't exist.
|
||||||
|
<p>
|
||||||
|
<code>scite_Files(mask)</code> returns all the files in the supplied path+mask (e.g. "d:/downloads/scite_lua/*.lua" - forward slashes are accepted on Windows as well). If the SciteOther library is found, then it will use the quiet Execute, otherwise os.execute.
|
||||||
|
<p>
|
||||||
|
<code>scite_FileExists(f)</code> returns true if the file can be opened for reading.
|
||||||
|
<p>
|
||||||
|
<code>scite_dofile(f)</code> is like dofile, except that it always loads files relative to SciTE's default home, and fails quietly.
|
||||||
|
<p>
|
||||||
|
<code>scite_Command(cmds)</code> is a very useful function for associating a Lua function with a Tools menu item and key shortcut. You either pass it a string, or a list of strings; the string is of the <code>form name|function|shortcut</code>, where <code>shortcut</code> is optional.
|
||||||
|
<p>
|
||||||
|
<H3>Installation and Initialization</H3>
|
||||||
|
|
||||||
|
Unzip the files in your SciTE directory, remembering to preserve folder names. Extman is meant to be the main Lua startup script (you can of course put it somewhere else)
|
||||||
|
<pre>
|
||||||
|
ext.lua.startup.script=$(SciteDefaultHome)/extman.lua
|
||||||
|
</pre>
|
||||||
|
On startup, it will look for all files with a .lua extension inside the scite_lua directory, which by default is in the default home directory. You can force it elsewhere with ext.lua.directory.
|
||||||
|
<p>
|
||||||
|
These files will be loaded, so you should <b>not</b> put extman.lua in that directory! They will have a chance to call <code>scite_Command</code> to register their functions. They may well need other scripts loaded in advance, so <code>scite_require()</code> has been added. If a file has been loaded explicitly with this function, then extman will consider it loaded.
|
||||||
|
<p>
|
||||||
|
<H3>Enabling Scripts to Optionally Use extman</H3>
|
||||||
|
|
||||||
|
The snippet of code below allows a Lua extension to optionally use extman for <code>OnChar</code>, enabling extman-capable scripts to still work without extman.
|
||||||
|
<p>
|
||||||
|
It first checks to see if a handler already exists. Next, if an extman function is missing, say <code>scite_OnChar</code>, a very simple replacement is created. Of course, this test for extman is not foolproof. The rest of the code can then utilize extman functions as if everything is normal. The simple <code>scite_OnChar</code> function can only handle one handler; anything much more complex and you might as well force the user to install extman.
|
||||||
|
<pre>
|
||||||
|
if OnChar and not scite_OnChar then
|
||||||
|
error("Please use extman if you want to run more than one handler")
|
||||||
|
elseif not scite_OnChar then
|
||||||
|
local _OnChar
|
||||||
|
scite_OnChar = function(f, remove)
|
||||||
|
if remove then _OnChar = nil else _OnChar = f end
|
||||||
|
end
|
||||||
|
OnChar = function(c) if _OnChar then return _OnChar(c) end end
|
||||||
|
end
|
||||||
|
</pre>
|
||||||
|
</body>
|
||||||
|
</html>
|
|
@ -0,0 +1,882 @@
|
||||||
|
-- Extman is a Lua script manager for SciTE. It enables multiple scripts to capture standard events
|
||||||
|
-- without interfering with each other. For instance, scite_OnDoubleClick() will register handlers
|
||||||
|
-- for scripts that need to know when a double-click event has happened. (To know whether it
|
||||||
|
-- was in the output or editor pane, just test editor.Focus). It provides a useful function scite_Command
|
||||||
|
-- which allows you to define new commands without messing around with property files (see the
|
||||||
|
-- examples in the scite_lua directory.)
|
||||||
|
-- extman defines three new convenience handlers as well:
|
||||||
|
--scite_OnWord (called when user has entered a word)
|
||||||
|
--scite_OnEditorLine (called when a line is entered into the editor)
|
||||||
|
--scite_OnOutputLine (called when a line is entered into the output pane)
|
||||||
|
|
||||||
|
-- this is an opportunity for you to make regular Lua packages available to SciTE
|
||||||
|
--~ package.path = package.path..';C:\\lang\\lua\\lua\\?.lua'
|
||||||
|
--~ package.cpath = package.cpath..';c:\\lang\\lua\\?.dll'
|
||||||
|
|
||||||
|
-- useful function for getting a property, or a default if not present.
|
||||||
|
function scite_GetProp(key,default)
|
||||||
|
local val = props[key]
|
||||||
|
if val and val ~= '' then return val
|
||||||
|
else return default end
|
||||||
|
end
|
||||||
|
|
||||||
|
function scite_GetPropBool(key,default)
|
||||||
|
local res = scite_GetProp(key,default)
|
||||||
|
if not res or res == '0' or res == 'false' then return false
|
||||||
|
else return true
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
local GTK = scite_GetProp('PLAT_GTK')
|
||||||
|
|
||||||
|
local _MarginClick,_DoubleClick,_SavePointLeft = {},{},{}
|
||||||
|
local _SavePointReached,_Open,_SwitchFile = {},{},{}
|
||||||
|
local _BeforeSave,_Save,_Char = {},{},{}
|
||||||
|
local _Word,_LineEd,_LineOut = {},{},{}
|
||||||
|
local _OpenSwitch = {}
|
||||||
|
local _UpdateUI = {}
|
||||||
|
local _UserListSelection
|
||||||
|
-- new with 1.74!
|
||||||
|
local _Key = {}
|
||||||
|
local _DwellStart = {}
|
||||||
|
local _Close = {}
|
||||||
|
-- new
|
||||||
|
local _remove = {}
|
||||||
|
local append = table.insert
|
||||||
|
local find = string.find
|
||||||
|
local size = table.getn
|
||||||
|
local sub = string.sub
|
||||||
|
local gsub = string.gsub
|
||||||
|
|
||||||
|
|
||||||
|
-- file must be quoted if it contains spaces!
|
||||||
|
function quote_if_needed(target)
|
||||||
|
local quote = '"'
|
||||||
|
if find(target,'%s') and sub(target,1,1) ~= quote then
|
||||||
|
target = quote..target..quote
|
||||||
|
end
|
||||||
|
return target
|
||||||
|
end
|
||||||
|
|
||||||
|
function OnUserListSelection(tp,str)
|
||||||
|
if _UserListSelection then
|
||||||
|
local callback = _UserListSelection
|
||||||
|
_UserListSelection = nil
|
||||||
|
return callback(str)
|
||||||
|
else return false end
|
||||||
|
end
|
||||||
|
|
||||||
|
local function DispatchOne(handlers,arg)
|
||||||
|
for i,handler in pairs(handlers) do
|
||||||
|
local fn = handler
|
||||||
|
if _remove[fn] then
|
||||||
|
handlers[i] = nil
|
||||||
|
_remove[fn] = nil
|
||||||
|
end
|
||||||
|
local ret = fn(arg)
|
||||||
|
if ret then return ret end
|
||||||
|
end
|
||||||
|
return false
|
||||||
|
end
|
||||||
|
|
||||||
|
local function Dispatch4(handlers,arg1,arg2,arg3,arg4)
|
||||||
|
for i,handler in pairs(handlers) do
|
||||||
|
local fn = handler
|
||||||
|
if _remove[fn] then
|
||||||
|
handlers[i] = nil
|
||||||
|
_remove[fn] = nil
|
||||||
|
end
|
||||||
|
local ret = fn(arg1,arg2,arg3,arg4)
|
||||||
|
if ret then return ret end
|
||||||
|
end
|
||||||
|
return false
|
||||||
|
end
|
||||||
|
|
||||||
|
DoDispatchOne = DispatchOne -- export this!
|
||||||
|
|
||||||
|
-- these are the standard SciTE Lua callbacks - we use them to call installed extman handlers!
|
||||||
|
function OnMarginClick()
|
||||||
|
return DispatchOne(_MarginClick)
|
||||||
|
end
|
||||||
|
|
||||||
|
function OnDoubleClick()
|
||||||
|
return DispatchOne(_DoubleClick)
|
||||||
|
end
|
||||||
|
|
||||||
|
function OnSavePointLeft()
|
||||||
|
return DispatchOne(_SavePointLeft)
|
||||||
|
end
|
||||||
|
|
||||||
|
function OnSavePointReached()
|
||||||
|
return DispatchOne(_SavePointReached)
|
||||||
|
end
|
||||||
|
|
||||||
|
function OnChar(ch)
|
||||||
|
return DispatchOne(_Char,ch)
|
||||||
|
end
|
||||||
|
|
||||||
|
function OnSave(file)
|
||||||
|
return DispatchOne(_Save,file)
|
||||||
|
end
|
||||||
|
|
||||||
|
function OnBeforeSave(file)
|
||||||
|
return DispatchOne(_BeforeSave,file)
|
||||||
|
end
|
||||||
|
|
||||||
|
function OnSwitchFile(file)
|
||||||
|
return DispatchOne(_SwitchFile,file)
|
||||||
|
end
|
||||||
|
|
||||||
|
function OnOpen(file)
|
||||||
|
return DispatchOne(_Open,file)
|
||||||
|
end
|
||||||
|
|
||||||
|
function OnUpdateUI()
|
||||||
|
if editor.Focus then
|
||||||
|
return DispatchOne(_UpdateUI)
|
||||||
|
else
|
||||||
|
return false
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
-- new with 1.74
|
||||||
|
function OnKey(key,shift,ctrl,alt)
|
||||||
|
return Dispatch4(_Key,key,shift,ctrl,alt)
|
||||||
|
end
|
||||||
|
|
||||||
|
function OnDwellStart(pos,s)
|
||||||
|
return Dispatch4(_DwellStart,pos,s)
|
||||||
|
end
|
||||||
|
|
||||||
|
function OnClose()
|
||||||
|
return DispatchOne(_Close)
|
||||||
|
end
|
||||||
|
|
||||||
|
-- may optionally ask that this handler be immediately
|
||||||
|
-- removed after it's called
|
||||||
|
local function append_unique(tbl,fn,rem)
|
||||||
|
local once_only
|
||||||
|
if type(fn) == 'string' then
|
||||||
|
once_only = fn == 'once'
|
||||||
|
fn = rem
|
||||||
|
rem = nil
|
||||||
|
if once_only then
|
||||||
|
_remove[fn] = fn
|
||||||
|
end
|
||||||
|
else
|
||||||
|
_remove[fn] = nil
|
||||||
|
end
|
||||||
|
local idx
|
||||||
|
for i,handler in pairs(tbl) do
|
||||||
|
if handler == fn then idx = i; break end
|
||||||
|
end
|
||||||
|
if idx then
|
||||||
|
if rem then
|
||||||
|
table.remove(tbl,idx)
|
||||||
|
end
|
||||||
|
else
|
||||||
|
if not rem then
|
||||||
|
append(tbl,fn)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
ex_append_unique = append_unique
|
||||||
|
|
||||||
|
-- this is how you register your own handlers with extman
|
||||||
|
function scite_OnMarginClick(fn,rem)
|
||||||
|
append_unique(_MarginClick,fn,rem)
|
||||||
|
end
|
||||||
|
|
||||||
|
function scite_OnDoubleClick(fn,rem)
|
||||||
|
append_unique(_DoubleClick,fn,rem)
|
||||||
|
end
|
||||||
|
|
||||||
|
function scite_OnSavePointLeft(fn,rem)
|
||||||
|
append_unique(_SavePointLeft,fn,rem)
|
||||||
|
end
|
||||||
|
|
||||||
|
function scite_OnSavePointReached(fn,rem)
|
||||||
|
append_unique(_SavePointReached,fn,rem)
|
||||||
|
end
|
||||||
|
|
||||||
|
function scite_OnOpen(fn,rem)
|
||||||
|
append_unique(_Open,fn,rem)
|
||||||
|
end
|
||||||
|
|
||||||
|
function scite_OnSwitchFile(fn,rem)
|
||||||
|
append_unique(_SwitchFile,fn,rem)
|
||||||
|
end
|
||||||
|
|
||||||
|
function scite_OnBeforeSave(fn,rem)
|
||||||
|
append_unique(_BeforeSave,fn,rem)
|
||||||
|
end
|
||||||
|
|
||||||
|
function scite_OnSave(fn,rem)
|
||||||
|
append_unique(_Save,fn,rem)
|
||||||
|
end
|
||||||
|
|
||||||
|
function scite_OnUpdateUI(fn,rem)
|
||||||
|
append_unique(_UpdateUI,fn,rem)
|
||||||
|
end
|
||||||
|
|
||||||
|
function scite_OnChar(fn,rem)
|
||||||
|
append_unique(_Char,fn,rem)
|
||||||
|
end
|
||||||
|
|
||||||
|
function scite_OnOpenSwitch(fn,rem)
|
||||||
|
append_unique(_OpenSwitch,fn,rem)
|
||||||
|
end
|
||||||
|
|
||||||
|
--new 1.74
|
||||||
|
function scite_OnKey(fn,rem)
|
||||||
|
append_unique(_Key,fn,rem)
|
||||||
|
end
|
||||||
|
|
||||||
|
function scite_OnDwellStart(fn,rem)
|
||||||
|
append_unique(_DwellStart,fn,rem)
|
||||||
|
end
|
||||||
|
|
||||||
|
function scite_OnClose(fn,rem)
|
||||||
|
append_unique(_Close,fn,rem)
|
||||||
|
end
|
||||||
|
|
||||||
|
local function buffer_switch(f)
|
||||||
|
--- OnOpen() is also called if we move to a new folder
|
||||||
|
if not find(f,'[\\/]$') then
|
||||||
|
DispatchOne(_OpenSwitch,f)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
scite_OnOpen(buffer_switch)
|
||||||
|
scite_OnSwitchFile(buffer_switch)
|
||||||
|
|
||||||
|
local next_user_id = 13 -- arbitrary
|
||||||
|
|
||||||
|
-- the handler is always reset!
|
||||||
|
function scite_UserListShow(list,start,fn)
|
||||||
|
local separators = {' ', ';', '@', '?', '~', ':'}
|
||||||
|
local separator
|
||||||
|
local s = table.concat(list)
|
||||||
|
for i, sep in ipairs(separators) do
|
||||||
|
if not string.find(s, sep, 1, true) then
|
||||||
|
s = table.concat(list, sep, start)
|
||||||
|
separator = sep
|
||||||
|
break
|
||||||
|
end
|
||||||
|
end
|
||||||
|
-- we could not find a good separator, set it arbitrarily
|
||||||
|
if not separator then
|
||||||
|
separator = '@'
|
||||||
|
s = table.concat(list, separator, start)
|
||||||
|
end
|
||||||
|
_UserListSelection = fn
|
||||||
|
local pane = editor
|
||||||
|
if not pane.Focus then pane = output end
|
||||||
|
pane.AutoCSeparator = string.byte(separator)
|
||||||
|
pane:UserListShow(next_user_id,s)
|
||||||
|
pane.AutoCSeparator = string.byte(' ')
|
||||||
|
return true
|
||||||
|
end
|
||||||
|
|
||||||
|
local word_start,in_word,current_word
|
||||||
|
-- (Nicolas) this is in Ascii as SciTE always passes chars in this "encoding" to OnChar
|
||||||
|
local wordchars = '[A-Za-zÀ-Ýà-ÿ]' -- wuz %w
|
||||||
|
|
||||||
|
local function on_word_char(s)
|
||||||
|
if not in_word then
|
||||||
|
if find(s,wordchars) then
|
||||||
|
-- we have hit a word!
|
||||||
|
word_start = editor.CurrentPos
|
||||||
|
in_word = true
|
||||||
|
current_word = s
|
||||||
|
end
|
||||||
|
else -- we're in a word
|
||||||
|
-- and it's another word character, so collect
|
||||||
|
if find(s,wordchars) then
|
||||||
|
current_word = current_word..s
|
||||||
|
else
|
||||||
|
-- leaving a word; call the handler
|
||||||
|
local word_end = editor.CurrentPos
|
||||||
|
DispatchOne(_Word, {word=current_word,
|
||||||
|
startp=word_start,endp=editor.CurrentPos,
|
||||||
|
ch = s
|
||||||
|
})
|
||||||
|
in_word = false
|
||||||
|
end
|
||||||
|
end
|
||||||
|
-- don't interfere with usual processing!
|
||||||
|
return false
|
||||||
|
end
|
||||||
|
|
||||||
|
function scite_OnWord(fn,rem)
|
||||||
|
append_unique(_Word,fn,rem)
|
||||||
|
if not rem then
|
||||||
|
scite_OnChar(on_word_char)
|
||||||
|
else
|
||||||
|
scite_OnChar(on_word_char,'remove')
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
local last_pos = 0
|
||||||
|
|
||||||
|
function get_line(pane,lineno)
|
||||||
|
if not pane then pane = editor end
|
||||||
|
if not lineno then
|
||||||
|
local line_pos = pane.CurrentPos
|
||||||
|
lineno = pane:LineFromPosition(line_pos)-1
|
||||||
|
end
|
||||||
|
-- strip linefeeds (Windows is a special case as usual!)
|
||||||
|
local endl = 2
|
||||||
|
if pane.EOLMode == 0 then endl = 3 end
|
||||||
|
local line = pane:GetLine(lineno)
|
||||||
|
if not line then return nil end
|
||||||
|
return string.sub(line,1,-endl)
|
||||||
|
end
|
||||||
|
|
||||||
|
-- export this useful function...
|
||||||
|
scite_Line = get_line
|
||||||
|
|
||||||
|
local function on_line_char(ch,was_output)
|
||||||
|
if ch == '\n' then
|
||||||
|
local in_editor = editor.Focus
|
||||||
|
if in_editor and not was_output then
|
||||||
|
DispatchOne(_LineEd,get_line(editor))
|
||||||
|
return false -- DO NOT interfere with any editor processing!
|
||||||
|
elseif not in_editor and was_output then
|
||||||
|
DispatchOne(_LineOut,get_line(output))
|
||||||
|
return true -- prevent SciTE from trying to evaluate the line
|
||||||
|
end
|
||||||
|
end
|
||||||
|
return false
|
||||||
|
end
|
||||||
|
|
||||||
|
local function on_line_editor_char(ch)
|
||||||
|
return on_line_char(ch,false)
|
||||||
|
end
|
||||||
|
|
||||||
|
local function on_line_output_char(ch)
|
||||||
|
return on_line_char(ch,true)
|
||||||
|
end
|
||||||
|
|
||||||
|
local function set_line_handler(fn,rem,handler,on_char)
|
||||||
|
append_unique(handler,fn,rem)
|
||||||
|
if not rem then
|
||||||
|
scite_OnChar(on_char)
|
||||||
|
else
|
||||||
|
scite_OnChar(on_char,'remove')
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
function scite_OnEditorLine(fn,rem)
|
||||||
|
set_line_handler(fn,rem,_LineEd,on_line_editor_char)
|
||||||
|
end
|
||||||
|
|
||||||
|
-- with this scheme, there is a primary handler, and secondary prompt handlers
|
||||||
|
-- can temporarily take charge of input. There is only one prompt in charge
|
||||||
|
-- at any particular time, however.
|
||||||
|
local primary_handler
|
||||||
|
|
||||||
|
function scite_OnOutputLine(fn,rem)
|
||||||
|
if not rem then
|
||||||
|
if not primary_handler then primary_handler = fn end
|
||||||
|
end
|
||||||
|
_LineOut = {}
|
||||||
|
set_line_handler(fn,rem,_LineOut,on_line_output_char)
|
||||||
|
if rem and fn ~= primary_handler then
|
||||||
|
set_line_handler(primary_handler,false,_LineOut,on_line_output_char)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
local path_pattern
|
||||||
|
local tempfile
|
||||||
|
local dirsep
|
||||||
|
|
||||||
|
if GTK then
|
||||||
|
tempfile = '/tmp/.scite-temp-files'
|
||||||
|
path_pattern = '(.*)/[^%./]+%.%w+$'
|
||||||
|
dirsep = '/'
|
||||||
|
else
|
||||||
|
tempfile = '\\scite_temp1'
|
||||||
|
path_pattern = '(.*)\\[^%.\\]+%.%w+$'
|
||||||
|
dirsep = '\\'
|
||||||
|
end
|
||||||
|
|
||||||
|
function path_of(s)
|
||||||
|
local _,_,res = find(s,path_pattern)
|
||||||
|
if _ then return res else return s end
|
||||||
|
end
|
||||||
|
|
||||||
|
local extman_path = path_of(props['ext.lua.startup.script'])
|
||||||
|
local lua_path = scite_GetProp('ext.lua.directory',extman_path..dirsep..'scite_lua')
|
||||||
|
|
||||||
|
function extman_Path()
|
||||||
|
return extman_path
|
||||||
|
end
|
||||||
|
|
||||||
|
-- this version of scite-gdb uses the new spawner extension library.
|
||||||
|
local fn,err,spawner_path
|
||||||
|
if package then loadlib = package.loadlib end
|
||||||
|
-- by default, the spawner lib sits next to extman.lua
|
||||||
|
spawner_path = scite_GetProp('spawner.extension.path',extman_path)
|
||||||
|
if GTK then
|
||||||
|
fn,err = loadlib(spawner_path..'/unix-spawner-ex.so','luaopen_spawner')
|
||||||
|
else
|
||||||
|
fn,err = loadlib(spawner_path..'\\spawner-ex.dll','luaopen_spawner')
|
||||||
|
end
|
||||||
|
if fn then
|
||||||
|
fn() -- register spawner
|
||||||
|
else
|
||||||
|
print('cannot load spawner '..err)
|
||||||
|
end
|
||||||
|
|
||||||
|
-- a general popen function that uses the spawner library if found; otherwise falls back
|
||||||
|
-- on os.execute
|
||||||
|
function scite_Popen(cmd)
|
||||||
|
if spawner then
|
||||||
|
return spawner.popen(cmd)
|
||||||
|
else
|
||||||
|
cmd = cmd..' > '..tempfile
|
||||||
|
if GTK then -- io.popen is dodgy; don't use it!
|
||||||
|
os.execute(cmd)
|
||||||
|
else
|
||||||
|
if Execute then -- scite_other was found!
|
||||||
|
Execute(cmd)
|
||||||
|
else
|
||||||
|
os.execute(cmd)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
return io.open(tempfile)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
function dirmask(mask,isdir)
|
||||||
|
local attrib = ''
|
||||||
|
if isdir then
|
||||||
|
if not GTK then
|
||||||
|
attrib = ' /A:D '
|
||||||
|
else
|
||||||
|
attrib = ' -F '
|
||||||
|
end
|
||||||
|
end
|
||||||
|
if not GTK then
|
||||||
|
mask = gsub(mask,'/','\\')
|
||||||
|
return 'dir /b '..attrib..quote_if_needed(mask)
|
||||||
|
else
|
||||||
|
return 'ls -1 '..attrib..quote_if_needed(mask)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
-- p = globtopattern(g)
|
||||||
|
--
|
||||||
|
-- Converts glob string (g) into Lua pattern string (p).
|
||||||
|
-- Always succeeds.
|
||||||
|
--
|
||||||
|
-- Warning: could be better tested.
|
||||||
|
--
|
||||||
|
-- (c) 2008 D.Manura, Licensed under the same terms as Lua (MIT License).
|
||||||
|
local function globtopattern(g)
|
||||||
|
-- Some useful references:
|
||||||
|
-- - apr_fnmatch in Apache APR. For example,
|
||||||
|
-- http://apr.apache.org/docs/apr/1.3/group__apr__fnmatch.html
|
||||||
|
-- which cites POSIX 1003.2-1992, section B.6.
|
||||||
|
|
||||||
|
local p = "^" -- pattern being built
|
||||||
|
local i = 0 -- index in g
|
||||||
|
local c -- char at index i in g.
|
||||||
|
|
||||||
|
-- unescape glob char
|
||||||
|
local function unescape()
|
||||||
|
if c == '\\' then
|
||||||
|
i = i + 1; c = g:sub(i,i)
|
||||||
|
if c == '' then
|
||||||
|
p = '[^]'
|
||||||
|
return false
|
||||||
|
end
|
||||||
|
end
|
||||||
|
return true
|
||||||
|
end
|
||||||
|
|
||||||
|
-- escape pattern char
|
||||||
|
local function escape(c)
|
||||||
|
return c:match("^%w$") and c or '%' .. c
|
||||||
|
end
|
||||||
|
|
||||||
|
-- Convert tokens at end of charset.
|
||||||
|
local function charset_end()
|
||||||
|
while 1 do
|
||||||
|
if c == '' then
|
||||||
|
p = '[^]'
|
||||||
|
break
|
||||||
|
elseif c == ']' then
|
||||||
|
p = p .. ']'
|
||||||
|
break
|
||||||
|
else
|
||||||
|
if not unescape() then break end
|
||||||
|
local c1 = c
|
||||||
|
i = i + 1; c = g:sub(i,i)
|
||||||
|
if c == '' then
|
||||||
|
p = '[^]'
|
||||||
|
break
|
||||||
|
elseif c == '-' then
|
||||||
|
i = i + 1; c = g:sub(i,i)
|
||||||
|
if c == '' then
|
||||||
|
p = '[^]'
|
||||||
|
break
|
||||||
|
elseif c == ']' then
|
||||||
|
p = p .. escape(c1) .. '%-]'
|
||||||
|
break
|
||||||
|
else
|
||||||
|
if not unescape() then break end
|
||||||
|
p = p .. escape(c1) .. '-' .. escape(c)
|
||||||
|
end
|
||||||
|
elseif c == ']' then
|
||||||
|
p = p .. escape(c1) .. ']'
|
||||||
|
break
|
||||||
|
else
|
||||||
|
p = p .. escape(c1)
|
||||||
|
i = i - 1 -- put back
|
||||||
|
end
|
||||||
|
end
|
||||||
|
i = i + 1; c = g:sub(i,i)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
-- Convert tokens in charset.
|
||||||
|
local function charset()
|
||||||
|
p = p .. '['
|
||||||
|
i = i + 1; c = g:sub(i,i)
|
||||||
|
if c == '' or c == ']' then
|
||||||
|
p = p .. '[^]'
|
||||||
|
elseif c == '^' or c == '!' then
|
||||||
|
p = p .. '^'
|
||||||
|
i = i + 1; c = g:sub(i,i)
|
||||||
|
if c == ']' then
|
||||||
|
-- ignored
|
||||||
|
else
|
||||||
|
charset_end()
|
||||||
|
end
|
||||||
|
else
|
||||||
|
charset_end()
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
-- Convert tokens.
|
||||||
|
while 1 do
|
||||||
|
i = i + 1; c = g:sub(i,i)
|
||||||
|
if c == '' then
|
||||||
|
p = p .. '$'
|
||||||
|
break
|
||||||
|
elseif c == '?' then
|
||||||
|
p = p .. '.'
|
||||||
|
elseif c == '*' then
|
||||||
|
p = p .. '.*'
|
||||||
|
elseif c == '[' then
|
||||||
|
charset()
|
||||||
|
elseif c == '\\' then
|
||||||
|
i = i + 1; c = g:sub(i,i)
|
||||||
|
if c == '' then
|
||||||
|
p = p .. '\\$'
|
||||||
|
break
|
||||||
|
end
|
||||||
|
p = p .. escape(c)
|
||||||
|
else
|
||||||
|
p = p .. escape(c)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
return p
|
||||||
|
end
|
||||||
|
|
||||||
|
-- grab all files matching @mask, which is assumed to be a path with a wildcard.
|
||||||
|
-- 2008-06-27 Now uses David Manura's globtopattern(), which is not fooled by cases
|
||||||
|
-- like test.lua and test.lua~ !
|
||||||
|
function scite_Files(mask)
|
||||||
|
local f,path,pat,cmd,_
|
||||||
|
if not GTK then
|
||||||
|
cmd = dirmask(mask)
|
||||||
|
path = mask:match('(.*\\)') or '.\\'
|
||||||
|
local file = mask:match('([^\\]*)$')
|
||||||
|
pat = globtopattern(file)
|
||||||
|
else
|
||||||
|
cmd = 'ls -1 '..mask
|
||||||
|
path = ''
|
||||||
|
end
|
||||||
|
f = scite_Popen(cmd)
|
||||||
|
local files = {}
|
||||||
|
if not f then return files end
|
||||||
|
|
||||||
|
for line in f:lines() do
|
||||||
|
if not pat or line:match(pat) then
|
||||||
|
append(files,path..line)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
f:close()
|
||||||
|
return files
|
||||||
|
end
|
||||||
|
|
||||||
|
-- grab all directories in @path, excluding anything that matches @exclude_path
|
||||||
|
-- As a special exception, will also any directory called 'examples' ;)
|
||||||
|
function scite_Directories(path,exclude_pat)
|
||||||
|
local cmd
|
||||||
|
--print(path)
|
||||||
|
if not GTK then
|
||||||
|
cmd = dirmask(path..'\\*.',true)
|
||||||
|
else
|
||||||
|
cmd = dirmask(path,true)
|
||||||
|
end
|
||||||
|
path = path..dirsep
|
||||||
|
local f = scite_Popen(cmd)
|
||||||
|
local files = {}
|
||||||
|
if not f then return files end
|
||||||
|
for line in f:lines() do
|
||||||
|
-- print(line)
|
||||||
|
if GTK then
|
||||||
|
if line:sub(-1,-1) == dirsep then
|
||||||
|
line = line:sub(1,-2)
|
||||||
|
else
|
||||||
|
line = nil
|
||||||
|
end
|
||||||
|
end
|
||||||
|
if line and not line:find(exclude_pat) and line ~= 'examples' then
|
||||||
|
append(files,path..line)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
f:close()
|
||||||
|
return files
|
||||||
|
end
|
||||||
|
|
||||||
|
function scite_FileExists(f)
|
||||||
|
local f = io.open(f)
|
||||||
|
if not f then return false
|
||||||
|
else
|
||||||
|
f:close()
|
||||||
|
return true
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
function scite_CurrentFile()
|
||||||
|
return props['FilePath']
|
||||||
|
end
|
||||||
|
|
||||||
|
-- (Nicolas)
|
||||||
|
if GTK then
|
||||||
|
function scite_DirectoryExists(path)
|
||||||
|
return os.execute('test -d "'..path..'"') == 0
|
||||||
|
end
|
||||||
|
else
|
||||||
|
-- what is the Win32 equivalent??
|
||||||
|
function scite_DirectoryExists(path)
|
||||||
|
return true
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
function split(s,delim)
|
||||||
|
res = {}
|
||||||
|
while true do
|
||||||
|
p = find(s,delim)
|
||||||
|
if not p then
|
||||||
|
append(res,s)
|
||||||
|
return res
|
||||||
|
end
|
||||||
|
append(res,sub(s,1,p-1))
|
||||||
|
s = sub(s,p+1)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
function splitv(s,delim)
|
||||||
|
return unpack(split(s,delim))
|
||||||
|
end
|
||||||
|
|
||||||
|
local idx = 10
|
||||||
|
local shortcuts_used = {}
|
||||||
|
local alt_letter_map = {}
|
||||||
|
local alt_letter_map_init = false
|
||||||
|
local name_id_map = {}
|
||||||
|
|
||||||
|
local function set_command(name,cmd,mode)
|
||||||
|
local _,_,pattern,md = find(mode,'(.+){(.+)}')
|
||||||
|
if not _ then
|
||||||
|
pattern = mode
|
||||||
|
md = 'savebefore:no'
|
||||||
|
end
|
||||||
|
local which = '.'..idx..pattern
|
||||||
|
props['command.name'..which] = name
|
||||||
|
props['command'..which] = cmd
|
||||||
|
props['command.subsystem'..which] = '3'
|
||||||
|
props['command.mode'..which] = md
|
||||||
|
name_id_map[name] = 1100+idx
|
||||||
|
return which
|
||||||
|
end
|
||||||
|
|
||||||
|
local function check_gtk_alt_shortcut(shortcut,name)
|
||||||
|
-- Alt+<letter> shortcuts don't work for GTK, so handle them directly...
|
||||||
|
local _,_,letter = shortcut:find('Alt%+([A-Z])$')
|
||||||
|
if _ then
|
||||||
|
alt_letter_map[letter:lower()] = name
|
||||||
|
if not alt_letter_map_init then
|
||||||
|
alt_letter_map_init = true
|
||||||
|
scite_OnKey(function(key,shift,ctrl,alt)
|
||||||
|
if alt and key < 255 then
|
||||||
|
local ch = string.char(key)
|
||||||
|
if alt_letter_map[ch] then
|
||||||
|
scite_MenuCommand(alt_letter_map[ch])
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
local function set_shortcut(shortcut,name,which)
|
||||||
|
if shortcut == 'Context' then
|
||||||
|
local usr = 'user.context.menu'
|
||||||
|
if props[usr] == '' then -- force a separator
|
||||||
|
props[usr] = '|'
|
||||||
|
end
|
||||||
|
props[usr] = props[usr]..'|'..name..'|'..(1100+idx)..'|'
|
||||||
|
else
|
||||||
|
local cmd = shortcuts_used[shortcut]
|
||||||
|
if cmd then
|
||||||
|
print('Error: shortcut already used in "'..cmd..'"')
|
||||||
|
else
|
||||||
|
shortcuts_used[shortcut] = name
|
||||||
|
if GTK then check_gtk_alt_shortcut(shortcut,name) end
|
||||||
|
props['command.shortcut'..which] = shortcut
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
-- allows you to bind given Lua functions to shortcut keys
|
||||||
|
-- without messing around in the properties files!
|
||||||
|
-- Either a string or a table of strings; the string format is either
|
||||||
|
-- menu text|Lua command|shortcut
|
||||||
|
-- or
|
||||||
|
-- menu text|Lua command|mode|shortcut
|
||||||
|
-- where 'mode' is the file extension which this command applies to,
|
||||||
|
-- e.g. 'lua' or 'c', optionally followed by {mode specifier}, where 'mode specifier'
|
||||||
|
-- is the same as documented under 'command.mode'
|
||||||
|
-- 'shortcut' can be a usual SciTE key specifier, like 'Alt+R' or 'Ctrl+Shift+F1',
|
||||||
|
-- _or_ it can be 'Context', meaning that the menu item should also be added
|
||||||
|
-- to the right-hand click context menu.
|
||||||
|
function scite_Command(tbl)
|
||||||
|
if type(tbl) == 'string' then
|
||||||
|
tbl = {tbl}
|
||||||
|
end
|
||||||
|
for i,v in pairs(tbl) do
|
||||||
|
local name,cmd,mode,shortcut = splitv(v,'|')
|
||||||
|
if not shortcut then
|
||||||
|
shortcut = mode
|
||||||
|
mode = '.*'
|
||||||
|
else
|
||||||
|
mode = '.'..mode
|
||||||
|
end
|
||||||
|
-- has this command been defined before?
|
||||||
|
local old_idx = 0
|
||||||
|
for ii = 10,idx do
|
||||||
|
if props['command.name.'..ii..mode] == name then old_idx = ii end
|
||||||
|
end
|
||||||
|
if old_idx == 0 then
|
||||||
|
local which = set_command(name,cmd,mode)
|
||||||
|
if shortcut then
|
||||||
|
set_shortcut(shortcut,name,which)
|
||||||
|
end
|
||||||
|
idx = idx + 1
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
-- use this to launch Lua Tool menu commands directly by name
|
||||||
|
-- (commands are not guaranteed to work properly if you just call the Lua function)
|
||||||
|
function scite_MenuCommand(cmd)
|
||||||
|
if type(cmd) == 'string' then
|
||||||
|
cmd = name_id_map[cmd]
|
||||||
|
if not cmd then return end
|
||||||
|
end
|
||||||
|
scite.MenuCommand(cmd)
|
||||||
|
end
|
||||||
|
|
||||||
|
local loaded = {}
|
||||||
|
local current_filepath
|
||||||
|
|
||||||
|
-- this will quietly fail....
|
||||||
|
local function silent_dofile(f)
|
||||||
|
if scite_FileExists(f) then
|
||||||
|
if not loaded[f] then
|
||||||
|
dofile(f)
|
||||||
|
loaded[f] = true
|
||||||
|
end
|
||||||
|
return true
|
||||||
|
end
|
||||||
|
return false
|
||||||
|
end
|
||||||
|
|
||||||
|
function scite_dofile(f)
|
||||||
|
f = extman_path..'/'..f
|
||||||
|
silent_dofile(f)
|
||||||
|
end
|
||||||
|
|
||||||
|
function scite_require(f)
|
||||||
|
local path = lua_path..dirsep..f
|
||||||
|
if not silent_dofile(path) then
|
||||||
|
silent_dofile(current_filepath..dirsep..f)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
if not GTK then
|
||||||
|
scite_dofile 'scite_other.lua'
|
||||||
|
end
|
||||||
|
|
||||||
|
if not scite_DirectoryExists(lua_path) then
|
||||||
|
print('Error: directory '..lua_path..' not found')
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
|
function load_script_list(script_list,path)
|
||||||
|
if not script_list then
|
||||||
|
print('Error: no files found in '..path)
|
||||||
|
else
|
||||||
|
current_filepath = path
|
||||||
|
for i,file in pairs(script_list) do
|
||||||
|
silent_dofile(file)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
-- Load all scripts in the lua_path (usually 'scite_lua'), including within any subdirectories
|
||||||
|
-- that aren't 'examples' or begin with a '_'
|
||||||
|
local script_list = scite_Files(lua_path..dirsep..'*.lua')
|
||||||
|
load_script_list(script_list,lua_path)
|
||||||
|
local dirs = scite_Directories(lua_path,'^_')
|
||||||
|
for i,dir in ipairs(dirs) do
|
||||||
|
load_script_list(scite_Files(dir..dirsep..'*.lua'),dir)
|
||||||
|
end
|
||||||
|
|
||||||
|
function scite_WordAtPos(pos)
|
||||||
|
if not pos then pos = editor.CurrentPos end
|
||||||
|
local p2 = editor:WordEndPosition(pos,true)
|
||||||
|
local p1 = editor:WordStartPosition(pos,true)
|
||||||
|
if p2 > p1 then
|
||||||
|
return editor:textrange(p1,p2)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
function scite_GetSelOrWord()
|
||||||
|
local s = editor:GetSelText()
|
||||||
|
if s == '' then
|
||||||
|
return scite_WordAtPos()
|
||||||
|
else
|
||||||
|
return s
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
--~ scite_Command 'Reload Script|reload_script|Shift+Ctrl+R'
|
||||||
|
|
||||||
|
--~ function reload_script()
|
||||||
|
--~ current_file = scite_CurrentFile()
|
||||||
|
--~ print('Reloading... '..current_file)
|
||||||
|
--~ loaded[current_file] = false
|
||||||
|
--~ silent_dofile(current_file)
|
||||||
|
--~ end
|
||||||
|
|
||||||
|
--~ require"remdebug.engine"
|
||||||
|
--~ remdebug.engine.start()
|
||||||
|
|
|
@ -0,0 +1,443 @@
|
||||||
|
-- ilua.lua
|
||||||
|
-- A more friendly Lua interactive prompt
|
||||||
|
-- doesn't need '=', and will try to print out tables recursively.
|
||||||
|
-- On Unix, will use readline.so if available.
|
||||||
|
-- Steve Donovan, 2007
|
||||||
|
--
|
||||||
|
local usage = [[ilua -lLtTvsq (lua files)
|
||||||
|
-l load a library
|
||||||
|
-L load a library and bring into global namespace
|
||||||
|
-t <file> write transcript to file; ilua.log if not specified
|
||||||
|
-T write transcript to file of format ilua_yyyy_mm_dd_HH_MM.log
|
||||||
|
-s switch off strict mode (don't report undeclared globals)
|
||||||
|
-v be verbose
|
||||||
|
-q require standalone expressions to end with '?' (e.g, 23*1.5?)
|
||||||
|
If a file called ilua-defs is on your library path, it will be loaded first.
|
||||||
|
]]
|
||||||
|
|
||||||
|
local print = print
|
||||||
|
local pretty_print_limit = 20
|
||||||
|
local max_depth = 7
|
||||||
|
local table_clever = true
|
||||||
|
local prompt = '> '
|
||||||
|
local verbose = false
|
||||||
|
local strict = true
|
||||||
|
local que = false
|
||||||
|
local use_lua_interactive = false
|
||||||
|
-- suppress strict warnings
|
||||||
|
_ = true
|
||||||
|
|
||||||
|
-- imported global functions
|
||||||
|
local sub = string.sub
|
||||||
|
local match = string.match
|
||||||
|
local find = string.find
|
||||||
|
local push = table.insert
|
||||||
|
local pop = table.remove
|
||||||
|
local append = table.insert
|
||||||
|
local concat = table.concat
|
||||||
|
local floor = math.floor
|
||||||
|
local write = io.write
|
||||||
|
local read = io.read
|
||||||
|
|
||||||
|
local savef
|
||||||
|
local collisions = {}
|
||||||
|
local G_LIB = {}
|
||||||
|
local declared = {}
|
||||||
|
local line_handler_fn, global_handler_fn
|
||||||
|
local print_handlers = {}
|
||||||
|
|
||||||
|
ilua = {}
|
||||||
|
local num_prec
|
||||||
|
local num_all
|
||||||
|
|
||||||
|
local jstack = {}
|
||||||
|
|
||||||
|
local function oprint(...)
|
||||||
|
if savef then
|
||||||
|
savef:write(concat({...},' '),'\n')
|
||||||
|
end
|
||||||
|
print(...)
|
||||||
|
end
|
||||||
|
|
||||||
|
local function is_map_like(tbl)
|
||||||
|
for k,v in pairs(tbl) do
|
||||||
|
if type(k) ~= 'number' then
|
||||||
|
return true
|
||||||
|
end
|
||||||
|
end
|
||||||
|
return false
|
||||||
|
end
|
||||||
|
|
||||||
|
local function join(tbl,delim,limit,depth)
|
||||||
|
if not limit then limit = pretty_print_limit end
|
||||||
|
if not depth then depth = max_depth end
|
||||||
|
local n = #tbl
|
||||||
|
local res = ''
|
||||||
|
local k = 0
|
||||||
|
-- very important to avoid disgracing ourselves with circular references or
|
||||||
|
-- excessively nested tables...
|
||||||
|
if #jstack > depth then
|
||||||
|
return "..."
|
||||||
|
end
|
||||||
|
for i,t in ipairs(jstack) do
|
||||||
|
if tbl == t then
|
||||||
|
return "<self>"
|
||||||
|
end
|
||||||
|
end
|
||||||
|
push(jstack,tbl)
|
||||||
|
-- a table may have a 'list-like' part if it has a non-zero size
|
||||||
|
-- and may have have a 'map-like' part if it has non-numerical keys
|
||||||
|
-- you can switch off this cleverness with ilua.table_options {clever = false}
|
||||||
|
local is_list,is_map
|
||||||
|
if table_clever then
|
||||||
|
is_list = #tbl > 0
|
||||||
|
is_map = is_map_like(tbl)
|
||||||
|
else
|
||||||
|
is_map = true -- that is, treat all keys equally
|
||||||
|
end
|
||||||
|
if is_list then
|
||||||
|
for i,v in ipairs(tbl) do
|
||||||
|
res = res..delim..val2str(v)
|
||||||
|
k = k + 1
|
||||||
|
if k > limit then
|
||||||
|
res = res.." ... "
|
||||||
|
break
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
if is_map then
|
||||||
|
for key,v in pairs(tbl) do
|
||||||
|
local num = type(key) == 'number'
|
||||||
|
key = tostring(key)
|
||||||
|
if not num or (num and not is_list) then
|
||||||
|
if num then
|
||||||
|
key = '['..key..']'
|
||||||
|
end
|
||||||
|
res = res..delim..key..'='..val2str(v)
|
||||||
|
k = k + 1
|
||||||
|
if k > limit then
|
||||||
|
res = res.." ... "
|
||||||
|
break
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
pop(jstack)
|
||||||
|
return sub(res,2)
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
|
function val2str(val)
|
||||||
|
local tp = type(val)
|
||||||
|
if print_handlers[tp] then
|
||||||
|
local s = print_handlers[tp](val)
|
||||||
|
return s or '?'
|
||||||
|
end
|
||||||
|
if tp == 'function' then
|
||||||
|
return tostring(val)
|
||||||
|
elseif tp == 'table' then
|
||||||
|
if val.__tostring then
|
||||||
|
return tostring(val)
|
||||||
|
else
|
||||||
|
return '{'..join(val,',')..'}'
|
||||||
|
end
|
||||||
|
elseif tp == 'string' then
|
||||||
|
return "'"..val.."'"
|
||||||
|
elseif tp == 'number' then
|
||||||
|
-- we try only to apply floating-point precision for numbers deemed to be floating-point,
|
||||||
|
-- unless the 3rd arg to precision() is true.
|
||||||
|
if num_prec and (num_all or floor(val) ~= val) then
|
||||||
|
return num_prec:format(val)
|
||||||
|
else
|
||||||
|
return tostring(val)
|
||||||
|
end
|
||||||
|
else
|
||||||
|
return tostring(val)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
function _pretty_print(...)
|
||||||
|
for i,val in ipairs(arg) do
|
||||||
|
oprint(val2str(val))
|
||||||
|
end
|
||||||
|
_G['_'] = arg[1]
|
||||||
|
end
|
||||||
|
|
||||||
|
local function compile(line)
|
||||||
|
if verbose then oprint(line) end
|
||||||
|
local f,err = loadstring(line,'local')
|
||||||
|
return err,f
|
||||||
|
end
|
||||||
|
|
||||||
|
local function evaluate(chunk)
|
||||||
|
local ok,res = pcall(chunk)
|
||||||
|
if not ok then
|
||||||
|
return res
|
||||||
|
end
|
||||||
|
return nil -- meaning, fine!
|
||||||
|
end
|
||||||
|
|
||||||
|
function eval_lua(line)
|
||||||
|
-- write to transcript, if open
|
||||||
|
if savef then savef:write(prompt,line,'\n') end
|
||||||
|
-- is the line handler interested?
|
||||||
|
if line_handler_fn then
|
||||||
|
-- returning nil here means that the handler doesn't want Lua to see the string
|
||||||
|
line = line_handler_fn(line)
|
||||||
|
if not line then return end
|
||||||
|
end
|
||||||
|
local err,chunk
|
||||||
|
if not que then -- try compiling first as expression, then as statement
|
||||||
|
-- is it an expression?
|
||||||
|
err,chunk = compile('_pretty_print('..line..')')
|
||||||
|
if err then -- otherwise, a statement?
|
||||||
|
err,chunk = compile(line)
|
||||||
|
end
|
||||||
|
else -- expressions must be explicitly terminated with ?
|
||||||
|
if line:sub(-1,-1) == '?' then
|
||||||
|
err,chunk = compile('_pretty_print('..line..')')
|
||||||
|
else
|
||||||
|
err,chunk = compile(line)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
if not err then
|
||||||
|
-- we can now execute the chunk
|
||||||
|
err = evaluate(chunk)
|
||||||
|
end
|
||||||
|
if err then -- if there was any compile or runtime error, print it out
|
||||||
|
oprint(err)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
local function quit(code,msg)
|
||||||
|
io.stderr:write(msg,'\n')
|
||||||
|
os.exit(code)
|
||||||
|
end
|
||||||
|
|
||||||
|
-- functions available in scripts
|
||||||
|
function ilua.precision(len,prec,all)
|
||||||
|
if not len then num_prec = nil
|
||||||
|
else
|
||||||
|
num_prec = '%'..len..'.'..prec..'f'
|
||||||
|
end
|
||||||
|
num_all = all
|
||||||
|
end
|
||||||
|
|
||||||
|
function ilua.table_options(t)
|
||||||
|
if t.limit then pretty_print_limit = t.limit end
|
||||||
|
if t.depth then max_depth = t.depth end
|
||||||
|
if t.clever ~= nil then table_clever = t.clever end
|
||||||
|
end
|
||||||
|
|
||||||
|
-- inject @tbl into the global namespace
|
||||||
|
function ilua.import(tbl,dont_complain,lib)
|
||||||
|
lib = lib or '<unknown>'
|
||||||
|
if type(tbl) == 'table' then
|
||||||
|
for k,v in pairs(tbl) do
|
||||||
|
local key = rawget(_G,k)
|
||||||
|
-- NB to keep track of collisions!
|
||||||
|
if key and k ~= '_M' and k ~= '_NAME' and k ~= '_PACKAGE' and k ~= '_VERSION' then
|
||||||
|
append(collisions,{k,lib,G_LIB[k]})
|
||||||
|
end
|
||||||
|
_G[k] = v
|
||||||
|
G_LIB[k] = lib
|
||||||
|
end
|
||||||
|
end
|
||||||
|
if not dont_complain and #collisions > 0 then
|
||||||
|
for i, coll in ipairs(collisions) do
|
||||||
|
local name,lib,oldlib = coll[1],coll[2],coll[3]
|
||||||
|
write('warning: ',lib,'.',name,' overwrites ')
|
||||||
|
if oldlib then
|
||||||
|
write(oldlib,'.',name,'\n')
|
||||||
|
else
|
||||||
|
write('global ',name,'\n')
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
function ilua.print_handler(name,handler)
|
||||||
|
print_handlers[name] = handler
|
||||||
|
end
|
||||||
|
|
||||||
|
function ilua.line_handler(handler)
|
||||||
|
line_handler_fn = handler
|
||||||
|
end
|
||||||
|
|
||||||
|
function ilua.global_handler(handler)
|
||||||
|
global_handler_fn = handler
|
||||||
|
end
|
||||||
|
|
||||||
|
function ilua.print_variables()
|
||||||
|
for name,v in pairs(declared) do
|
||||||
|
print(name,type(_G[name]))
|
||||||
|
end
|
||||||
|
end
|
||||||
|
--
|
||||||
|
-- strict.lua
|
||||||
|
-- checks uses of undeclared global variables
|
||||||
|
-- All global variables must be 'declared' through a regular assignment
|
||||||
|
-- (even assigning nil will do) in a main chunk before being used
|
||||||
|
-- anywhere.
|
||||||
|
--
|
||||||
|
local function set_strict()
|
||||||
|
|
||||||
|
local mt = getmetatable(_G)
|
||||||
|
if mt == nil then
|
||||||
|
mt = {}
|
||||||
|
setmetatable(_G, mt)
|
||||||
|
end
|
||||||
|
|
||||||
|
local function what ()
|
||||||
|
local d = debug.getinfo(3, "S")
|
||||||
|
return d and d.what or "C"
|
||||||
|
end
|
||||||
|
|
||||||
|
declared.__tostring = true
|
||||||
|
|
||||||
|
mt.__newindex = function (t, n, v)
|
||||||
|
declared[n] = true
|
||||||
|
rawset(t, n, v)
|
||||||
|
end
|
||||||
|
|
||||||
|
mt.__index = function (t, n)
|
||||||
|
if not declared[n] and what() ~= "C" then
|
||||||
|
local lookup = global_handler_fn and global_handler_fn(n)
|
||||||
|
if not lookup then
|
||||||
|
--error("variable '"..tostring(n).."' is not declared", 2)
|
||||||
|
print("variable '"..tostring(n).."' is not declared")
|
||||||
|
return
|
||||||
|
else
|
||||||
|
return lookup
|
||||||
|
end
|
||||||
|
end
|
||||||
|
return rawget(t, n)
|
||||||
|
end
|
||||||
|
|
||||||
|
end
|
||||||
|
|
||||||
|
--- Initial operations which may not succeed!
|
||||||
|
-- try to bring in any ilua configuration file; don't complain if this is unsuccessful
|
||||||
|
pcall(function()
|
||||||
|
require 'ilua-defs'
|
||||||
|
end)
|
||||||
|
|
||||||
|
-- Unix readline support, if readline.so is available...
|
||||||
|
local rl,readline,saveline
|
||||||
|
err = pcall(function()
|
||||||
|
rl = require 'readline'
|
||||||
|
readline = rl.readline
|
||||||
|
saveline = rl.add_history
|
||||||
|
end)
|
||||||
|
if not rl then
|
||||||
|
readline = function(prompt)
|
||||||
|
write(prompt)
|
||||||
|
return read()
|
||||||
|
end
|
||||||
|
saveline = function(s) end
|
||||||
|
end
|
||||||
|
|
||||||
|
-- process command-line parameters
|
||||||
|
if arg then
|
||||||
|
local i = 1
|
||||||
|
|
||||||
|
local function parm_value(opt,parm,def)
|
||||||
|
local val = parm:sub(3)
|
||||||
|
if #val == 0 then
|
||||||
|
i = i + 1
|
||||||
|
if i > #arg then
|
||||||
|
if not def then
|
||||||
|
quit(-1,"expecting parameter for option '-"..opt.."'")
|
||||||
|
else
|
||||||
|
return def
|
||||||
|
end
|
||||||
|
end
|
||||||
|
val = arg[i]
|
||||||
|
end
|
||||||
|
return val
|
||||||
|
end
|
||||||
|
|
||||||
|
while i <= #arg do
|
||||||
|
local v = arg[i]
|
||||||
|
local opt = v:sub(1,1)
|
||||||
|
if opt == '-' then
|
||||||
|
opt = v:sub(2,2)
|
||||||
|
if opt == 'h' then
|
||||||
|
quit(0,usage)
|
||||||
|
elseif opt == 'l' then
|
||||||
|
require (parm_value(opt,v))
|
||||||
|
elseif opt == 'L' then
|
||||||
|
local lib = parm_value(opt,v)
|
||||||
|
local tbl = require (lib)
|
||||||
|
-- we cannot always trust require to return the table!
|
||||||
|
if type(tbl) ~= 'table' then
|
||||||
|
tbl = _G[lib]
|
||||||
|
end
|
||||||
|
ilua.import(tbl,true,lib)
|
||||||
|
elseif opt == 't' or opt == 'T' then
|
||||||
|
local file
|
||||||
|
if opt == 'T' then
|
||||||
|
file = 'ilua_'..os.date ('%y_%m_%d_%H_%M')..'.log'
|
||||||
|
else
|
||||||
|
file = parm_value(opt,v,"ilua.log")
|
||||||
|
end
|
||||||
|
print('saving transcript "'..file..'"')
|
||||||
|
savef = io.open(file,'w')
|
||||||
|
savef:write('! ilua ',concat(arg,' '),'\n')
|
||||||
|
elseif opt == 's' then
|
||||||
|
strict = false
|
||||||
|
elseif opt == 'v' then
|
||||||
|
verbose = true
|
||||||
|
elseif opt == 'q' then
|
||||||
|
que = true
|
||||||
|
elseif opt == 'i' then
|
||||||
|
use_lua_interactive = true
|
||||||
|
end
|
||||||
|
else -- a plain file to be executed immediately
|
||||||
|
dofile(v)
|
||||||
|
end
|
||||||
|
i = i + 1
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
require 'lfs'
|
||||||
|
|
||||||
|
function cd (path)
|
||||||
|
if not path then
|
||||||
|
print(lfs.currentdir())
|
||||||
|
else
|
||||||
|
lfs.chdir(path)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
function dir (mask)
|
||||||
|
mask = mask or '*.*'
|
||||||
|
os.execute('dir /b '..mask)
|
||||||
|
end
|
||||||
|
|
||||||
|
ilua.import()
|
||||||
|
|
||||||
|
-- enable 'not declared' error
|
||||||
|
if strict then
|
||||||
|
set_strict()
|
||||||
|
end
|
||||||
|
|
||||||
|
io.stdout:setvbuf 'no'
|
||||||
|
|
||||||
|
if not use_lua_interactive then
|
||||||
|
print 'ILUA: Lua 5.1.2 Copyright (C) 1994-2007 Lua.org, PUC-Rio\n"quit" to end'
|
||||||
|
local line = readline(prompt)
|
||||||
|
while line do
|
||||||
|
if line == 'quit' then break end
|
||||||
|
eval_lua(line)
|
||||||
|
saveline(line)
|
||||||
|
line = readline(prompt)
|
||||||
|
end
|
||||||
|
|
||||||
|
if savef then
|
||||||
|
savef:close()
|
||||||
|
end
|
||||||
|
else
|
||||||
|
_G.print = _pretty_print
|
||||||
|
print 'quit to end; cd, dir and edit also available'
|
||||||
|
end
|
|
@ -0,0 +1 @@
|
||||||
|
run
|
|
@ -0,0 +1,5 @@
|
||||||
|
-- utility package loaded before the program to be debugged.
|
||||||
|
require"debugger"
|
||||||
|
-- Windows requires this for us to immediately see all output!
|
||||||
|
io.stdout:setvbuf("no")
|
||||||
|
pause('debug')
|
|
@ -0,0 +1,87 @@
|
||||||
|
// build@ gcc -g -shared dbgl.c -o dbgl.so
|
||||||
|
#include "lua.h"
|
||||||
|
#include "lauxlib.h"
|
||||||
|
#include "lualib.h"
|
||||||
|
#include "lstate.h"
|
||||||
|
|
||||||
|
static int debug_break (lua_State *L)
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
// unfortunately, I can't a method of extracting a pointer to the C function
|
||||||
|
// called immediately before this function, that doesn't use Lua internal stuff.
|
||||||
|
static int c_addr (lua_State *L)
|
||||||
|
{
|
||||||
|
char buff[40];
|
||||||
|
CallInfo *ci;
|
||||||
|
Closure* cl = NULL;
|
||||||
|
for (ci = L->ci - 1; ci > L->base_ci; ci--) {
|
||||||
|
if (! f_isLua(ci)) { // C function!
|
||||||
|
cl = clvalue(ci->func);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (cl == NULL) {
|
||||||
|
lua_pushnil(L);
|
||||||
|
} else {
|
||||||
|
void *fun = cl->c.f;
|
||||||
|
sprintf(buff,"0x%X",fun);
|
||||||
|
lua_pushstring(L,buff);
|
||||||
|
}
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
// this is indended to be called from GDB as a debug convenience function
|
||||||
|
void debug_lua_stack(lua_State *L)
|
||||||
|
{
|
||||||
|
int nstack = lua_gettop(L);
|
||||||
|
int idx,ltype,len;
|
||||||
|
const char* str;
|
||||||
|
printf("nstack = %d\n",nstack);
|
||||||
|
for (idx = 1; idx <= nstack; idx++) {
|
||||||
|
ltype = lua_type(L,idx);
|
||||||
|
printf("%d ",idx);
|
||||||
|
switch(ltype) {
|
||||||
|
case LUA_TNIL:
|
||||||
|
printf("<nil>\n");
|
||||||
|
break;
|
||||||
|
case LUA_TNUMBER:
|
||||||
|
printf("%f\n",lua_tonumber(L,idx));
|
||||||
|
break;
|
||||||
|
case LUA_TSTRING:
|
||||||
|
str = lua_tolstring(L,idx,&len);
|
||||||
|
printf("'%s' [%d]\n",str,len);
|
||||||
|
break;
|
||||||
|
case LUA_TTABLE:
|
||||||
|
printf("table %X\n",lua_topointer(L,idx));
|
||||||
|
break;
|
||||||
|
case LUA_TFUNCTION:
|
||||||
|
printf("function %X\n",lua_topointer(L,idx));
|
||||||
|
break;
|
||||||
|
case LUA_TBOOLEAN:
|
||||||
|
printf("%s\n",lua_toboolean(L,idx) ? "true" : "false");
|
||||||
|
break;
|
||||||
|
case LUA_TUSERDATA:
|
||||||
|
printf("user %X\n",lua_touserdata(L,idx));
|
||||||
|
break;
|
||||||
|
case LUA_TLIGHTUSERDATA:
|
||||||
|
printf("light user %X\n",lua_touserdata(L,idx));
|
||||||
|
break;
|
||||||
|
case LUA_TTHREAD:
|
||||||
|
printf("thread %X\n",lua_tothread(L,idx));
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static const struct luaL_reg dbgl[] = {
|
||||||
|
{"debug_break", debug_break},
|
||||||
|
{"c_addr",c_addr},
|
||||||
|
{NULL, NULL},
|
||||||
|
};
|
||||||
|
|
||||||
|
int luaopen_dbgl (lua_State *L) {
|
||||||
|
luaL_openlib (L, "dbgl", dbgl, 0);
|
||||||
|
return 1;
|
||||||
|
}
|
|
@ -0,0 +1,307 @@
|
||||||
|
--
|
||||||
|
-- RemDebug 1.0 Beta
|
||||||
|
-- Copyright Kepler Project 2005 (http://www.keplerproject.org/remdebug)
|
||||||
|
--
|
||||||
|
|
||||||
|
local socket = require"socket"
|
||||||
|
|
||||||
|
local global_print = print
|
||||||
|
|
||||||
|
function print(...)
|
||||||
|
global_print(...)
|
||||||
|
io.stdout:flush()
|
||||||
|
end
|
||||||
|
--~ io.stdout:setvbuf("no")
|
||||||
|
|
||||||
|
print("Lua Remote Debugger")
|
||||||
|
print("Run the program you wish to debug")
|
||||||
|
|
||||||
|
local server = socket.bind("*", 8171)
|
||||||
|
local client = server:accept()
|
||||||
|
|
||||||
|
local breakpoints = {}
|
||||||
|
local watches = {}
|
||||||
|
|
||||||
|
client:send("STEP\n")
|
||||||
|
client:receive()
|
||||||
|
|
||||||
|
local breakpoint = client:receive()
|
||||||
|
local _, _, file, line = string.find(breakpoint, "^202 Paused%s+([%w%p]+)%s+(%d+)$")
|
||||||
|
if file and line then
|
||||||
|
print("Paused at file " .. file )
|
||||||
|
print("Type 'help' for commands")
|
||||||
|
else
|
||||||
|
local _, _, size = string.find(breakpoint, "^401 Error in Execution (%d+)$")
|
||||||
|
if size then
|
||||||
|
print("Error in remote application: ")
|
||||||
|
print(client:receive(size))
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
local basedir = ""
|
||||||
|
local display_expressions
|
||||||
|
|
||||||
|
local function eval_error(client,len)
|
||||||
|
len = tonumber(len)
|
||||||
|
local res = client:receive(len)
|
||||||
|
print("Error in expression:")
|
||||||
|
--print(res) -- sjd I cd see no reason to print this bogus value
|
||||||
|
end
|
||||||
|
|
||||||
|
function any_command_args(line)
|
||||||
|
local _, _, exp = string.find(line, "^[a-z]+%s+(.+)$")
|
||||||
|
return exp
|
||||||
|
end
|
||||||
|
|
||||||
|
function remote_eval(exp)
|
||||||
|
client:send("EXEC return remdebug.engine.expand_value(" .. exp .. ")\n")
|
||||||
|
local line = client:receive()
|
||||||
|
local _, _, status, len = string.find(line, "^(%d+)[a-zA-Z ]+(%d+)$")
|
||||||
|
if status == "200" then
|
||||||
|
len = tonumber(len)
|
||||||
|
local res = client:receive(len)
|
||||||
|
return true,res
|
||||||
|
elseif status == "401" then
|
||||||
|
eval_error(client,len)
|
||||||
|
return false
|
||||||
|
else
|
||||||
|
print("Unknown error")
|
||||||
|
return false
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
function on_paused_execution()
|
||||||
|
if display_expressions then
|
||||||
|
for i,v in ipairs(display_expressions) do
|
||||||
|
local ok,res = remote_eval(v)
|
||||||
|
if ok then
|
||||||
|
print(v .. " = " .. res)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
function process_line(line)
|
||||||
|
local _, _, command = string.find(line, "^([a-z]+)")
|
||||||
|
if command == "run" or command == "step" or command == "over" then
|
||||||
|
client:send(string.upper(command) .. "\n")
|
||||||
|
client:receive() -- always 'OK'
|
||||||
|
local breakpoint = client:receive()
|
||||||
|
if not breakpoint then -- client has terminated normally...
|
||||||
|
print("Program finished")
|
||||||
|
os.exit()
|
||||||
|
end
|
||||||
|
local _, _, status = string.find(breakpoint, "^(%d+)")
|
||||||
|
if status == "202" then
|
||||||
|
local _, _, file, line = string.find(breakpoint, "^202 Paused%s+([%w%p]+)%s+(%d+)$")
|
||||||
|
if file and line then
|
||||||
|
print("Paused at file " .. file .. " line " .. line)
|
||||||
|
on_paused_execution()
|
||||||
|
end
|
||||||
|
elseif status == "203" then
|
||||||
|
local _, _, file, line, watch_idx = string.find(breakpoint, "^203 Paused%s+([%w%p]+)%s+(%d+)%s+(%d+)$")
|
||||||
|
if file and line and watch_idx then
|
||||||
|
print("Paused at file " .. file .. " line " .. line .. " (watch expression " .. watch_idx .. ": [" .. watches[watch_idx] .. "])")
|
||||||
|
on_paused_execution()
|
||||||
|
end
|
||||||
|
elseif status == "401" then
|
||||||
|
local _, _, size = string.find(breakpoint, "^401 Error in Execution (%d+)$")
|
||||||
|
if size then
|
||||||
|
print("Error in remote application: ")
|
||||||
|
print(client:receive(tonumber(size)))
|
||||||
|
os.exit()
|
||||||
|
end
|
||||||
|
else
|
||||||
|
print("Unknown error")
|
||||||
|
os.exit()
|
||||||
|
end
|
||||||
|
elseif command == "exit" then
|
||||||
|
client:close()
|
||||||
|
os.exit()
|
||||||
|
elseif command == "setb" then
|
||||||
|
local _, _, _, filename, line = string.find(line, "^([a-z]+)%s+([%w%p]+)%s+(%d+)$")
|
||||||
|
if filename and line then
|
||||||
|
filename = basedir .. filename
|
||||||
|
if not breakpoints[filename] then breakpoints[filename] = {} end
|
||||||
|
client:send("SETB " .. filename .. " " .. line .. "\n")
|
||||||
|
if client:receive() == "200 OK" then
|
||||||
|
breakpoints[filename][line] = true
|
||||||
|
else
|
||||||
|
print("Error: breakpoint not inserted")
|
||||||
|
end
|
||||||
|
else
|
||||||
|
print("Invalid command")
|
||||||
|
end
|
||||||
|
elseif command == "setw" then
|
||||||
|
local _, _, exp = string.find(line, "^[a-z]+%s+(.+)$")
|
||||||
|
if exp then
|
||||||
|
client:send("SETW " .. exp .. "\n")
|
||||||
|
local answer = client:receive()
|
||||||
|
local _, _, watch_idx = string.find(answer, "^200 OK (%d+)$")
|
||||||
|
if watch_idx then
|
||||||
|
watches[watch_idx] = exp
|
||||||
|
print("Inserted watch exp no. " .. watch_idx)
|
||||||
|
else
|
||||||
|
print("Error: Watch expression not inserted")
|
||||||
|
end
|
||||||
|
else
|
||||||
|
print("Invalid command")
|
||||||
|
end
|
||||||
|
elseif command == "delb" then
|
||||||
|
local _, _, _, filename, line = string.find(line, "^([a-z]+)%s+([%w%p]+)%s+(%d+)$")
|
||||||
|
if filename and line then
|
||||||
|
filename = basedir .. filename
|
||||||
|
if not breakpoints[filename] then breakpoints[filename] = {} end
|
||||||
|
client:send("DELB " .. filename .. " " .. line .. "\n")
|
||||||
|
if client:receive() == "200 OK" then
|
||||||
|
breakpoints[filename][line] = nil
|
||||||
|
else
|
||||||
|
print("Error: breakpoint not removed")
|
||||||
|
end
|
||||||
|
else
|
||||||
|
print("Invalid command")
|
||||||
|
end
|
||||||
|
elseif command == "delallb" then
|
||||||
|
for filename, breaks in pairs(breakpoints) do
|
||||||
|
for line, _ in pairs(breaks) do
|
||||||
|
client:send("DELB " .. filename .. " " .. line .. "\n")
|
||||||
|
if client:receive() == "200 OK" then
|
||||||
|
breakpoints[filename][line] = nil
|
||||||
|
else
|
||||||
|
print("Error: breakpoint at file " .. filename .. " line " .. line .. " not removed")
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
elseif command == "delw" then
|
||||||
|
local _, _, index = string.find(line, "^[a-z]+%s+(%d+)$")
|
||||||
|
if index then
|
||||||
|
client:send("DELW " .. index .. "\n")
|
||||||
|
if client:receive() == "200 OK" then
|
||||||
|
watches[index] = nil
|
||||||
|
else
|
||||||
|
print("Error: watch expression not removed")
|
||||||
|
end
|
||||||
|
else
|
||||||
|
print("Invalid command")
|
||||||
|
end
|
||||||
|
elseif command == "delallw" then
|
||||||
|
for index, exp in pairs(watches) do
|
||||||
|
client:send("DELW " .. index .. "\n")
|
||||||
|
if client:receive() == "200 OK" then
|
||||||
|
watches[index] = nil
|
||||||
|
else
|
||||||
|
print("Error: watch expression at index " .. index .. " [" .. exp .. "] not removed")
|
||||||
|
end
|
||||||
|
end
|
||||||
|
elseif command == "locals" then --new--
|
||||||
|
client:send("LOCALS\n")
|
||||||
|
local line = client:receive()
|
||||||
|
local _, _, size = string.find(line, "^200 OK (%d+)$")
|
||||||
|
if size then
|
||||||
|
local msg = client:receive(tonumber(size))
|
||||||
|
print(msg)
|
||||||
|
end
|
||||||
|
elseif command == "detach" then --new--
|
||||||
|
client:send("DETACH\n")
|
||||||
|
client:receive()
|
||||||
|
elseif command == "display" then
|
||||||
|
local exp = any_command_args(line)
|
||||||
|
if not display_expressions then display_expressions = {} end
|
||||||
|
table.insert(display_expressions,exp)
|
||||||
|
elseif command == "eval" then
|
||||||
|
local exp = any_command_args(line)
|
||||||
|
if exp then
|
||||||
|
local ok,res = remote_eval(exp)
|
||||||
|
if ok then -- this pattern makes it a little easier for scite-gdb
|
||||||
|
print('= '..res)
|
||||||
|
end
|
||||||
|
else
|
||||||
|
print("Bad command")
|
||||||
|
end
|
||||||
|
elseif command == "exec" then
|
||||||
|
local exp = any_command_args(line)
|
||||||
|
if exp then
|
||||||
|
client:send("EXEC " .. exp .. "\n")
|
||||||
|
local line = client:receive()
|
||||||
|
if not line then --sjd case where exp is 'os.exit(0)'
|
||||||
|
print("Program killed")
|
||||||
|
os.exit(0)
|
||||||
|
end
|
||||||
|
local _, _, status, len = string.find(line, "^(%d+)[%s%w]+(%d+)$")
|
||||||
|
if status == "200" then
|
||||||
|
len = tonumber(len)
|
||||||
|
local res = client:receive(len)
|
||||||
|
print(res)
|
||||||
|
elseif status == "401" then
|
||||||
|
eval_error(client,res)
|
||||||
|
else
|
||||||
|
print("Unknown error")
|
||||||
|
end
|
||||||
|
else
|
||||||
|
print("Invalid command")
|
||||||
|
end
|
||||||
|
elseif command == "listb" then
|
||||||
|
for k, v in pairs(breakpoints) do
|
||||||
|
io.write(k .. ": ")
|
||||||
|
for k, v in pairs(v) do
|
||||||
|
io.write(k .. " ")
|
||||||
|
end
|
||||||
|
io.write("\n")
|
||||||
|
end
|
||||||
|
elseif command == "listw" then
|
||||||
|
for i, v in pairs(watches) do
|
||||||
|
print("Watch exp. " .. i .. ": " .. v)
|
||||||
|
end
|
||||||
|
elseif command == "basedir" then
|
||||||
|
local _, _, dir = string.find(line, "^[a-z]+%s+(.+)$")
|
||||||
|
if dir then
|
||||||
|
if not string.find(dir, "/$") then dir = dir .. "/" end
|
||||||
|
basedir = dir
|
||||||
|
print("New base directory is " .. basedir)
|
||||||
|
else
|
||||||
|
print(basedir)
|
||||||
|
end
|
||||||
|
elseif command == "help" then
|
||||||
|
print("setb <file> <line> -- sets a breakpoint")
|
||||||
|
print("delb <file> <line> -- removes a breakpoint")
|
||||||
|
print("delallb -- removes all breakpoints")
|
||||||
|
print("setw <exp> -- adds a new watch expression")
|
||||||
|
print("delw <index> -- removes the watch expression at index")
|
||||||
|
print("delallw -- removes all watch expressions")
|
||||||
|
print("run -- run until next breakpoint")
|
||||||
|
print("step -- run until next line, stepping into function calls")
|
||||||
|
print("over -- run until next line, stepping over function calls")
|
||||||
|
print("listb -- lists breakpoints")
|
||||||
|
print("listw -- lists watch expressions")
|
||||||
|
print("locals -- lists local variables")
|
||||||
|
print("detach -- stop debugging remote process")
|
||||||
|
print("display -- add an expression to the display list")
|
||||||
|
print("eval <exp> -- evaluates expression on the current context and returns its value")
|
||||||
|
print("exec <stmt> -- executes statement on the current context")
|
||||||
|
print("basedir [<path>] -- sets the base path of the remote application, or shows the current one")
|
||||||
|
print("exit -- exits debugger")
|
||||||
|
else
|
||||||
|
local _, _, spaces = string.find(line, "^(%s*)$")
|
||||||
|
if not spaces then
|
||||||
|
print("Invalid command")
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
if table.getn(arg) == 1 then
|
||||||
|
local f = io.open(arg[1],'r')
|
||||||
|
for line in f:lines() do
|
||||||
|
process_line(line)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
local prompt = "> "
|
||||||
|
if _DPROMPT then
|
||||||
|
prompt = _DPROMPT
|
||||||
|
prompt = string.gsub(prompt,'\\n','\n')
|
||||||
|
end
|
||||||
|
|
||||||
|
while true do
|
||||||
|
io.write(prompt)
|
||||||
|
process_line(io.read("*line"))
|
||||||
|
end
|
|
@ -0,0 +1,6 @@
|
||||||
|
-- utility package loaded before the program to be debugged.
|
||||||
|
require"remdebug.engine"
|
||||||
|
-- Windows requires this for us to immediately see all output!
|
||||||
|
io.stdout:setvbuf("no")
|
||||||
|
remdebug.engine.start()
|
||||||
|
|
|
@ -0,0 +1,374 @@
|
||||||
|
--
|
||||||
|
-- RemDebug 1.0 Beta
|
||||||
|
-- Copyright Kepler Project OK5 (http://www.keplerproject.org/remdebug)
|
||||||
|
--
|
||||||
|
|
||||||
|
local socket = require"socket"
|
||||||
|
local lfs = require"lfs"
|
||||||
|
local debug = require"debug"
|
||||||
|
|
||||||
|
module("remdebug.engine", package.seeall)
|
||||||
|
|
||||||
|
_COPYRIGHT = "2006 - Kepler Project"
|
||||||
|
_DESCRIPTION = "Remote Debugger for the Lua programming language"
|
||||||
|
_VERSION = "1.0"
|
||||||
|
|
||||||
|
local UNIX = string.sub(lfs.currentdir(),1,1) == '/'
|
||||||
|
if not UNIX then
|
||||||
|
local global_print = print
|
||||||
|
function print(...)
|
||||||
|
global_print(...)
|
||||||
|
io.stdout:flush()
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
-- Some 'pretty printing' code. In particular, it will try to expand tables, up to
|
||||||
|
-- a specified number of elements.
|
||||||
|
-- obviously table.concat is much more efficient, but requires that the table values
|
||||||
|
-- be strings.
|
||||||
|
function join(tbl,delim,start,finish)
|
||||||
|
local n = table.getn(tbl)
|
||||||
|
local res = ''
|
||||||
|
local k = 0
|
||||||
|
-- this is a hack to work out if a table is 'list-like' or 'map-like'
|
||||||
|
local index1 = n > 0 and tbl[1] ~= nil
|
||||||
|
local index2 = n > 1 and tbl[2] ~= nil
|
||||||
|
if index1 and index2 then
|
||||||
|
for i,v in ipairs(tbl) do
|
||||||
|
res = res..delim..tostring(v)
|
||||||
|
k = k + 1
|
||||||
|
if k > finish then
|
||||||
|
res = res.." ... "
|
||||||
|
end
|
||||||
|
end
|
||||||
|
else
|
||||||
|
for i,v in pairs(tbl) do
|
||||||
|
res = res..delim..tostring(i)..'='..tostring(v)
|
||||||
|
k = k + 1
|
||||||
|
if k > finish then
|
||||||
|
res = res.." ... "
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
return string.sub(res,2)
|
||||||
|
end
|
||||||
|
|
||||||
|
function expand_value(val)
|
||||||
|
if type(val) == 'table' then
|
||||||
|
if val.__tostring then
|
||||||
|
return tostring(val)
|
||||||
|
else
|
||||||
|
return '{'..join(val,',',1,20)..'}'
|
||||||
|
end
|
||||||
|
elseif type(val) == 'string' then
|
||||||
|
return "'"..val.."'"
|
||||||
|
else
|
||||||
|
return val
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
local coro_debugger
|
||||||
|
local events = { BREAK = 1, WATCH = 2 }
|
||||||
|
local breakpoints = {}
|
||||||
|
local watches = {}
|
||||||
|
local step_into = false
|
||||||
|
local step_over = false
|
||||||
|
local step_level = 0
|
||||||
|
local stack_level = 0
|
||||||
|
|
||||||
|
local controller_host = "localhost"
|
||||||
|
local controller_port = 8171
|
||||||
|
|
||||||
|
local function set_breakpoint(file, line)
|
||||||
|
if not breakpoints[file] then
|
||||||
|
breakpoints[file] = {}
|
||||||
|
end
|
||||||
|
breakpoints[file][line] = true
|
||||||
|
end
|
||||||
|
|
||||||
|
local function remove_breakpoint(file, line)
|
||||||
|
if breakpoints[file] then
|
||||||
|
breakpoints[file][line] = nil
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
local function has_breakpoint(file, line)
|
||||||
|
return breakpoints[file] and breakpoints[file][line]
|
||||||
|
end
|
||||||
|
|
||||||
|
local function restore_vars(vars)
|
||||||
|
if type(vars) ~= 'table' then return end
|
||||||
|
local func = debug.getinfo(3, "f").func
|
||||||
|
local i = 1
|
||||||
|
local written_vars = {}
|
||||||
|
while true do
|
||||||
|
local name = debug.getlocal(3, i)
|
||||||
|
if not name then break end
|
||||||
|
debug.setlocal(3, i, vars[name])
|
||||||
|
written_vars[name] = true
|
||||||
|
i = i + 1
|
||||||
|
end
|
||||||
|
i = 1
|
||||||
|
while true do
|
||||||
|
local name = debug.getupvalue(func, i)
|
||||||
|
if not name then break end
|
||||||
|
if not written_vars[name] then
|
||||||
|
debug.setupvalue(func, i, vars[name])
|
||||||
|
written_vars[name] = true
|
||||||
|
end
|
||||||
|
i = i + 1
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
local function capture_vars()
|
||||||
|
local vars = {}
|
||||||
|
local func = debug.getinfo(3, "f").func
|
||||||
|
local i = 1
|
||||||
|
while true do
|
||||||
|
local name, value = debug.getupvalue(func, i)
|
||||||
|
if not name then break end
|
||||||
|
vars[name] = value
|
||||||
|
i = i + 1
|
||||||
|
end
|
||||||
|
i = 1
|
||||||
|
while true do
|
||||||
|
local name, value = debug.getlocal(3, i)
|
||||||
|
if not name then break end
|
||||||
|
vars[name] = value
|
||||||
|
i = i + 1
|
||||||
|
end
|
||||||
|
setmetatable(vars, { __index = getfenv(func), __newindex = getfenv(func) })
|
||||||
|
return vars
|
||||||
|
end
|
||||||
|
|
||||||
|
local function break_dir(path)
|
||||||
|
local paths = {}
|
||||||
|
path = string.gsub(path, "\\", "/")
|
||||||
|
for w in string.gfind(path, "[^\/]+") do
|
||||||
|
table.insert(paths, w)
|
||||||
|
end
|
||||||
|
return paths
|
||||||
|
end
|
||||||
|
|
||||||
|
local function merge_paths(path1, path2)
|
||||||
|
-- check if path is already absolute
|
||||||
|
if UNIX then
|
||||||
|
if string.sub(path2,1,1) == '/' then
|
||||||
|
return path2
|
||||||
|
end
|
||||||
|
else
|
||||||
|
if string.sub(path2,2,2) == ':' then
|
||||||
|
return path2:gsub('\\','/')
|
||||||
|
end
|
||||||
|
end
|
||||||
|
local paths1 = break_dir(path1)
|
||||||
|
local paths2 = break_dir(path2)
|
||||||
|
for i, path in ipairs(paths2) do
|
||||||
|
if path == ".." then
|
||||||
|
table.remove(paths1, table.getn(paths1))
|
||||||
|
elseif path ~= "." then
|
||||||
|
table.insert(paths1, path)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
local res = table.concat(paths1, "/")
|
||||||
|
if UNIX then
|
||||||
|
return "/"..res
|
||||||
|
else
|
||||||
|
return res
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
local function debug_hook(event, line)
|
||||||
|
if event == "call" then
|
||||||
|
stack_level = stack_level + 1
|
||||||
|
elseif event == "return" then
|
||||||
|
stack_level = stack_level - 1
|
||||||
|
else
|
||||||
|
local file = debug.getinfo(2, "S").source
|
||||||
|
if string.find(file, "@") == 1 then
|
||||||
|
file = string.sub(file, 2)
|
||||||
|
end
|
||||||
|
file = merge_paths(lfs.currentdir(), file)
|
||||||
|
local vars = capture_vars()
|
||||||
|
table.foreach(watches, function (index, value)
|
||||||
|
setfenv(value, vars)
|
||||||
|
local status, res = pcall(value)
|
||||||
|
if status and res then
|
||||||
|
coroutine.resume(coro_debugger, events.WATCH, vars, file, line, index)
|
||||||
|
end
|
||||||
|
end)
|
||||||
|
if step_into or (step_over and stack_level <= step_level) or has_breakpoint(file, line) then
|
||||||
|
step_into = false
|
||||||
|
step_over = false
|
||||||
|
coroutine.resume(coro_debugger, events.BREAK, vars, file, line)
|
||||||
|
restore_vars(vars)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
--- protocol response helpers
|
||||||
|
local function bad_request(server)
|
||||||
|
server:send("400 Bad Request\n") -- check this!
|
||||||
|
end
|
||||||
|
|
||||||
|
local function OK(server,res)
|
||||||
|
if res then
|
||||||
|
if type(res) == 'string' then
|
||||||
|
server:send("200 OK "..string.len(res).."\n")
|
||||||
|
server:send(res)
|
||||||
|
else
|
||||||
|
server:send("200 OK "..res.."\n")
|
||||||
|
end
|
||||||
|
else
|
||||||
|
server:send("200 OK\n")
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
local function pause(server,file,line,idx_watch)
|
||||||
|
if not idx_watch then
|
||||||
|
server:send("202 Paused " .. file .. " " .. line .. "\n")
|
||||||
|
else
|
||||||
|
server:send("203 Paused " .. file .. " " .. line .. " " .. idx_watch .. "\n")
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
local function error(server,type,res)
|
||||||
|
server:send("401 Error in "..type.." " .. string.len(res) .. "\n")
|
||||||
|
server:send(res)
|
||||||
|
end
|
||||||
|
|
||||||
|
local function debugger_loop(server)
|
||||||
|
local command
|
||||||
|
local eval_env = {}
|
||||||
|
|
||||||
|
while true do
|
||||||
|
local line, status = server:receive()
|
||||||
|
command = string.sub(line, string.find(line, "^[A-Z]+"))
|
||||||
|
--~ print('engine',command)
|
||||||
|
if command == "SETB" then
|
||||||
|
local _, _, _, filename, line = string.find(line, "^([A-Z]+)%s+([%w%p]+)%s+(%d+)$")
|
||||||
|
if filename and line then
|
||||||
|
set_breakpoint(filename, tonumber(line))
|
||||||
|
OK(server)
|
||||||
|
else
|
||||||
|
bad_request(server)
|
||||||
|
end
|
||||||
|
elseif command == "DELB" then
|
||||||
|
local _, _, _, filename, line = string.find(line, "^([A-Z]+)%s+([%w%p]+)%s+(%d+)$")
|
||||||
|
if filename and line then
|
||||||
|
remove_breakpoint(filename, tonumber(line))
|
||||||
|
OK(server)
|
||||||
|
else
|
||||||
|
bad_request(server)
|
||||||
|
end
|
||||||
|
elseif command == "EXEC" then
|
||||||
|
local _, _, chunk = string.find(line, "^[A-Z]+%s+(.+)$")
|
||||||
|
if chunk then
|
||||||
|
local func = loadstring(chunk)
|
||||||
|
local status, res
|
||||||
|
if func then
|
||||||
|
setfenv(func, eval_env)
|
||||||
|
status, res = xpcall(func, debug.traceback)
|
||||||
|
end
|
||||||
|
res = tostring(res)
|
||||||
|
if status then
|
||||||
|
OK(server,res)
|
||||||
|
else
|
||||||
|
error(server,"Execute",res)
|
||||||
|
end
|
||||||
|
else
|
||||||
|
bad_request(server)
|
||||||
|
end
|
||||||
|
elseif command == "SETW" then
|
||||||
|
local _, _, exp = string.find(line, "^[A-Z]+%s+(.+)$")
|
||||||
|
if exp then
|
||||||
|
local func = loadstring("return(" .. exp .. ")")
|
||||||
|
local newidx = table.getn(watches) + 1
|
||||||
|
watches[newidx] = func
|
||||||
|
table.setn(watches, newidx)
|
||||||
|
OK(server,newidx)
|
||||||
|
else
|
||||||
|
bad_request(server)
|
||||||
|
end
|
||||||
|
elseif command == "DELW" then
|
||||||
|
local _, _, index = string.find(line, "^[A-Z]+%s+(%d+)$")
|
||||||
|
index = tonumber(index)
|
||||||
|
if index then
|
||||||
|
watches[index] = nil
|
||||||
|
OK(server)
|
||||||
|
else
|
||||||
|
bad_request(server)
|
||||||
|
end
|
||||||
|
elseif command == "RUN" or command == "STEP" or command == "OVER" then
|
||||||
|
OK(server)
|
||||||
|
if command == "STEP" then
|
||||||
|
step_into = true
|
||||||
|
elseif command == "OVER" then
|
||||||
|
step_over = true
|
||||||
|
step_level = stack_level
|
||||||
|
end
|
||||||
|
local ev, vars, file, line, idx_watch = coroutine.yield()
|
||||||
|
eval_env = vars
|
||||||
|
if ev == events.BREAK then
|
||||||
|
pause(server,file,line)
|
||||||
|
elseif ev == events.WATCH then
|
||||||
|
pause(server,file,line,idx_watch)
|
||||||
|
else
|
||||||
|
error(server,"Execution",file)
|
||||||
|
end
|
||||||
|
elseif command == "LOCALS" then -- new --
|
||||||
|
-- not sure why I had to hack it this way?? SJD
|
||||||
|
local tmpfile = 'remdebug-tmp.txt'
|
||||||
|
local f = io.open(tmpfile,'w')
|
||||||
|
for k,v in pairs(eval_env) do
|
||||||
|
if k:sub(1,1) ~= '(' then
|
||||||
|
f:write(k,' = ',tostring(v),'\n')
|
||||||
|
end
|
||||||
|
end
|
||||||
|
f:close()
|
||||||
|
f = io.open(tmpfile,'r')
|
||||||
|
local res = f:read("*a")
|
||||||
|
f:close()
|
||||||
|
OK(server,res)
|
||||||
|
elseif command == "DETACH" then --new--
|
||||||
|
debug.sethook()
|
||||||
|
OK(server)
|
||||||
|
else
|
||||||
|
bad_request(server)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
coro_debugger = coroutine.create(debugger_loop)
|
||||||
|
--
|
||||||
|
-- remdebug.engine.config(tab)
|
||||||
|
-- Configures the engine
|
||||||
|
--
|
||||||
|
function config(tab)
|
||||||
|
if tab.host then
|
||||||
|
controller_host = tab.host
|
||||||
|
end
|
||||||
|
if tab.port then
|
||||||
|
controller_port = tab.port
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
--
|
||||||
|
-- remdebug.engine.start()
|
||||||
|
-- Tries to start the debug session by connecting with a controller
|
||||||
|
--
|
||||||
|
function start()
|
||||||
|
pcall(require, "remdebug.config")
|
||||||
|
local server = socket.connect(controller_host, controller_port)
|
||||||
|
if server then
|
||||||
|
_TRACEBACK = function (message)
|
||||||
|
local err = debug.traceback(message)
|
||||||
|
error(server,"Execute",res)
|
||||||
|
server:close()
|
||||||
|
return err
|
||||||
|
end
|
||||||
|
debug.sethook(debug_hook, "lcr")
|
||||||
|
return coroutine.resume(coro_debugger, server)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
|
@ -0,0 +1,241 @@
|
||||||
|
--[[---------------
|
||||||
|
LuaBit v0.3
|
||||||
|
-------------------
|
||||||
|
a bitwise operation lib for lua.
|
||||||
|
|
||||||
|
http://luaforge.net/projects/bit/
|
||||||
|
|
||||||
|
Under the MIT license.
|
||||||
|
|
||||||
|
copyright(c) 2006 hanzhao (abrash_han@hotmail.com)
|
||||||
|
--]]---------------
|
||||||
|
|
||||||
|
do
|
||||||
|
|
||||||
|
------------------------
|
||||||
|
-- bit lib implementions
|
||||||
|
|
||||||
|
local function check_int(n)
|
||||||
|
-- checking not float
|
||||||
|
if(n - math.floor(n) > 0) then
|
||||||
|
error("trying to use bitwise operation on non-integer!")
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
local function to_bits(n)
|
||||||
|
check_int(n)
|
||||||
|
if(n < 0) then
|
||||||
|
-- negative
|
||||||
|
return to_bits(bit.bnot(math.abs(n)) + 1)
|
||||||
|
end
|
||||||
|
-- to bits table
|
||||||
|
local tbl = {}
|
||||||
|
local cnt = 1
|
||||||
|
while (n > 0) do
|
||||||
|
local last = math.mod(n,2)
|
||||||
|
if(last == 1) then
|
||||||
|
tbl[cnt] = 1
|
||||||
|
else
|
||||||
|
tbl[cnt] = 0
|
||||||
|
end
|
||||||
|
n = (n-last)/2
|
||||||
|
cnt = cnt + 1
|
||||||
|
end
|
||||||
|
|
||||||
|
return tbl
|
||||||
|
end
|
||||||
|
|
||||||
|
local function tbl_to_number(tbl)
|
||||||
|
local n = table.getn(tbl)
|
||||||
|
|
||||||
|
local rslt = 0
|
||||||
|
local power = 1
|
||||||
|
for i = 1, n do
|
||||||
|
rslt = rslt + tbl[i]*power
|
||||||
|
power = power*2
|
||||||
|
end
|
||||||
|
|
||||||
|
return rslt
|
||||||
|
end
|
||||||
|
|
||||||
|
local function expand(tbl_m, tbl_n)
|
||||||
|
local big = {}
|
||||||
|
local small = {}
|
||||||
|
if(table.getn(tbl_m) > table.getn(tbl_n)) then
|
||||||
|
big = tbl_m
|
||||||
|
small = tbl_n
|
||||||
|
else
|
||||||
|
big = tbl_n
|
||||||
|
small = tbl_m
|
||||||
|
end
|
||||||
|
-- expand small
|
||||||
|
for i = table.getn(small) + 1, table.getn(big) do
|
||||||
|
small[i] = 0
|
||||||
|
end
|
||||||
|
|
||||||
|
end
|
||||||
|
|
||||||
|
local function bit_or(m, n)
|
||||||
|
local tbl_m = to_bits(m)
|
||||||
|
local tbl_n = to_bits(n)
|
||||||
|
expand(tbl_m, tbl_n)
|
||||||
|
|
||||||
|
local tbl = {}
|
||||||
|
local rslt = math.max(table.getn(tbl_m), table.getn(tbl_n))
|
||||||
|
for i = 1, rslt do
|
||||||
|
if(tbl_m[i]== 0 and tbl_n[i] == 0) then
|
||||||
|
tbl[i] = 0
|
||||||
|
else
|
||||||
|
tbl[i] = 1
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
return tbl_to_number(tbl)
|
||||||
|
end
|
||||||
|
|
||||||
|
local function bit_and(m, n)
|
||||||
|
local tbl_m = to_bits(m)
|
||||||
|
local tbl_n = to_bits(n)
|
||||||
|
expand(tbl_m, tbl_n)
|
||||||
|
|
||||||
|
local tbl = {}
|
||||||
|
local rslt = math.max(table.getn(tbl_m), table.getn(tbl_n))
|
||||||
|
for i = 1, rslt do
|
||||||
|
if(tbl_m[i]== 0 or tbl_n[i] == 0) then
|
||||||
|
tbl[i] = 0
|
||||||
|
else
|
||||||
|
tbl[i] = 1
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
return tbl_to_number(tbl)
|
||||||
|
end
|
||||||
|
|
||||||
|
local function bit_not(n)
|
||||||
|
|
||||||
|
local tbl = to_bits(n)
|
||||||
|
local size = math.max(table.getn(tbl), 32)
|
||||||
|
for i = 1, size do
|
||||||
|
if(tbl[i] == 1) then
|
||||||
|
tbl[i] = 0
|
||||||
|
else
|
||||||
|
tbl[i] = 1
|
||||||
|
end
|
||||||
|
end
|
||||||
|
return tbl_to_number(tbl)
|
||||||
|
end
|
||||||
|
|
||||||
|
local function bit_xor(m, n)
|
||||||
|
local tbl_m = to_bits(m)
|
||||||
|
local tbl_n = to_bits(n)
|
||||||
|
expand(tbl_m, tbl_n)
|
||||||
|
|
||||||
|
local tbl = {}
|
||||||
|
local rslt = math.max(table.getn(tbl_m), table.getn(tbl_n))
|
||||||
|
for i = 1, rslt do
|
||||||
|
if(tbl_m[i] ~= tbl_n[i]) then
|
||||||
|
tbl[i] = 1
|
||||||
|
else
|
||||||
|
tbl[i] = 0
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
--table.foreach(tbl, print)
|
||||||
|
|
||||||
|
return tbl_to_number(tbl)
|
||||||
|
end
|
||||||
|
|
||||||
|
local function bit_rshift(n, bits)
|
||||||
|
check_int(n)
|
||||||
|
|
||||||
|
local high_bit = 0
|
||||||
|
if(n < 0) then
|
||||||
|
-- negative
|
||||||
|
n = bit_not(math.abs(n)) + 1
|
||||||
|
high_bit = 2147483648 -- 0x80000000
|
||||||
|
end
|
||||||
|
|
||||||
|
for i=1, bits do
|
||||||
|
n = n/2
|
||||||
|
n = bit_or(math.floor(n), high_bit)
|
||||||
|
end
|
||||||
|
return math.floor(n)
|
||||||
|
end
|
||||||
|
|
||||||
|
-- logic rightshift assures zero filling shift
|
||||||
|
local function bit_logic_rshift(n, bits)
|
||||||
|
check_int(n)
|
||||||
|
if(n < 0) then
|
||||||
|
-- negative
|
||||||
|
n = bit_not(math.abs(n)) + 1
|
||||||
|
end
|
||||||
|
for i=1, bits do
|
||||||
|
n = n/2
|
||||||
|
end
|
||||||
|
return math.floor(n)
|
||||||
|
end
|
||||||
|
|
||||||
|
local function bit_lshift(n, bits)
|
||||||
|
check_int(n)
|
||||||
|
|
||||||
|
if(n < 0) then
|
||||||
|
-- negative
|
||||||
|
n = bit_not(math.abs(n)) + 1
|
||||||
|
end
|
||||||
|
|
||||||
|
for i=1, bits do
|
||||||
|
n = n*2
|
||||||
|
end
|
||||||
|
return bit_and(n, 4294967295) -- 0xFFFFFFFF
|
||||||
|
end
|
||||||
|
|
||||||
|
local function bit_xor2(m, n)
|
||||||
|
local rhs = bit_or(bit_not(m), bit_not(n))
|
||||||
|
local lhs = bit_or(m, n)
|
||||||
|
local rslt = bit_and(lhs, rhs)
|
||||||
|
return rslt
|
||||||
|
end
|
||||||
|
|
||||||
|
--------------------
|
||||||
|
-- bit lib interface
|
||||||
|
|
||||||
|
bit = {
|
||||||
|
-- bit operations
|
||||||
|
bnot = bit_not,
|
||||||
|
band = bit_and,
|
||||||
|
bor = bit_or,
|
||||||
|
bxor = bit_xor,
|
||||||
|
brshift = bit_rshift,
|
||||||
|
blshift = bit_lshift,
|
||||||
|
bxor2 = bit_xor2,
|
||||||
|
blogic_rshift = bit_logic_rshift,
|
||||||
|
|
||||||
|
-- utility func
|
||||||
|
tobits = to_bits,
|
||||||
|
tonumb = tbl_to_number,
|
||||||
|
}
|
||||||
|
|
||||||
|
end
|
||||||
|
|
||||||
|
--[[
|
||||||
|
for i = 1, 100 do
|
||||||
|
for j = 1, 100 do
|
||||||
|
if(bit.bxor(i, j) ~= bit.bxor2(i, j)) then
|
||||||
|
error("bit.xor failed.")
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
--]]
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,58 @@
|
||||||
|
-- demonstrates how to capture multiple key sequences, like 'ctrl-k 1', with extman.
|
||||||
|
-- This is used to implement Borland-style markers.
|
||||||
|
scite_Command {
|
||||||
|
'ctrl-k|do_ctrl_command k|Ctrl+K',
|
||||||
|
'ctrl-q|do_ctrl_command q|Ctrl+Q',
|
||||||
|
}
|
||||||
|
|
||||||
|
local gMarksMap = {}
|
||||||
|
local gMarks = {}
|
||||||
|
|
||||||
|
scite_OnOpen(function(f)
|
||||||
|
gMarksMap[f] = {}
|
||||||
|
end)
|
||||||
|
|
||||||
|
scite_OnSwitchFile(function(f)
|
||||||
|
gMarks = gMarksMap[f]
|
||||||
|
end)
|
||||||
|
|
||||||
|
function current_line()
|
||||||
|
return editor:LineFromPosition(editor.CurrentPos)+1
|
||||||
|
end
|
||||||
|
|
||||||
|
local markers_defined = false
|
||||||
|
local base = 9
|
||||||
|
|
||||||
|
function define_markers()
|
||||||
|
local zero = string.byte('0')
|
||||||
|
for i = 1,9 do
|
||||||
|
editor:MarkerDefine(i+base,SC_MARK_CHARACTER + zero + i)
|
||||||
|
end
|
||||||
|
markers_defined = true
|
||||||
|
end
|
||||||
|
|
||||||
|
function do_ctrl_command(key)
|
||||||
|
editor:BeginUndoAction()
|
||||||
|
scite_OnChar('once',function (ch)
|
||||||
|
editor:EndUndoAction()
|
||||||
|
editor:Undo()
|
||||||
|
local num = tonumber(ch)
|
||||||
|
local mark = num and gMarks[num]
|
||||||
|
local line = current_line()
|
||||||
|
if key == 'k' and num then
|
||||||
|
if not markers_defined then define_markers() end
|
||||||
|
if mark then -- clear mark
|
||||||
|
gMarks[num] = nil
|
||||||
|
editor:MarkerDelete(line-1,num+base)
|
||||||
|
else
|
||||||
|
gMarks[num] = line
|
||||||
|
editor:MarkerAdd(line-1,num+base)
|
||||||
|
print 'mark'
|
||||||
|
end
|
||||||
|
elseif key == 'q' and mark then
|
||||||
|
editor:GotoLine(mark-1)
|
||||||
|
if ctags_center_pos then ctags_center_pos(mark-1) end
|
||||||
|
end
|
||||||
|
return true
|
||||||
|
end)
|
||||||
|
end
|
|
@ -0,0 +1,41 @@
|
||||||
|
-- this experimental script makes it easy to select blocks with a single click.
|
||||||
|
-- The usual behaviour is to select the whole line, and if that line happens to be a fold line
|
||||||
|
-- then select the rest of that block.
|
||||||
|
|
||||||
|
scite_require 'bit.luax'
|
||||||
|
|
||||||
|
--scite_Command("Testit|gone|Escape")
|
||||||
|
|
||||||
|
local line = 0
|
||||||
|
local pos = 0
|
||||||
|
local last_line, last_pos
|
||||||
|
|
||||||
|
function line_selected()
|
||||||
|
-- if not scite_GetProp('fold') then return end
|
||||||
|
local s1 = editor.SelectionStart
|
||||||
|
local s2 = editor.SelectionEnd
|
||||||
|
pos = editor.CurrentPos
|
||||||
|
line = editor:LineFromPosition(pos)
|
||||||
|
if s2 > s1 then -- non-trivial selection
|
||||||
|
local line = editor:LineFromPosition(s1)
|
||||||
|
if editor:PositionFromLine(line) > s1 then
|
||||||
|
return -- because selection didn't start at begining of line
|
||||||
|
end
|
||||||
|
if s2 == editor:PositionFromLine(line+1) then -- whole line selected!
|
||||||
|
local lev = editor.FoldLevel[line]
|
||||||
|
if bit.band(lev,SC_FOLDLEVELHEADERFLAG) then -- a fold line
|
||||||
|
if math.abs(line - last_line) ~= 1 then
|
||||||
|
--print(line,pos,last_line,last_pos)
|
||||||
|
local lastl = editor:GetLastChild(line,-1)
|
||||||
|
s2 = editor:PositionFromLine(lastl+1)
|
||||||
|
editor:SetSel(s1,s2)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
last_line = line
|
||||||
|
last_pos = pos
|
||||||
|
end
|
||||||
|
|
||||||
|
scite_OnUpdateUI(line_selected)
|
||||||
|
|
|
@ -0,0 +1,109 @@
|
||||||
|
-- class.lua
|
||||||
|
function class(base,ctor)
|
||||||
|
local c = {} -- a new class instance
|
||||||
|
if not ctor and type(base) == 'function' then
|
||||||
|
ctor = base
|
||||||
|
base = nil
|
||||||
|
elseif type(base) == 'table' then
|
||||||
|
-- our new class is a shallow copy of the base class!
|
||||||
|
for i,v in pairs(base) do
|
||||||
|
c[i] = v
|
||||||
|
end
|
||||||
|
c._base = base
|
||||||
|
end
|
||||||
|
-- the class will be the metatable for all its objects,
|
||||||
|
-- and they will look up their methods in it.
|
||||||
|
c.__index = c
|
||||||
|
|
||||||
|
-- expose a ctor which can be called by <classname>(<args>)
|
||||||
|
local mt = {}
|
||||||
|
mt.__call = function(class_tbl,...)
|
||||||
|
local obj = {}
|
||||||
|
setmetatable(obj,c)
|
||||||
|
if ctor then
|
||||||
|
ctor(obj,unpack(arg))
|
||||||
|
else
|
||||||
|
-- make sure that any stuff from the base class is initialized!
|
||||||
|
if base and base.init then
|
||||||
|
base.init(obj,unpack(arg))
|
||||||
|
end
|
||||||
|
end
|
||||||
|
return obj
|
||||||
|
end
|
||||||
|
c.init = ctor
|
||||||
|
c.is_a = function(self,klass)
|
||||||
|
local m = getmetatable(self)
|
||||||
|
while m do
|
||||||
|
if m == klass then return true end
|
||||||
|
m = m._base
|
||||||
|
end
|
||||||
|
return false
|
||||||
|
end
|
||||||
|
setmetatable(c,mt)
|
||||||
|
return c
|
||||||
|
end
|
||||||
|
|
||||||
|
List = {}
|
||||||
|
List.__index = List
|
||||||
|
List.__call = function()
|
||||||
|
return create_list()
|
||||||
|
end
|
||||||
|
|
||||||
|
function create_list()
|
||||||
|
res = {}
|
||||||
|
setmetatable(res,List)
|
||||||
|
return res
|
||||||
|
end
|
||||||
|
|
||||||
|
function List:append(obj)
|
||||||
|
table.insert(self,obj)
|
||||||
|
end
|
||||||
|
|
||||||
|
--- some aliases for append
|
||||||
|
List.add = List.append
|
||||||
|
List.push = List.append
|
||||||
|
|
||||||
|
function List:index(obj)
|
||||||
|
for i,m in ipairs(self) do
|
||||||
|
if m == obj then
|
||||||
|
return i
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
function List:remove(obj)
|
||||||
|
local idx = self:index(obj)
|
||||||
|
if idx then
|
||||||
|
table.remove(self,idx)
|
||||||
|
return true
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
function List:iter()
|
||||||
|
local i = 0
|
||||||
|
local n = table.getn(self)
|
||||||
|
return function ()
|
||||||
|
i = i + 1
|
||||||
|
if i <= n then return self[i] end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
function List:apply(func)
|
||||||
|
for i,m in pairs(self) do
|
||||||
|
func(m)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
function List:length()
|
||||||
|
return table.getn(self)
|
||||||
|
end
|
||||||
|
|
||||||
|
-- stack-like interface
|
||||||
|
function List:pop()
|
||||||
|
return table.remove(self)
|
||||||
|
end
|
||||||
|
|
||||||
|
-- queue-like interface
|
||||||
|
function List:get()
|
||||||
|
return table.remove(self,1)
|
||||||
|
end
|
|
@ -0,0 +1,214 @@
|
||||||
|
-- Clidebug is used for local Lua debugging sessions
|
||||||
|
scite_require 'debugger.lua'
|
||||||
|
local find = string.find
|
||||||
|
local sub = string.sub
|
||||||
|
local match = string.match
|
||||||
|
local GTK = scite_GetProp('PLAT_GTK')
|
||||||
|
|
||||||
|
-- the convention with cli debug is that all Windows filenames are lowercase
|
||||||
|
-- and all spaces are replaced by %
|
||||||
|
local function canonical(file)
|
||||||
|
if not GTK then file = file:lower():gsub(' ','%%') end
|
||||||
|
return file
|
||||||
|
end
|
||||||
|
|
||||||
|
local function fpath(file)
|
||||||
|
return canonical(fullpath(file))
|
||||||
|
end
|
||||||
|
|
||||||
|
-- 'eval' has been added to cli debugger; works exactly like remDebug.
|
||||||
|
local p_pattern = '^= '
|
||||||
|
local p_error_pattern = 'Run error: %[[^%]]%]:%d+:(.+)'
|
||||||
|
--local p_error_pattern = 'Run error:'
|
||||||
|
|
||||||
|
local function print_process(s,dbg)
|
||||||
|
local err = s:match(p_error_pattern)
|
||||||
|
if err then
|
||||||
|
s = '(error)'..err
|
||||||
|
else
|
||||||
|
s = s:sub(3)
|
||||||
|
end
|
||||||
|
display(dbg.last_arg..' = '..s)
|
||||||
|
end
|
||||||
|
|
||||||
|
-- special actions for commands which require postprocessing
|
||||||
|
local postprocess_command = {
|
||||||
|
eval = {pattern=p_pattern, action=print_process, single_pattern=true,
|
||||||
|
alt_pat = p_error_pattern},
|
||||||
|
}
|
||||||
|
|
||||||
|
local function backslash(path)
|
||||||
|
return path:gsub('\\','/')
|
||||||
|
end
|
||||||
|
|
||||||
|
Clidebug = class(Dbg)
|
||||||
|
|
||||||
|
function Clidebug.discriminator(target)
|
||||||
|
print('target',target)
|
||||||
|
return find(target,'^:') == nil -- otherwise, we want remDebug!
|
||||||
|
end
|
||||||
|
|
||||||
|
function Clidebug:init(root)
|
||||||
|
self.prompt = 'DBG' --'[DEBUG]>'
|
||||||
|
self.no_target_ext = false
|
||||||
|
self.cmd_file = join(root,'clidebug.cmd')
|
||||||
|
-- this is added to the package.path of the Lua program
|
||||||
|
self.clidebug_path = scite_GetProp('clidebug.path',join(extman_Path(),'lua_clidebugger'))
|
||||||
|
self.clidebug_debugger = join(self.clidebug_path,'debugger.lua')
|
||||||
|
if not GTK then
|
||||||
|
self.clidebug_debugger = self.clidebug_debugger:lower() -- the lower here is a Windows peculiarity...
|
||||||
|
end
|
||||||
|
print('clidebug',self.clidebug_debugger)
|
||||||
|
self.no_quit_confirm = true
|
||||||
|
self.skip_system_extension = ".lua"
|
||||||
|
--~ local drive = '';
|
||||||
|
-- clidebug doesn't give fullpath
|
||||||
|
--~ if not GTK then = '[a-zA-Z]:' end
|
||||||
|
-- slightly different from remDebug
|
||||||
|
-- *NB* doesn't handle [thread] thingy! Easiest to put this elsewhere??
|
||||||
|
self.break_line = '^Paused at file ([^%s]+) line (%d+)'
|
||||||
|
self.silent_command = {}
|
||||||
|
self.postprocess_command = postprocess_command
|
||||||
|
end
|
||||||
|
|
||||||
|
local GTK = scite_GetProp('PLAT_GTK')
|
||||||
|
|
||||||
|
local function slashify(s)
|
||||||
|
return s:gsub('\\','\\\\')
|
||||||
|
end
|
||||||
|
|
||||||
|
function Clidebug:command_line(target)
|
||||||
|
-- find out where the Lua executable is; you can use the debug.lua property if it isn't the same
|
||||||
|
-- as your lua executable specified in lua.properties.
|
||||||
|
self.lua = scite_GetProp("debug.lua")
|
||||||
|
local ext = extension_of(target)
|
||||||
|
if not self.lua then
|
||||||
|
self.lua = scite_GetProp('command.go.*.lua'):match('^(%S+)')
|
||||||
|
end
|
||||||
|
self.target = target
|
||||||
|
self.target_dir = props['FileDir']
|
||||||
|
local ppath = slashify(join(self.clidebug_path,'?.lua;'))
|
||||||
|
local res = self.lua..' -e "package.path=\''..ppath..'\'..package.path" -lclidebug '..self.target..' '..self:parameter_string()
|
||||||
|
if ext == 'wlua' then
|
||||||
|
res = 'cmd /c '..res
|
||||||
|
end
|
||||||
|
return res
|
||||||
|
end
|
||||||
|
|
||||||
|
function Clidebug:dump_breakpoints(out)
|
||||||
|
for b in Breakpoints() do
|
||||||
|
-- note: different order to remDebug. *RD!
|
||||||
|
out:write('setb '..b.line..' '..canonical(b.file)..'\n')
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
function Clidebug:run_program(out,parms)
|
||||||
|
self.target_dir = canonical(props['FileDir'])
|
||||||
|
out:write('rootpath '..self.target_dir..'\n')
|
||||||
|
if scite_GetPropBool('debug.run.automatically',false) then out:write('run\n') end
|
||||||
|
end
|
||||||
|
|
||||||
|
function Clidebug:step()
|
||||||
|
dbg_command('step')
|
||||||
|
end
|
||||||
|
|
||||||
|
function Clidebug:step_over()
|
||||||
|
dbg_command('over')
|
||||||
|
end
|
||||||
|
|
||||||
|
function Clidebug:finish()
|
||||||
|
dbg_command('out')
|
||||||
|
end
|
||||||
|
|
||||||
|
function Clidebug:continue()
|
||||||
|
dbg_command('run')
|
||||||
|
end
|
||||||
|
|
||||||
|
function Clidebug:quit()
|
||||||
|
dbg_command('os.exit(0)')
|
||||||
|
end
|
||||||
|
|
||||||
|
function Clidebug:inspect(word)
|
||||||
|
dbg_command('eval',word)
|
||||||
|
end
|
||||||
|
|
||||||
|
-- these function will only pass us the filename part, not the path!
|
||||||
|
function Clidebug:set_breakpoint(file,lno)
|
||||||
|
dbg_command('setb',lno..' '..fpath(file))
|
||||||
|
end
|
||||||
|
|
||||||
|
function Clidebug:goto(file,lno)
|
||||||
|
dbg_command('tb',lno..' '..fpath(file))
|
||||||
|
self:continue()
|
||||||
|
end
|
||||||
|
|
||||||
|
function Clidebug:clear_breakpoint(file,line,num)
|
||||||
|
if file then
|
||||||
|
dbg_command('delb',line..' '..fpath(file))
|
||||||
|
else
|
||||||
|
print ('no breakpoint at '..file..':'..line)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
function Clidebug:backtrace(count)
|
||||||
|
dbg_command('trace')
|
||||||
|
end
|
||||||
|
|
||||||
|
function Clidebug:finish()
|
||||||
|
dbg_command('out')
|
||||||
|
end
|
||||||
|
|
||||||
|
-- this is not quite precisely right....
|
||||||
|
function Clidebug:locals()
|
||||||
|
dbg_command('vars')
|
||||||
|
end
|
||||||
|
|
||||||
|
function Clidebug:frame(idx)
|
||||||
|
dbg_command('set',idx)
|
||||||
|
end
|
||||||
|
|
||||||
|
function Clidebug:detect_program_end(line)
|
||||||
|
return find(line,'^Program finished')
|
||||||
|
end
|
||||||
|
|
||||||
|
function Clidebug:goto_file_line(file,line)
|
||||||
|
ProcessOutput("Paused at file "..self.target_dir..'/'..file.." line "..line..'\n')
|
||||||
|
end
|
||||||
|
|
||||||
|
-- there is some clidebugger hackery going on here. It will put us into its own version of debug.stacktrace,
|
||||||
|
-- and we need to put the program into frame #3, which is where the wobby originally happened. The usual Lua
|
||||||
|
-- error message is put out by the 'Message: ' line, which we use to capture the file:line needed to jump to.
|
||||||
|
-- The jumping is achieved by pushing the correct break pattern back into the input above (there must be
|
||||||
|
-- a more elegant way of doing this!)
|
||||||
|
local fmsg,lmsg
|
||||||
|
|
||||||
|
function Clidebug:find_execution_break(line)
|
||||||
|
local _,_,file,lineno = find(line,self.break_line)
|
||||||
|
if _ then
|
||||||
|
if not GTK then
|
||||||
|
file = file:gsub('%%',' ')
|
||||||
|
end
|
||||||
|
if file == self.clidebug_debugger and fmsg then -- our program threw a wobbly!
|
||||||
|
return fmsg,lmsg,'set 3'
|
||||||
|
else
|
||||||
|
return file,lineno
|
||||||
|
end
|
||||||
|
else
|
||||||
|
local f,l = match(line,'Message: (%S+):(%d+)')
|
||||||
|
if f then
|
||||||
|
print 'message!'
|
||||||
|
fmsg = f:gsub('%%',' ')
|
||||||
|
lmsg = l
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
function Clidebug:detect_frame(line)
|
||||||
|
local _,_,frame,file,line = find(line,'%[(%d+)%]%s+%w+ in (%S+):(%d+)')
|
||||||
|
if _ then
|
||||||
|
self:frame(frame)
|
||||||
|
self:goto_file_line(file,line)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
register_debugger('clidebug',{'lua','wlua'},Clidebug)
|
|
@ -0,0 +1,819 @@
|
||||||
|
-- A simple gdb interface for SciTE
|
||||||
|
-- Steve Donovan, 2007
|
||||||
|
-- changes:
|
||||||
|
-- (1) debug.backtrace.depth will configure depth of stack frame dump (default is 20)
|
||||||
|
-- (2) initially only adds Run and Breakpoint to the menu
|
||||||
|
-- (3) first generalized version
|
||||||
|
local GTK = scite_GetProp('PLAT_GTK')
|
||||||
|
|
||||||
|
function do_set_menu()
|
||||||
|
--~ scite_Command {
|
||||||
|
--~ 'Step|do_step|Alt+C',
|
||||||
|
--~ 'Step Over|do_next|Alt+N',
|
||||||
|
--~ 'Go To|do_temp_breakpoint|Alt+G',
|
||||||
|
--~ 'Kill|do_kill|Alt+K',
|
||||||
|
--~ 'Inspect|do_inspect|Alt+I',
|
||||||
|
--~ 'Locals|do_locals|Alt+Ctrl+L',
|
||||||
|
--~ 'Watch|do_watch|Alt+W',
|
||||||
|
--~ 'Backtrace|do_backtrace|Alt+Ctrl+B',
|
||||||
|
--~ 'Step Out|do_finish|Alt+M',
|
||||||
|
--~ 'Up|do_up|Alt+U',
|
||||||
|
--~ 'Down|do_down|Alt+D',
|
||||||
|
--~ }
|
||||||
|
end
|
||||||
|
|
||||||
|
-- only bring up the absolute minimum commands initially....
|
||||||
|
scite_Command {
|
||||||
|
--~ 'Run|do_run|*{savebefore:yes}|Alt+R',
|
||||||
|
--~ 'Breakpoint|do_breakpoint|F9'
|
||||||
|
}
|
||||||
|
|
||||||
|
scite_require 'extlib.lua'
|
||||||
|
|
||||||
|
local lua_prompt = '(lua)'
|
||||||
|
local prompt
|
||||||
|
local prompt_len
|
||||||
|
local sub = string.sub
|
||||||
|
local find = string.find
|
||||||
|
local len = string.len
|
||||||
|
local gsub = string.gsub
|
||||||
|
local status = 'dead'
|
||||||
|
local last_command
|
||||||
|
local last_breakpoint
|
||||||
|
local traced
|
||||||
|
local dbg
|
||||||
|
|
||||||
|
function dbg_last_command()
|
||||||
|
return dbg.last_command
|
||||||
|
end
|
||||||
|
|
||||||
|
function dbg_status()
|
||||||
|
return status
|
||||||
|
end
|
||||||
|
|
||||||
|
function dbg_obj()
|
||||||
|
return dbg
|
||||||
|
end
|
||||||
|
|
||||||
|
function debug_line_handler(line)
|
||||||
|
local state = dbg_status()
|
||||||
|
local dbg = dbg_obj()
|
||||||
|
if state ~= 'dead' then
|
||||||
|
dbg.last_command = '<inter>'
|
||||||
|
spawner_command(line)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
local debug_status = scite_GetProp('debug.status',false)
|
||||||
|
|
||||||
|
-- *doc* you can add $(status.msg) to your statusbar.text.1 property if
|
||||||
|
-- you want to see debugger status.
|
||||||
|
-- (see SciTEGlobal.properties for examples)
|
||||||
|
function set_status(s)
|
||||||
|
if s ~= status then
|
||||||
|
if debug_status then print('setting status to '..s) end
|
||||||
|
status = s
|
||||||
|
local str = s
|
||||||
|
if s == 'dead' then str = '' end
|
||||||
|
props['status.msg'] = str
|
||||||
|
scite.UpdateStatusBar(true)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
function dbg_status()
|
||||||
|
return status
|
||||||
|
end
|
||||||
|
|
||||||
|
------- Generic debugger interface, based on GDB ------
|
||||||
|
Dbg = class()
|
||||||
|
|
||||||
|
function Dbg:init(root)
|
||||||
|
end
|
||||||
|
|
||||||
|
function Dbg:default_target()
|
||||||
|
local ext = self.no_target_ext
|
||||||
|
if ext then
|
||||||
|
local res = props['FileName']
|
||||||
|
if ext ~= '' then res = res..'.'..ext end
|
||||||
|
return res
|
||||||
|
else
|
||||||
|
return props['FileNameExt']
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
function Dbg:step()
|
||||||
|
dbg_command('step')
|
||||||
|
end
|
||||||
|
|
||||||
|
function Dbg:step_over()
|
||||||
|
dbg_command('next')
|
||||||
|
end
|
||||||
|
|
||||||
|
function Dbg:continue()
|
||||||
|
dbg_command('cont')
|
||||||
|
end
|
||||||
|
|
||||||
|
function Dbg:quit()
|
||||||
|
spawner_command('quit')
|
||||||
|
if not self.no_quit_confirm then
|
||||||
|
spawner_command('y')
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
function Dbg:set_breakpoint(file,lno)
|
||||||
|
dbg_command('break',file..':'..lno)
|
||||||
|
end
|
||||||
|
|
||||||
|
-- generally there are two ways to kill breakpoints in debuggers;
|
||||||
|
-- either by number or by explicit file:line.
|
||||||
|
function Dbg:clear_breakpoint(file,line,num)
|
||||||
|
if file then
|
||||||
|
dbg_command('clear',file..':'..line)
|
||||||
|
else
|
||||||
|
print ('no breakpoint at '..file..':'..line)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
-- run until the indicated file:line is reached
|
||||||
|
function Dbg:goto(file,lno)
|
||||||
|
dbg_command('tbreak',file..':'..lno)
|
||||||
|
dbg_command('continue')
|
||||||
|
end
|
||||||
|
|
||||||
|
function Dbg:set_display_handler(fun)
|
||||||
|
-- 0.8 change: if a handler is already been set, don't try to set a new one!
|
||||||
|
if self.result_handler then return end
|
||||||
|
self.result_handler = fun
|
||||||
|
end
|
||||||
|
|
||||||
|
function Dbg:inspect(word)
|
||||||
|
dbg_command('print',word)
|
||||||
|
end
|
||||||
|
|
||||||
|
local skip_file_pattern
|
||||||
|
local do_skip_includes
|
||||||
|
|
||||||
|
--- *doc* you can choose a directory pattern for files which you don't want to skip through
|
||||||
|
--- for Unix, this is usually easy, but for mingw you have to supply the path to
|
||||||
|
--- your gcc directory.
|
||||||
|
function Dbg:auto_skip_over_file(file)
|
||||||
|
if not do_skip_includes then return end
|
||||||
|
return find(file,skip_file_pattern)
|
||||||
|
end
|
||||||
|
|
||||||
|
function Dbg:finish()
|
||||||
|
dbg_command('finish')
|
||||||
|
end
|
||||||
|
|
||||||
|
function Dbg:locals()
|
||||||
|
dbg_command('info locals')
|
||||||
|
end
|
||||||
|
|
||||||
|
function Dbg:watch(word)
|
||||||
|
dbg_command('display',word)
|
||||||
|
end
|
||||||
|
|
||||||
|
function Dbg:up()
|
||||||
|
dbg_command('up')
|
||||||
|
end
|
||||||
|
|
||||||
|
function Dbg:down()
|
||||||
|
dbg_command('down')
|
||||||
|
end
|
||||||
|
|
||||||
|
function Dbg:backtrace(depth)
|
||||||
|
dbg_command('backtrace',depth)
|
||||||
|
end
|
||||||
|
|
||||||
|
function Dbg:frame(f)
|
||||||
|
dbg_command('frame',f)
|
||||||
|
end
|
||||||
|
|
||||||
|
function Dbg:detect_frame(line)
|
||||||
|
local _,_,frame = find(line,'#(%d+)')
|
||||||
|
if _ then
|
||||||
|
dbg:frame(frame)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
function Dbg:special_debugger_setup(out)
|
||||||
|
end
|
||||||
|
|
||||||
|
function Dbg:breakpoint_confirmation(line)
|
||||||
|
-- breakpoint defintion confirmation
|
||||||
|
-- ISSUE: only picking up for breakpoints added _during_ session!
|
||||||
|
local _,_,bnum = find(line,"Breakpoint (%d+) at")
|
||||||
|
if _ then
|
||||||
|
if last_breakpoint then
|
||||||
|
print('breakpoint:',last_breakpoint.line,bnum)
|
||||||
|
last_breakpoint.num = bnum
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
function quote(s)
|
||||||
|
return '"'..s..'"'
|
||||||
|
end
|
||||||
|
|
||||||
|
function Dbg:find_execution_break(line)
|
||||||
|
local _,_,file,lineno = find(line,self.break_line)
|
||||||
|
if _ then return file,lineno end
|
||||||
|
end
|
||||||
|
|
||||||
|
function Dbg:check_breakpoint (b)
|
||||||
|
return true
|
||||||
|
end
|
||||||
|
|
||||||
|
-- add our currently defined breakpoints
|
||||||
|
function Dbg:dump_breakpoints(out)
|
||||||
|
for b in Breakpoints() do
|
||||||
|
if self:check_breakpoint(b) then
|
||||||
|
local f = basename(b.file)
|
||||||
|
print (b.file,f)
|
||||||
|
out:write('break '..f..':'..b.line..'\n')
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
function Dbg:run_program(out,parms)
|
||||||
|
out:write('run '..parms..'\n')
|
||||||
|
end
|
||||||
|
|
||||||
|
function Dbg:detect_program_crash(line)
|
||||||
|
return false
|
||||||
|
end
|
||||||
|
|
||||||
|
----- Debugger commands --------
|
||||||
|
local spawner_obj
|
||||||
|
|
||||||
|
local function launch_debugger()
|
||||||
|
if do_launch() then
|
||||||
|
set_status('running')
|
||||||
|
return true
|
||||||
|
else
|
||||||
|
print 'Unable to debug program!'
|
||||||
|
return false
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
local function try_start_debugger()
|
||||||
|
if not dbg then
|
||||||
|
return launch_debugger()
|
||||||
|
else
|
||||||
|
return true
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
function do_step()
|
||||||
|
if not try_start_debugger() then return end
|
||||||
|
dbg:step()
|
||||||
|
end
|
||||||
|
|
||||||
|
function do_run()
|
||||||
|
if status == 'dead' then
|
||||||
|
launch_debugger()
|
||||||
|
else
|
||||||
|
RemoveLastMarker(true)
|
||||||
|
dbg:continue()
|
||||||
|
set_status('running')
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
function do_kill()
|
||||||
|
if not dbg then return end
|
||||||
|
if status == 'running' then
|
||||||
|
-- this actually kills the debugger process
|
||||||
|
spawner_obj:kill()
|
||||||
|
else
|
||||||
|
-- this will ask the debugger nicely to exit
|
||||||
|
dbg:quit()
|
||||||
|
end
|
||||||
|
closing_process()
|
||||||
|
end
|
||||||
|
|
||||||
|
function do_next()
|
||||||
|
if not try_start_debugger() then return end
|
||||||
|
dbg:step_over()
|
||||||
|
end
|
||||||
|
|
||||||
|
function breakpoint_from_position(lno)
|
||||||
|
for b in Breakpoints() do
|
||||||
|
if b.file == scite_CurrentFile() and b.line == lno then
|
||||||
|
return b
|
||||||
|
end
|
||||||
|
end
|
||||||
|
return nil
|
||||||
|
end
|
||||||
|
|
||||||
|
function do_breakpoint()
|
||||||
|
local lno = current_line() + 1
|
||||||
|
local file = props['FileNameExt']
|
||||||
|
-- do we have already have a breakpoint here?
|
||||||
|
local brk = breakpoint_from_position(lno)
|
||||||
|
if brk then
|
||||||
|
local bnum = brk.num
|
||||||
|
brk:delete()
|
||||||
|
if status ~= 'dead' then
|
||||||
|
dbg:clear_breakpoint(file,lno,bnum)
|
||||||
|
end
|
||||||
|
else
|
||||||
|
last_breakpoint = SetBreakMarker(lno)
|
||||||
|
if last_breakpoint then
|
||||||
|
if status ~= 'dead' then
|
||||||
|
dbg:set_breakpoint(file,lno)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
function do_temp_breakpoint()
|
||||||
|
if not try_start_debugger() then return end
|
||||||
|
local lno = current_line() + 1
|
||||||
|
local file = props['FileNameExt']
|
||||||
|
dbg:goto(file,lno)
|
||||||
|
end
|
||||||
|
|
||||||
|
local function char_at(p)
|
||||||
|
return string.char(editor.CharAt[p])
|
||||||
|
end
|
||||||
|
|
||||||
|
-- used to pick up current expression from current document position
|
||||||
|
-- We use the selection, if available, and otherwise pick up the word;
|
||||||
|
-- if it seems to be a field expression, look for the object before.
|
||||||
|
local function current_expr(pos)
|
||||||
|
local s = editor:GetSelText()
|
||||||
|
if s == '' then -- no selection, so find the word
|
||||||
|
pos = pos or editor.CurrentPos
|
||||||
|
local p1 = editor:WordStartPosition(pos,true)
|
||||||
|
local p2 = editor:WordEndPosition(pos,true)
|
||||||
|
-- is this a field of some object?
|
||||||
|
while true do
|
||||||
|
if char_at(p1-1) == '.' then -- generic member access
|
||||||
|
p1 = editor:WordStartPosition(p1-2,true)
|
||||||
|
elseif char_at(p1-1) == '>' and char_at(p1-2) == '-' then --C/C++ pointer
|
||||||
|
p1 = editor:WordStartPosition(p1-3,true)
|
||||||
|
else
|
||||||
|
break
|
||||||
|
end
|
||||||
|
end
|
||||||
|
return editor:textrange(p1,p2)
|
||||||
|
else
|
||||||
|
return s
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
function actually_inspect(w)
|
||||||
|
if len(w) > 0 then
|
||||||
|
dbg:inspect(w)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
function do_inspect()
|
||||||
|
if not dbg then return end
|
||||||
|
local w = current_expr()
|
||||||
|
scite.Prompt("Inspect which expression:",w,"actually_inspect")
|
||||||
|
end
|
||||||
|
|
||||||
|
function do_locals()
|
||||||
|
if not dbg then return end
|
||||||
|
dbg:locals()
|
||||||
|
end
|
||||||
|
|
||||||
|
function actually_watch(w)
|
||||||
|
dbg:watch(w)
|
||||||
|
end
|
||||||
|
|
||||||
|
function do_watch()
|
||||||
|
if not dbg then return end
|
||||||
|
scite.Prompt("Watch which expression:",current_expr(),"actually_watch")
|
||||||
|
end
|
||||||
|
|
||||||
|
function do_backtrace()
|
||||||
|
if not dbg then return end
|
||||||
|
dbg:backtrace(scite_GetProp('debug.backtrace.depth','20'))
|
||||||
|
end
|
||||||
|
|
||||||
|
function do_up()
|
||||||
|
if not dbg then return end
|
||||||
|
dbg:up()
|
||||||
|
end
|
||||||
|
|
||||||
|
function do_down()
|
||||||
|
if not dbg then return end
|
||||||
|
dbg:down()
|
||||||
|
end
|
||||||
|
|
||||||
|
function do_finish()
|
||||||
|
if not dbg then return end
|
||||||
|
dbg:finish()
|
||||||
|
end
|
||||||
|
|
||||||
|
local root
|
||||||
|
|
||||||
|
function Dbg:parameter_string()
|
||||||
|
-- any parameters defined with View|Parameters
|
||||||
|
local parms = ' '
|
||||||
|
local i = 1
|
||||||
|
local parm = props[i]
|
||||||
|
while parm ~= '' do
|
||||||
|
if find(parm,'%s') then
|
||||||
|
-- if it's already quoted, then preserve the quotes
|
||||||
|
if find(parm,'"') == 1 then
|
||||||
|
parm = gsub(parm,'"','\\"')
|
||||||
|
end
|
||||||
|
parm = '"'..parm..'"'
|
||||||
|
end
|
||||||
|
parms = parms..' '..parm
|
||||||
|
i = i + 1
|
||||||
|
parm = props[i]
|
||||||
|
end
|
||||||
|
return parms
|
||||||
|
end
|
||||||
|
|
||||||
|
local menu_init = false
|
||||||
|
local debug_verbose
|
||||||
|
local debuggers = {}
|
||||||
|
local append = table.insert
|
||||||
|
local remove = table.remove
|
||||||
|
|
||||||
|
---- event handling
|
||||||
|
|
||||||
|
-- If an event returns true, then this event will persist.
|
||||||
|
-- The return value of this function is true if any event returns an extra true result
|
||||||
|
-- Note: we iterate over a copy of the list, because this is the only way I've
|
||||||
|
-- found to make this method re-enterant. With this scheme it is
|
||||||
|
-- safe to raise an event within an event handler.
|
||||||
|
function Dbg:raise_event (event,...)
|
||||||
|
local events = self.events
|
||||||
|
if not events then return end
|
||||||
|
-- not recommended for big tables!
|
||||||
|
local cpy = {unpack(events)}
|
||||||
|
local ignore
|
||||||
|
for i,evt in ipairs(cpy) do
|
||||||
|
if evt.event == event then
|
||||||
|
local keep,want_to_ignore = evt.handler(...)
|
||||||
|
if not keep then
|
||||||
|
remove(events,i)
|
||||||
|
end
|
||||||
|
ignore = ignore or want_to_ignore
|
||||||
|
end
|
||||||
|
end
|
||||||
|
return ignore
|
||||||
|
end
|
||||||
|
|
||||||
|
function Dbg:set_event (name,handler)
|
||||||
|
if not self.events then self.events = {} end
|
||||||
|
append(self.events,{event=name,handler=handler})
|
||||||
|
end
|
||||||
|
|
||||||
|
function Dbg:queue_command (cmd)
|
||||||
|
self:set_event('prompt',function() spawner_command(cmd) end)
|
||||||
|
end
|
||||||
|
|
||||||
|
function create_existing_breakpoints()
|
||||||
|
local out = io.open(dbg.cmd_file,"w")
|
||||||
|
dbg:special_debugger_setup(out)
|
||||||
|
dbg:dump_breakpoints(out)
|
||||||
|
local parms = dbg:parameter_string()
|
||||||
|
dbg:run_program(out,parms)
|
||||||
|
out:close();
|
||||||
|
end
|
||||||
|
|
||||||
|
-- you may register more than one debugger class (@dclass) but such classes must
|
||||||
|
-- have a static method discriminate() which will be passed the full target name.
|
||||||
|
function register_debugger(name,ext,dclass)
|
||||||
|
if type(ext) == 'table' then
|
||||||
|
for i,v in ipairs(ext) do
|
||||||
|
register_debugger(name,v,dclass) --**
|
||||||
|
end
|
||||||
|
else
|
||||||
|
if not debuggers[ext] then
|
||||||
|
debuggers[ext] = {dclass}
|
||||||
|
else
|
||||||
|
if not dclass.discriminator then
|
||||||
|
error("Multiple debuggers registered for this extension, with no discriminator function")
|
||||||
|
end
|
||||||
|
append(debuggers[ext],dclass)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
function create_debugger(ext,target)
|
||||||
|
local dclasses = debuggers[ext]
|
||||||
|
if not dclasses then dclasses = debuggers['*'] end
|
||||||
|
if #dclasses == 1 then -- there is only one possible debugger for this extension!
|
||||||
|
return dclasses[1]
|
||||||
|
else -- there are several registered. We need to call the discriminator!
|
||||||
|
for i,d in ipairs(dclasses) do
|
||||||
|
if d.discriminator(target) then
|
||||||
|
return d
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
error("unable to find appropriate debugger")
|
||||||
|
end
|
||||||
|
|
||||||
|
local initialized
|
||||||
|
local was_error = false
|
||||||
|
local continued_line, end_line_action, postproc
|
||||||
|
|
||||||
|
function do_launch()
|
||||||
|
if not menu_init then
|
||||||
|
do_set_menu()
|
||||||
|
menu_init = true
|
||||||
|
end
|
||||||
|
scite.MenuCommand(IDM_SAVE)
|
||||||
|
local no_host_symbols
|
||||||
|
traced = false
|
||||||
|
debug_verbose = true
|
||||||
|
-- *doc* detect the debugger we want to use, based on target extension
|
||||||
|
-- if there is no explicit target, then use the current file.
|
||||||
|
local target = scite_GetProp('debug.target')
|
||||||
|
local ext
|
||||||
|
if target then
|
||||||
|
-- @doc the target may not actually have debug symbols, in the case
|
||||||
|
-- where we are debugging some dynamic libraries. Indicate this
|
||||||
|
-- by prefixing target with [n]
|
||||||
|
if target:find('^%[n%]') then
|
||||||
|
target = target:sub(4)
|
||||||
|
no_host_symbols = true
|
||||||
|
end
|
||||||
|
ext = extension_of(target)
|
||||||
|
else
|
||||||
|
ext = props['FileExt']
|
||||||
|
end
|
||||||
|
dbg = create_debugger(ext,choose(target,target,props['FileName']))
|
||||||
|
dbg.host_symbols = not no_host_symbols
|
||||||
|
-- this isn't ideal!
|
||||||
|
root = props['TMP']
|
||||||
|
dbg:init(root)
|
||||||
|
do_skip_includes = scite_GetProp('debug.skip.includes',false)
|
||||||
|
if do_skip_includes then
|
||||||
|
local inc_path
|
||||||
|
if GTK then inc_path = '^/usr/' else inc_path = '<<<DONUT>>>' end
|
||||||
|
local file_pat_prop = 'debug.skip.file.matching'
|
||||||
|
if dbg.skip_system_extension then
|
||||||
|
file_pat_prop = file_pat_prop..dbg.skip_system_extension
|
||||||
|
end
|
||||||
|
skip_file_pattern = scite_GetProp(file_pat_prop,inc_path)
|
||||||
|
end
|
||||||
|
-- *doc* the default target depends on the debugger (it wd have extension for pydb, etc)
|
||||||
|
if not target then target = dbg:default_target() end
|
||||||
|
target = quote_if_needed(target)
|
||||||
|
-- *doc* this determines the time before calltips appear; you can set this as a SciTE property.
|
||||||
|
if props['dwell.period'] == '' then props['dwell.period'] = 500 end
|
||||||
|
-- get the debugger process command string
|
||||||
|
local dbg_cmd = dbg:command_line(target)
|
||||||
|
print(dbg_cmd)
|
||||||
|
continued_line = nil
|
||||||
|
-- first create the cmd file for the debugger
|
||||||
|
create_existing_breakpoints()
|
||||||
|
scite_InteractivePromptHandler (dbg.prompt,debug_line_handler)
|
||||||
|
--- and go!!
|
||||||
|
scite.SetDirectory(props['FileDir'])
|
||||||
|
spawner.verbose(scite_GetPropBool('debug.spawner.verbose',false))
|
||||||
|
-- spawner.fulllines(1)
|
||||||
|
spawner_obj = spawner.new(dbg_cmd)
|
||||||
|
spawner_obj:set_output('ProcessChunk')
|
||||||
|
spawner_obj:set_result('ProcessResult')
|
||||||
|
return spawner_obj:run()
|
||||||
|
end
|
||||||
|
|
||||||
|
-- speaking to the spawned process goes through a named pipe on both
|
||||||
|
-- platforms.
|
||||||
|
local pipe = nil
|
||||||
|
local last_command_line
|
||||||
|
|
||||||
|
function dbg_command_line(s)
|
||||||
|
if status == 'active' or status == 'error' then
|
||||||
|
spawner_command(s)
|
||||||
|
last_command_line = s
|
||||||
|
if dbg.trailing_prompt then
|
||||||
|
last_command_line = dbg.prompt..last_command_line
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
function spawner_command(line)
|
||||||
|
if not dbg then return end
|
||||||
|
spawner_obj:write(line..'\n')
|
||||||
|
end
|
||||||
|
|
||||||
|
--local ferr = io.stderr
|
||||||
|
|
||||||
|
function dbg_command(s,argument)
|
||||||
|
if not dbg then return end
|
||||||
|
dbg.last_command = s
|
||||||
|
dbg.last_arg = argument
|
||||||
|
if argument then s = s..' '..argument end
|
||||||
|
dbg_command_line(s)
|
||||||
|
end
|
||||||
|
|
||||||
|
-- *doc* currently, only win32-spawner understands the !up command; I can't
|
||||||
|
-- find the Unix/GTK equivalent! It is meant to bring the debugger
|
||||||
|
-- SciTE instance to the front.
|
||||||
|
function raise_scite()
|
||||||
|
--spawner.foreground()
|
||||||
|
end
|
||||||
|
|
||||||
|
-- output of inspected variables goes here; this mechanism allows us
|
||||||
|
-- to redirect command output (to a tooltip in this case)
|
||||||
|
function display(s)
|
||||||
|
if dbg.result_handler then
|
||||||
|
dbg.result_handler(s)
|
||||||
|
dbg.result_handler = nil
|
||||||
|
else
|
||||||
|
print(s)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
function closing_process()
|
||||||
|
print 'quitting debugger'
|
||||||
|
-- spawner_obj:close()
|
||||||
|
set_status('dead')
|
||||||
|
RemoveLastMarker(true)
|
||||||
|
scite_LeaveInteractivePrompt()
|
||||||
|
dbg = nil
|
||||||
|
end
|
||||||
|
|
||||||
|
local function finish_pending_actions()
|
||||||
|
if continued_line then
|
||||||
|
end_line_action(continued_line,dbg)
|
||||||
|
continued_line = nil
|
||||||
|
if postproc.once then dbg.last_command = '' end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
local function set_error_state()
|
||||||
|
if was_error then
|
||||||
|
set_status('error')
|
||||||
|
was_error = false
|
||||||
|
else
|
||||||
|
set_status('active')
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
local function auto_backtrace()
|
||||||
|
if status == 'error' and not traced then
|
||||||
|
raise_scite()
|
||||||
|
do_backtrace()
|
||||||
|
traced = true
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
local current_file
|
||||||
|
|
||||||
|
local function error(s)
|
||||||
|
io.stderr:write(s..'\n')
|
||||||
|
end
|
||||||
|
|
||||||
|
local was_prompt
|
||||||
|
|
||||||
|
function ProcessOutput(line)
|
||||||
|
-- on the GTK version, commands are currently echoed....
|
||||||
|
if last_command_line and find(line,last_command_line) then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
-- Debuggers (esp. clidebug) can emit spurious blank lines. This makes them quieter!
|
||||||
|
if was_prompt and line:find('^%s*$') then
|
||||||
|
was_prompt = false
|
||||||
|
return
|
||||||
|
end
|
||||||
|
--~ trace('*'..line)
|
||||||
|
-- sometimes it's useful to know when the debugger process has properly started
|
||||||
|
if dbg.detect_start and find(line,dbg.detect_start) then
|
||||||
|
dbg:handle_debug_start()
|
||||||
|
dbg.detect_start = nil
|
||||||
|
return
|
||||||
|
end
|
||||||
|
-- detecting end of program execution
|
||||||
|
local prog_ended,process_fininished = dbg:detect_program_end(line)
|
||||||
|
if prog_ended then
|
||||||
|
if not processed_finished then spawner_command('quit') end
|
||||||
|
set_status('dead')
|
||||||
|
closing_process()
|
||||||
|
return
|
||||||
|
end
|
||||||
|
-- ignore prompt; this is the point at which we know that commands have finished
|
||||||
|
if find(line,dbg.prompt) then
|
||||||
|
dbg:raise_event 'prompt'
|
||||||
|
finish_pending_actions()
|
||||||
|
if was_error then set_error_state() end
|
||||||
|
auto_backtrace()
|
||||||
|
was_prompt = true
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
|
-- the result of some commands require postprocessing;
|
||||||
|
-- it will collect multi-line output together!
|
||||||
|
postproc = dbg.postprocess_command[dbg.last_command]
|
||||||
|
if postproc then
|
||||||
|
local tline = rtrim(line)
|
||||||
|
if find(tline,postproc.pattern)
|
||||||
|
or (postproc.alt_pat and find(tline,postproc.alt_pat)) then
|
||||||
|
if not postproc.single_pattern then
|
||||||
|
finish_pending_actions()
|
||||||
|
continued_line = tline
|
||||||
|
end_line_action = postproc.action
|
||||||
|
else
|
||||||
|
postproc.action(tline,dbg)
|
||||||
|
end
|
||||||
|
else
|
||||||
|
if continued_line then continued_line = continued_line..tline end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
-- did we get a confirmation message about a created breakpoint?
|
||||||
|
dbg:breakpoint_confirmation(line)
|
||||||
|
-- have we crashed?
|
||||||
|
if dbg:detect_program_crash(line) then
|
||||||
|
was_error = true
|
||||||
|
end
|
||||||
|
-- looking for break at line pattern
|
||||||
|
local file,lineno,explicit_error = dbg:find_execution_break(line)
|
||||||
|
if file and status ~= 'dead' then
|
||||||
|
if dbg.check_skip_always or current_file ~= file then
|
||||||
|
current_file = file
|
||||||
|
if dbg:auto_skip_over_file(file) then
|
||||||
|
dbg:finish()
|
||||||
|
spawner_command('step') --??
|
||||||
|
return
|
||||||
|
end
|
||||||
|
end
|
||||||
|
-- a debugger can indicate an explicit error, rather than depending on
|
||||||
|
-- detect_program_crash()
|
||||||
|
if explicit_error then
|
||||||
|
was_error = true
|
||||||
|
end
|
||||||
|
set_error_state()
|
||||||
|
-- if any of the break events wishes, we can ignore this break...
|
||||||
|
if not dbg:raise_event ('break',file,lineno,status) then
|
||||||
|
OpenAtPos(file,lineno,status)
|
||||||
|
raise_scite()
|
||||||
|
auto_backtrace()
|
||||||
|
dbg.last_comand = ''
|
||||||
|
-- may schedule a command to be executed after the error backtrace
|
||||||
|
if type(explicit_error) == 'string' then
|
||||||
|
dbg:queue_command(explicit_error)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
else
|
||||||
|
local cmd = dbg.last_command
|
||||||
|
if (debug_verbose or dbg.last_command == '<inter>') and
|
||||||
|
not (dbg.silent_command[cmd] or dbg.postprocess_command[cmd]) then
|
||||||
|
trace(line)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
function ProcessChunk(s)
|
||||||
|
local i1 = 1
|
||||||
|
local i2 = find(s,'\n',i1)
|
||||||
|
while i2 do
|
||||||
|
local line = sub(s,i1,i2)
|
||||||
|
ProcessOutput(line)
|
||||||
|
i1 = i2 + 1
|
||||||
|
i2 = find(s,'\n',i1)
|
||||||
|
end
|
||||||
|
if i1 <= len(s) then
|
||||||
|
local line = sub(s,i1)
|
||||||
|
ProcessOutput(line)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
function ProcessResult(res)
|
||||||
|
if status ~= 'dead' then
|
||||||
|
closing_process()
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
--- *doc* currently, double-clicking in the output pane will try to recognize
|
||||||
|
--- a stack frame pattern and move to that frame if possible.
|
||||||
|
scite_OnDoubleClick(function()
|
||||||
|
if output.Focus and status == 'active' or status == 'error' then
|
||||||
|
dbg:detect_frame(output:GetLine(current_output_line()))
|
||||||
|
end
|
||||||
|
end)
|
||||||
|
|
||||||
|
-- *doc* if your scite has OnDwellStart, then the current symbol under the mouse
|
||||||
|
-- pointer will be evaluated and shown in a calltip.
|
||||||
|
local _pos
|
||||||
|
|
||||||
|
function calltip(s)
|
||||||
|
editor:CallTipShow(_pos,s)
|
||||||
|
end
|
||||||
|
|
||||||
|
scite_OnDwellStart(function (pos,s)
|
||||||
|
if status == 'active' or status == 'error' then
|
||||||
|
if s ~= '' then
|
||||||
|
s = current_expr(pos)
|
||||||
|
_pos = pos
|
||||||
|
dbg:set_display_handler(calltip)
|
||||||
|
dbg:inspect(s)
|
||||||
|
else
|
||||||
|
editor:CallTipCancel()
|
||||||
|
end
|
||||||
|
return true
|
||||||
|
end
|
||||||
|
end)
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,172 @@
|
||||||
|
-- A simple gdb interface for SciTE
|
||||||
|
-- Steve Donovan, 2007-2008
|
||||||
|
scite_require 'debugger.lua'
|
||||||
|
|
||||||
|
local sub = string.sub
|
||||||
|
local find = string.find
|
||||||
|
local len = string.len
|
||||||
|
local gsub = string.gsub
|
||||||
|
|
||||||
|
-- this is not only gdb-specific, but depends on looking for patterns
|
||||||
|
-- which depend on the implementation of std::string, etc.
|
||||||
|
function simplify_term(s)
|
||||||
|
-- std::string
|
||||||
|
if find(s,'^{%s*static npos = 4294967295,') then
|
||||||
|
local _,_,str = find(s,'(".*")')
|
||||||
|
return str
|
||||||
|
end
|
||||||
|
-- SString
|
||||||
|
if find(s,'^{%s*<SContainer> = {%s*s =') then
|
||||||
|
local _,_,str = find(s,'(".*"),%s*sSize =')
|
||||||
|
return str
|
||||||
|
end
|
||||||
|
-- add your custom patterns here!
|
||||||
|
-- arb structure; process recursively
|
||||||
|
if sub(s,1,1) == '{' then
|
||||||
|
local arg = sub(s,2,-2)
|
||||||
|
return '{'..simplify(arg)..'}'
|
||||||
|
else
|
||||||
|
return s
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
-- apply simplify_term recursively!
|
||||||
|
function simplify(str)
|
||||||
|
str = simplify_term(str)
|
||||||
|
local res = gsub(str,'%b{}',simplify_term)
|
||||||
|
return res
|
||||||
|
end
|
||||||
|
|
||||||
|
local inspect_pattern = '^(%$%d+) = '
|
||||||
|
local symbol_pattern = '[%w_]+'
|
||||||
|
local locals_pattern = '^'..symbol_pattern..' = '
|
||||||
|
local pointer_pattern = '%('..symbol_pattern..' %*%)'
|
||||||
|
local const_pointer_pattern = '%(const '..symbol_pattern..' %*%)'
|
||||||
|
local inspect_error_pattern = '^Cannot access memory at address 0x'
|
||||||
|
local last_arg
|
||||||
|
|
||||||
|
local function print_process(s,dbg)
|
||||||
|
local enum,expr = s:match(inspect_pattern..'(.*)')
|
||||||
|
local argument = dbg,last_arg
|
||||||
|
if not enum and not expr then
|
||||||
|
expr = '(cannot evaluate)'
|
||||||
|
--~ last_arg = nil
|
||||||
|
end
|
||||||
|
--~ print('+',expr)
|
||||||
|
-- if the result was a pointer, then try to evaluate that pointer.
|
||||||
|
if (expr:find(pointer_pattern) or expr:find(const_pointer_pattern)) and not expr:find '{' then
|
||||||
|
dbg:inspect('*'..enum)
|
||||||
|
last_arg = dbg.last_arg..' '..expr
|
||||||
|
--~ print('+last_arg',last_arg)
|
||||||
|
else
|
||||||
|
--~ print('-last_arg',last_arg)
|
||||||
|
if last_arg then
|
||||||
|
dbg.last_arg = last_arg
|
||||||
|
last_arg = nil
|
||||||
|
end
|
||||||
|
display(dbg.last_arg.." = "..simplify(expr))
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
local function locals_process(s)
|
||||||
|
local s1,s2 = find(s,locals_pattern)
|
||||||
|
-- split this 'var = expr' line and try simplify the expression
|
||||||
|
local var = sub(s,s1,s2 - 3) -- miss out on the ' = '
|
||||||
|
local _,_,expr = find(s,locals_pattern..'(.*)')
|
||||||
|
display(var.." = "..simplify(expr))
|
||||||
|
end
|
||||||
|
|
||||||
|
local backtrace_pattern = '^#(%d+)'
|
||||||
|
|
||||||
|
function backtrace_process(s)
|
||||||
|
local s = gsub(s,'0x%w+ in ','',1)
|
||||||
|
print(s)
|
||||||
|
end
|
||||||
|
|
||||||
|
local finish_pattern = '^Value returned is %$%d+ ='
|
||||||
|
|
||||||
|
local function finish_process(s)
|
||||||
|
local s1,s2 = find(s,finish_pattern)
|
||||||
|
local expr = sub(s,s2+1)
|
||||||
|
display('returned '..simplify(expr))
|
||||||
|
end
|
||||||
|
|
||||||
|
local was_error = false
|
||||||
|
-- commands where one ignores gdb's response
|
||||||
|
local silent_command = {frame = true}
|
||||||
|
-- special actions for commands which require postprocessing
|
||||||
|
local postprocess_command = {
|
||||||
|
backtrace = {pattern=backtrace_pattern,action=backtrace_process},
|
||||||
|
print = {pattern=inspect_pattern, action=print_process, alt_pat=inspect_error_pattern},
|
||||||
|
['info locals'] = {pattern=locals_pattern, action=locals_process},
|
||||||
|
display = {pattern=locals_pattern,action=locals_process},
|
||||||
|
finish = {pattern=finish_pattern,action=finish_process,once=true}
|
||||||
|
}
|
||||||
|
|
||||||
|
local GTK = scite_GetProp('PLAT_GTK')
|
||||||
|
|
||||||
|
Gdb = class(Dbg)
|
||||||
|
|
||||||
|
function Gdb:init(root)
|
||||||
|
print('locals pattern"'..locals_pattern..'"')
|
||||||
|
local esc = string.char(26)
|
||||||
|
self.prompt = '(GDB)'
|
||||||
|
self.no_target_ext = ''
|
||||||
|
self.cmd_file = root..'/prompt.cmd'
|
||||||
|
self.postprocess_command = postprocess_command
|
||||||
|
-- commands where one ignores gdb's response
|
||||||
|
self.silent_command={frame = true}
|
||||||
|
if GTK then
|
||||||
|
self.break_line = '^'..esc..esc..'(/[^:]+):(%d+)'
|
||||||
|
else
|
||||||
|
self.break_line = '^'..esc..esc..'(%a:[^:]+):(%d+)'
|
||||||
|
end
|
||||||
|
last_arg = nil
|
||||||
|
end
|
||||||
|
|
||||||
|
function Gdb:command_line(target)
|
||||||
|
local gdb = scite_GetProp("debug.gdb","gdb")
|
||||||
|
return gdb..' --quiet -x '..quote_if_needed(self.cmd_file)..' -f '..target
|
||||||
|
end
|
||||||
|
|
||||||
|
function Gdb:special_debugger_setup(out)
|
||||||
|
out:write('set prompt (GDB)\\n\n') -- ensure gdb prompt has linefeed
|
||||||
|
out:write('set height 0\n') -- disable gdb paging
|
||||||
|
if scite_GetPropBool('debug.breakpoint.pending',GTK) then
|
||||||
|
-- unrecognized file:line assumed to be 'pending'
|
||||||
|
out:write('set breakpoint pending on\n')
|
||||||
|
end
|
||||||
|
local env = scite_GetProp('debug.environment')
|
||||||
|
if env then
|
||||||
|
for _,e in ipairs(split(env,';')) do
|
||||||
|
local var,val = splitv(e,'=')
|
||||||
|
out:write(('set env %s %s\n'):format(var,val))
|
||||||
|
end
|
||||||
|
end
|
||||||
|
-- normally gdb will not let you set breakpoints if there's no debug information.
|
||||||
|
-- Fortunately, it's not picky about exactly what symbols are available, so
|
||||||
|
-- we placate it with a little stub.
|
||||||
|
if not self.host_symbols then
|
||||||
|
local stub = slashify(join(extman_Path(),choose(GTK,'stubby.so','stubby.dll')))
|
||||||
|
out:write('symbol-file ',stub,'\n')
|
||||||
|
end
|
||||||
|
-- @doc under Windows it's usually better to force GDB to create a new console window
|
||||||
|
-- for a command-line application.
|
||||||
|
if not GTK then
|
||||||
|
out:write('set new-console on\n')
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
function Gdb:detect_program_end(line)
|
||||||
|
local no_program = find(line,"No executable specified, use `target exec'%.")
|
||||||
|
if no_program then print 'NO PROGRAM' end
|
||||||
|
-- detecting normal end of program execution
|
||||||
|
local res = find(line,'^Program exited normally%.') or find(line,'^Program exited with code %d+') or no_program
|
||||||
|
return res,false
|
||||||
|
end
|
||||||
|
|
||||||
|
function Gdb:detect_program_crash(line)
|
||||||
|
return find(line,'^Program received signal ')
|
||||||
|
end
|
||||||
|
|
||||||
|
register_debugger('gdb','*',Gdb)
|
|
@ -0,0 +1,93 @@
|
||||||
|
scite_require 'debugger.lua'
|
||||||
|
local find = string.find
|
||||||
|
local sub = string.sub
|
||||||
|
|
||||||
|
local p_pattern = '.*= '
|
||||||
|
|
||||||
|
local function print_process(s)
|
||||||
|
display(s)
|
||||||
|
end
|
||||||
|
|
||||||
|
-- special actions for commands which require postprocessing
|
||||||
|
local postprocess_command = {
|
||||||
|
print = {pattern=p_pattern, action=print_process, single_pattern=true},
|
||||||
|
}
|
||||||
|
|
||||||
|
Jdb = class(Dbg)
|
||||||
|
|
||||||
|
function Jdb:init(root)
|
||||||
|
self.prompt = '(JDB)'
|
||||||
|
self.no_target_ext = ''
|
||||||
|
self.cmd_file = '.jdbrc'
|
||||||
|
self.no_quit_confirm = true
|
||||||
|
self.silent_command = {}
|
||||||
|
self.postprocess_command = postprocess_command
|
||||||
|
end
|
||||||
|
|
||||||
|
local GTK = scite_GetProp('PLAT_GTK')
|
||||||
|
|
||||||
|
function Jdb:command_line(target)
|
||||||
|
return 'jdb '..target..' '..self:parameter_string()
|
||||||
|
end
|
||||||
|
|
||||||
|
function Jdb:run_program(out,parms)
|
||||||
|
out:write('run\n')
|
||||||
|
end
|
||||||
|
|
||||||
|
function Jdb:dump_breakpoints(out)
|
||||||
|
for b in Breakpoints() do
|
||||||
|
out:write('stop at '..filename(b.file)..':'..b.line..'\n')
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
function Jdb:clear_breakpoint(file,line,num)
|
||||||
|
if file then
|
||||||
|
dbg_command('clear',filename(file)..':'..line)
|
||||||
|
else
|
||||||
|
print ('no breakpoint at '..file..':'..line)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
function Jdb:backtrace(count)
|
||||||
|
dbg_command('where')
|
||||||
|
end
|
||||||
|
|
||||||
|
function Jdb:finish()
|
||||||
|
dbg_command('step up')
|
||||||
|
end
|
||||||
|
|
||||||
|
function Jdb:locals()
|
||||||
|
dbg_command('locals')
|
||||||
|
end
|
||||||
|
|
||||||
|
function Jdb:watch(word)
|
||||||
|
dbg_command('monitor print',word)
|
||||||
|
end
|
||||||
|
|
||||||
|
function Jdb:set_breakpoint(file,lno)
|
||||||
|
dbg_command('stop at',filename(file)..':'..lno)
|
||||||
|
end
|
||||||
|
|
||||||
|
-- a little hack necessary....
|
||||||
|
function Jdb:find_execution_break(line)
|
||||||
|
local _,method,lineno,file
|
||||||
|
-- get the classname from 'classname.method()'
|
||||||
|
_,_,method,lineno = find(line,'", ([^%(]+)%(%), line=(%d+)')
|
||||||
|
if _ then
|
||||||
|
-- we get file from the classname - everything up to '.'
|
||||||
|
local klass = filename(method)
|
||||||
|
if not klass then return nil end
|
||||||
|
file = klass..'.java'
|
||||||
|
return file,lineno
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
function Jdb:detect_program_end(line)
|
||||||
|
return find(line,'^The application exited')
|
||||||
|
end
|
||||||
|
|
||||||
|
function Jdb:detect_program_crash(line)
|
||||||
|
return find(line,'^Uncaught exception. Entering post mortem debugging')
|
||||||
|
end
|
||||||
|
|
||||||
|
register_debugger('jdb','java',Jdb)
|
|
@ -0,0 +1,244 @@
|
||||||
|
-- GDB-style interface to clidebug
|
||||||
|
scite_require 'gdb.lua'
|
||||||
|
local find = string.find
|
||||||
|
local match = string.match
|
||||||
|
local push = table.insert
|
||||||
|
local pop = table.remove
|
||||||
|
local esc = string.char(26)
|
||||||
|
local gprefix = esc..esc
|
||||||
|
--local ferr = io.stderr
|
||||||
|
|
||||||
|
local GTK = scite_GetProp('PLAT_GTK')
|
||||||
|
|
||||||
|
-- the convention with cli debug is that all Windows filenames are lowercase!
|
||||||
|
local function canonical(file)
|
||||||
|
if not GTK then file = file:lower() end
|
||||||
|
return file
|
||||||
|
end
|
||||||
|
|
||||||
|
local function fpath(file)
|
||||||
|
return canonical(fullpath(file))
|
||||||
|
end
|
||||||
|
|
||||||
|
function slashify(s)
|
||||||
|
return s:gsub('\\','\\\\')
|
||||||
|
end
|
||||||
|
|
||||||
|
local function file_is_lua (file)
|
||||||
|
return extension_of(file) == 'lua'
|
||||||
|
end
|
||||||
|
|
||||||
|
local info_line_success = '^Line %d+ of'
|
||||||
|
local info_line_error = '^No line number information available'
|
||||||
|
|
||||||
|
function info_line_handler(line,dbg)
|
||||||
|
local success = line:find(info_line_success)
|
||||||
|
if success then -- we can set a break command
|
||||||
|
--dbg:queue_command('tbreak *'..dbg.addr)
|
||||||
|
spawner_command('tbreak *'..dbg.addr)
|
||||||
|
dbg.addresses[dbg.addr] = true
|
||||||
|
end
|
||||||
|
-- either way, we want to get out of GDB mode at the earliest opportunity!
|
||||||
|
--dbg:queue_command 'continue'
|
||||||
|
spawner_command('continue')
|
||||||
|
end
|
||||||
|
|
||||||
|
LGdb = class(Gdb)
|
||||||
|
|
||||||
|
function LGdb.discriminator(target)
|
||||||
|
local res = find(target,'^:gdb') == 1
|
||||||
|
return res
|
||||||
|
end
|
||||||
|
|
||||||
|
function LGdb:init (root)
|
||||||
|
Gdb.init(self,root)
|
||||||
|
self.root = root
|
||||||
|
self.target_dir = canonical(props['FileDir'])
|
||||||
|
self.no_target_ext = false
|
||||||
|
-- this is added to the package.path of the Lua program
|
||||||
|
print(extman_Path())
|
||||||
|
self.clidebug_path = scite_GetProp('clidebug.path',join(extman_Path(),'lua_clidebugger'))
|
||||||
|
self.clidebug_debugger = canonical(join(self.clidebug_path,'debugger.lua'))
|
||||||
|
|
||||||
|
-- self.no_quit_confirm = true
|
||||||
|
self.skip_system_extension = ".lua"
|
||||||
|
self.deferred_stack = {}
|
||||||
|
|
||||||
|
self.postprocess_command['info line'] = {pattern=info_line_success,
|
||||||
|
action=info_line_handler, alt_pat=info_line_error}
|
||||||
|
|
||||||
|
self.addresses = {}
|
||||||
|
self.mode = 'gdb'
|
||||||
|
|
||||||
|
-- GDB likes forward slashes, on both platforms...
|
||||||
|
local dbgl_file = join(self.clidebug_path,"dbgl.c"):gsub('\\','/')
|
||||||
|
|
||||||
|
-- this is a persistent event handler which monitors every program break,
|
||||||
|
-- and keeps track of whether we are in GDB or clidebug. Will raise
|
||||||
|
-- the events 'gdb' and 'lua' accordingly.
|
||||||
|
self:set_event('break',function(file,line)
|
||||||
|
local new_mode
|
||||||
|
local lf = file_is_lua(file)
|
||||||
|
-- don't respond to any breaks in dbgl.c
|
||||||
|
if not lf and file == dbgl_file then
|
||||||
|
return true,true
|
||||||
|
end
|
||||||
|
if self.mode ~= 'lua' and lf then
|
||||||
|
new_mode = 'lua'
|
||||||
|
end
|
||||||
|
if self.mode == 'lua' and not lf then
|
||||||
|
new_mode = 'gdb'
|
||||||
|
end
|
||||||
|
if new_mode then
|
||||||
|
self.mode = new_mode
|
||||||
|
self:raise_event(new_mode)
|
||||||
|
end
|
||||||
|
return true
|
||||||
|
end)
|
||||||
|
|
||||||
|
end
|
||||||
|
|
||||||
|
function LGdb:check_breakpoint (b)
|
||||||
|
return not file_is_lua(b.file)
|
||||||
|
end
|
||||||
|
|
||||||
|
function LGdb:parameter_string ()
|
||||||
|
local parms = Gdb.parameter_string(self)
|
||||||
|
-- we have to modify the package path and cpath for this process so that
|
||||||
|
-- the clidebug and dbgl packages are visible.
|
||||||
|
local so = choose(GTK,'?.so;','?.dll;')
|
||||||
|
local ppath = "'"..slashify(join(self.clidebug_path,'?.lua;')).."'"
|
||||||
|
local cpath = "'"..slashify(join(self.clidebug_path,so)).."'"
|
||||||
|
local p = 'package'
|
||||||
|
local cmdline
|
||||||
|
-- if the target isn't Lua, then we assume it's a program that hosts Lua and that
|
||||||
|
-- there's an explicit clidebug initialization somewhere in a user Lua script.
|
||||||
|
if self.not_lua then
|
||||||
|
cmdline = ''
|
||||||
|
else
|
||||||
|
cmdline = ('-e "%s.path=%s..%s.path; %s.cpath=%s..%s.cpath; GDB=true; WIN=%s" -lclidebug %s'):format(
|
||||||
|
p,ppath,p,p,cpath,p,choose(GTK,'false','true'),self.lua_target)
|
||||||
|
end
|
||||||
|
print('*',cmdline)
|
||||||
|
return cmdline..' '..parms
|
||||||
|
end
|
||||||
|
|
||||||
|
function LGdb:command_line(target)
|
||||||
|
local gtarget,ltarget = target:match('^:gdb;([^;]+);(.*)')
|
||||||
|
self.lua_target = ltarget
|
||||||
|
print('+',gtarget,ltarget)
|
||||||
|
local idx = gtarget:find('%[h%]$')
|
||||||
|
if idx then
|
||||||
|
gtarget = gtarget:sub(1,idx-1)
|
||||||
|
self.not_lua = true
|
||||||
|
end
|
||||||
|
--- we are going to embed a clidebug session inside a GDB session, so it's
|
||||||
|
--- necessary to explicitly create the clidebug.cmd file. This folows the
|
||||||
|
--- sequence in create_existing_breakpoints() in debugger.lua
|
||||||
|
local lua_cmd = join(self.root,'clidebug.cmd')
|
||||||
|
local out = io.open(lua_cmd,'w')
|
||||||
|
for b in Breakpoints() do
|
||||||
|
if file_is_lua(b.file) then
|
||||||
|
out:write('break '..canonical(b.file)..':'..b.line..'\n')
|
||||||
|
end
|
||||||
|
end
|
||||||
|
out:write('rootpath '..self.target_dir..'\n')
|
||||||
|
if not self.not_lua then
|
||||||
|
out:write('run\n')
|
||||||
|
end
|
||||||
|
out:close()
|
||||||
|
return Gdb.command_line(self,gtarget)
|
||||||
|
end
|
||||||
|
|
||||||
|
-- need to put at least one breakpoint into the system, so that we can drop into
|
||||||
|
-- gdb mode when necessary. Under Windows, you definitely do not want a separate
|
||||||
|
-- console window, since we want to capture the result of running clidebug inside GDB.
|
||||||
|
function LGdb:special_debugger_setup(out)
|
||||||
|
Gdb.special_debugger_setup(self,out)
|
||||||
|
if not GTK then
|
||||||
|
out:write('set new-console off\n')
|
||||||
|
end
|
||||||
|
-- a useful command when in C Lua code.
|
||||||
|
out:write[[
|
||||||
|
define lstack
|
||||||
|
p debug_lua_stack($arg0)
|
||||||
|
end
|
||||||
|
]]
|
||||||
|
out:write('directory ',self.clidebug_path,'\n')
|
||||||
|
-- clidebug will use this break to get us into gdb
|
||||||
|
out:write('break dbgl.c:9\n')
|
||||||
|
end
|
||||||
|
|
||||||
|
function LGdb:set_breakpoint(file,lno)
|
||||||
|
local lf = file_is_lua(file)
|
||||||
|
-- clidebug works best with absolute paths
|
||||||
|
if lf then file = fullpath(file) end
|
||||||
|
-- if we are in the wrong mode, then the actual setting of a breakpoint
|
||||||
|
-- needs to happen when we next switch to the correct mode.
|
||||||
|
if (self.mode == 'lua') ~= lf then
|
||||||
|
local function set_break ()
|
||||||
|
Gdb.set_breakpoint(self,file,lno)
|
||||||
|
end
|
||||||
|
if self.mode == 'lua' then
|
||||||
|
spawner_command('debugbreak')
|
||||||
|
self:set_event('break',set_break)
|
||||||
|
self:queue_command 'continue'
|
||||||
|
else
|
||||||
|
self:set_event('lua',set_break)
|
||||||
|
end
|
||||||
|
else
|
||||||
|
Gdb.set_breakpoint(self,file,lno)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
function LGdb:goto_file_line(file,line)
|
||||||
|
ProcessOutput(gprefix..self.target_dir..'/'..file..":"..line..'\n')
|
||||||
|
end
|
||||||
|
|
||||||
|
-- there is some clidebugger hackery going on here. It will put us into its own version of debug.stacktrace,
|
||||||
|
-- and we need to put the program into frame #3, which is where the wobby originally happened. The usual Lua
|
||||||
|
-- error message is put out by the 'Message: ' line, which we use to capture the file:line needed to jump to.
|
||||||
|
-- The jumping is achieved by pushing the correct break pattern back into the input above (there must be
|
||||||
|
-- a more elegant way of doing this!)
|
||||||
|
local fmsg,lmsg
|
||||||
|
|
||||||
|
function LGdb:find_execution_break(line)
|
||||||
|
local _,_,file,lineno = find(line,self.break_line)
|
||||||
|
if _ then
|
||||||
|
-- has our program thrown a wobbly in Lua?
|
||||||
|
if file == self.clidebug_debugger and fmsg then
|
||||||
|
self:frame(3)
|
||||||
|
return fmsg,lmsg,true
|
||||||
|
else
|
||||||
|
return file,lineno
|
||||||
|
end
|
||||||
|
else
|
||||||
|
fmsg,lmsg = match(line,'Message: (%S+):(%d+)')
|
||||||
|
if fmsg then return end
|
||||||
|
-- clidebug emits this pattern when Lua is entering a C function
|
||||||
|
-- we have to check whether this function has any debug symbols
|
||||||
|
-- before trying to step into it.
|
||||||
|
local addr = match(line,'//@//%s(.+)')
|
||||||
|
if addr then
|
||||||
|
self.addr = strip_eol(addr)
|
||||||
|
-- at this point, we have entered GDB at debug_break (forced by clidebug)
|
||||||
|
local cached = self.addresses[self.addr]
|
||||||
|
if cached == nil then
|
||||||
|
-- haven't met this function before; check for line info.
|
||||||
|
self:set_event('break',function()
|
||||||
|
dbg_command('info line','*'..self.addr)
|
||||||
|
-- info_line_handler() above will process the output...
|
||||||
|
end)
|
||||||
|
elseif cached == true then
|
||||||
|
--we know this function has line numbers defined
|
||||||
|
self:set_event('break',function()
|
||||||
|
self:queue_command('tbreak *'..self.addr)
|
||||||
|
self:queue_command('continue')
|
||||||
|
end)
|
||||||
|
end
|
||||||
|
return
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
register_debugger('luagdb','lua',LGdb)
|
|
@ -0,0 +1,101 @@
|
||||||
|
if not scite_GetProp('PLAT_GTK') then return end
|
||||||
|
|
||||||
|
scite_require 'debugger.lua'
|
||||||
|
local find = string.find
|
||||||
|
local sub = string.sub
|
||||||
|
|
||||||
|
local bt_pattern = '^[>%s] ([^%(]+)%((%d+)%)'
|
||||||
|
|
||||||
|
function bt_process(s)
|
||||||
|
print(s)
|
||||||
|
end
|
||||||
|
|
||||||
|
local p_pattern = '.*'
|
||||||
|
|
||||||
|
function print_process(s,dbg)
|
||||||
|
if not find(s,'^ERROR:') then
|
||||||
|
display(dbg.last_arg.." = "..s)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
-- special actions for commands which require postprocessing
|
||||||
|
local postprocess_command = {
|
||||||
|
-- backtrace = {pattern=bt_pattern,action=bt_process},
|
||||||
|
p = {pattern=p_pattern, action=print_process, single_pattern=true},
|
||||||
|
}
|
||||||
|
|
||||||
|
Mdb = class(Dbg)
|
||||||
|
|
||||||
|
function Mdb:init(root)
|
||||||
|
self.prompt = '(mdb)'
|
||||||
|
-- this means that the prompt doesn't have a line feed and will be only pulled
|
||||||
|
-- in after the next comand
|
||||||
|
self.trailing_prompt = true
|
||||||
|
self.no_target_ext = true
|
||||||
|
self.cmd_file = root..'/mdb.cmd'
|
||||||
|
self.no_target_ext = 'exe'
|
||||||
|
-- two patterns we use to extract break position; regular
|
||||||
|
-- execution break and moving to a specified frame
|
||||||
|
self.file_line_pattern = ' at (/[^:]+):(%d+)'
|
||||||
|
self.break1 = '^Thread @%d+ .*'..self.file_line_pattern
|
||||||
|
self.break2 = '^#%d+: .*'..self.file_line_pattern
|
||||||
|
self.silent_command = {}
|
||||||
|
self.postprocess_command = postprocess_command
|
||||||
|
self.launched = false
|
||||||
|
end
|
||||||
|
|
||||||
|
function Mdb:find_execution_break(line)
|
||||||
|
local _,file,lineno
|
||||||
|
-- regular execution break pattern
|
||||||
|
_,_,file,lineno = find(line,self.break1)
|
||||||
|
if _ then
|
||||||
|
-- this hack makes us keep going until we get the actual exception
|
||||||
|
if find(line,'^Thread @%d+ received signal 11 at ') then
|
||||||
|
spawner_command('continue')
|
||||||
|
else
|
||||||
|
return file,lineno
|
||||||
|
end
|
||||||
|
end
|
||||||
|
-- pattern for recognizing frame change line
|
||||||
|
_,_,file,lineno = find(line,self.break2)
|
||||||
|
if dbg_last_command() == 'backtrace' then return nil end
|
||||||
|
if _ then return file,lineno end
|
||||||
|
end
|
||||||
|
|
||||||
|
function Mdb:command_line(target)
|
||||||
|
--~ return 'mdb -script '..self.cmd_file..' -f '..target
|
||||||
|
return 'mdb -f '..target
|
||||||
|
end
|
||||||
|
|
||||||
|
-- these are almost but not the same as gdb; mdb just has to be different.
|
||||||
|
function Mdb:backtrace(count)
|
||||||
|
dbg_command('backtrace','-max '..count)
|
||||||
|
end
|
||||||
|
|
||||||
|
function Dbg:frame(f)
|
||||||
|
dbg_command('frame','-frame '..f)
|
||||||
|
end
|
||||||
|
|
||||||
|
function Mdb:detect_program_end(line)
|
||||||
|
-- an opportunity to check if the debugger is launched and ready!
|
||||||
|
-- we do this because mdb won't allow a command file on the
|
||||||
|
-- command line.
|
||||||
|
if not self.launched and find(line,'^Mono Debugger') then
|
||||||
|
self.launched = true
|
||||||
|
local cf = io.open(self.cmd_file,'r')
|
||||||
|
for line in cf:lines() do
|
||||||
|
spawner_command(line)
|
||||||
|
end
|
||||||
|
cf:close()
|
||||||
|
end
|
||||||
|
-- this is better than 'Process..ended'
|
||||||
|
local res = find(line,'Target exited%.') or find(line,'(mdb) Target exited%.')
|
||||||
|
return res,false
|
||||||
|
end
|
||||||
|
|
||||||
|
function Mdb:detect_program_crash(line)
|
||||||
|
--~ return find(line,'^Thread @%d+ received signal %d+ at')
|
||||||
|
return find(line,'^Unhandled Exception: ')
|
||||||
|
end
|
||||||
|
|
||||||
|
register_debugger('mdb',{'cs','exe'},Mdb)
|
|
@ -0,0 +1,5 @@
|
||||||
|
set prompt (GDB)\n
|
||||||
|
set height 0
|
||||||
|
set breakpoint pending on
|
||||||
|
set new-console on
|
||||||
|
run
|
|
@ -0,0 +1,96 @@
|
||||||
|
scite_require 'debugger.lua'
|
||||||
|
local find = string.find
|
||||||
|
local sub = string.sub
|
||||||
|
local GTK = scite_GetProp('PLAT_GTK')
|
||||||
|
|
||||||
|
-- there are several Windows oddities which we have to work around. The spawner will
|
||||||
|
-- only do python if the -i flag is supplied. Because of bad stderr/stdout synchronization,
|
||||||
|
-- the line break pattern can actually get split up, so we use a win32-specific pattern.
|
||||||
|
local exec_break_pattern
|
||||||
|
local flag
|
||||||
|
|
||||||
|
if GTK then
|
||||||
|
exec_break_pattern = '^> ([^%(]+)%((%d+)%)'
|
||||||
|
flag = ''
|
||||||
|
else
|
||||||
|
exec_break_pattern = '(%a:[^%(]+)%((%d+)%)'
|
||||||
|
flag = '-i '
|
||||||
|
end
|
||||||
|
|
||||||
|
local where_pattern = '^[>%s] ([^%(]+)%((%d+)%)'
|
||||||
|
|
||||||
|
function where_process(s)
|
||||||
|
print(s)
|
||||||
|
end
|
||||||
|
|
||||||
|
local p_pattern = '.*'
|
||||||
|
|
||||||
|
function p_process(s,dbg)
|
||||||
|
if sub(s,1,3) ~= '***' then
|
||||||
|
display(dbg.last_arg.." = "..s)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
-- special actions for commands which require postprocessing
|
||||||
|
local postprocess_command = {
|
||||||
|
where = {pattern=where_pattern,action=where_process},
|
||||||
|
p = {pattern=p_pattern, action=p_process, single_pattern=true},
|
||||||
|
}
|
||||||
|
|
||||||
|
Pydb = class(Dbg)
|
||||||
|
|
||||||
|
function Pydb:init(root)
|
||||||
|
self.prompt = '(PDB)'
|
||||||
|
self.no_target_ext = false
|
||||||
|
self.cmd_file = '.pdbrc'
|
||||||
|
self.no_quit_confirm = true
|
||||||
|
self.skip_system_extension = ".py"
|
||||||
|
self.check_skip_always = true
|
||||||
|
self.xpdb = quote_if_needed(extman_Path()..'/xpdb.py')
|
||||||
|
self.silent_command = {}
|
||||||
|
self.postprocess_command = postprocess_command
|
||||||
|
self.started = false
|
||||||
|
end
|
||||||
|
|
||||||
|
function Pydb:command_line(target)
|
||||||
|
return 'python '..flag..self.xpdb..' '..target..' '..self:parameter_string()
|
||||||
|
end
|
||||||
|
|
||||||
|
function Pydb:run_program(out,parms)
|
||||||
|
end
|
||||||
|
|
||||||
|
function Pydb:backtrace(count)
|
||||||
|
dbg_command('where')
|
||||||
|
end
|
||||||
|
|
||||||
|
function Pydb:inspect(word)
|
||||||
|
dbg_command('p',word)
|
||||||
|
end
|
||||||
|
|
||||||
|
function Dbg:finish()
|
||||||
|
dbg_command('return')
|
||||||
|
end
|
||||||
|
|
||||||
|
function Pydb:find_execution_break(line)
|
||||||
|
local _,_,file,lineno = find(line,exec_break_pattern)
|
||||||
|
if _ and file ~= '<string>' then -- a little hack necessary....
|
||||||
|
-- an attempt to make pydb restart at the first line - why not work? --
|
||||||
|
--~ if not self.started then
|
||||||
|
--~ self.started = true
|
||||||
|
--~ self:continue()
|
||||||
|
--~ end
|
||||||
|
return file,lineno
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
function Pydb:detect_program_end(line)
|
||||||
|
local res = (find(line,'^The program exited') or
|
||||||
|
find(line,'^The program finished and will not be restarted'))
|
||||||
|
return res,true
|
||||||
|
end
|
||||||
|
|
||||||
|
function Pydb:detect_program_crash(line)
|
||||||
|
return find(line,'^Uncaught exception. Entering post mortem debugging')
|
||||||
|
end
|
||||||
|
|
||||||
|
register_debugger('pygdb','py',Pydb)
|
|
@ -0,0 +1,131 @@
|
||||||
|
scite_require 'debugger.lua'
|
||||||
|
local find = string.find
|
||||||
|
local sub = string.sub
|
||||||
|
local GTK = scite_GetProp('PLAT_GTK')
|
||||||
|
|
||||||
|
local p_pattern = '^= '
|
||||||
|
|
||||||
|
local function print_process(s,dbg)
|
||||||
|
s = s:sub(3)
|
||||||
|
display(dbg.last_arg..' = '..s)
|
||||||
|
end
|
||||||
|
|
||||||
|
-- special actions for commands which require postprocessing
|
||||||
|
local postprocess_command = {
|
||||||
|
eval = {pattern=p_pattern, action=print_process, single_pattern=true},
|
||||||
|
}
|
||||||
|
|
||||||
|
Remdebug = class(Dbg)
|
||||||
|
|
||||||
|
-- RemDebug is now only used for _remote connections_ if Clidebug is also registered!
|
||||||
|
function Remdebug.discriminator(target)
|
||||||
|
return find(target,':') == 1
|
||||||
|
end
|
||||||
|
|
||||||
|
function Remdebug:init(root)
|
||||||
|
self.prompt = 'DBG'
|
||||||
|
self.no_target_ext = false
|
||||||
|
self.cmd_file = root..'/dbg.cmd'
|
||||||
|
self.detect_start = '^Run the program you wish to debug'
|
||||||
|
-- find out where the Lua executable is; you can use the debug.lua property if it isn't the same
|
||||||
|
-- as your lua executable specified in lua.properties.
|
||||||
|
self.lua = scite_GetProp("debug.lua")
|
||||||
|
if not self.lua then
|
||||||
|
self.lua = scite_GetProp('command.go.*.lua'):match('^(%w+)')
|
||||||
|
end
|
||||||
|
-- this is added to the package.path of the Lua program
|
||||||
|
self.remdebug_path = scite_GetProp('remdebug.path',extman_Path()..'/remDebug')
|
||||||
|
self.no_quit_confirm = true
|
||||||
|
local drive = '';
|
||||||
|
if not GTK then drive = '[a-zA-Z]:' end
|
||||||
|
self.break_line = '^Paused at file ('..drive..'/[^%s]+)%sline%s(%d+)'
|
||||||
|
self.silent_command = {}
|
||||||
|
self.postprocess_command = postprocess_command
|
||||||
|
end
|
||||||
|
|
||||||
|
local function backslash(path)
|
||||||
|
return path:gsub('\\','/')
|
||||||
|
end
|
||||||
|
|
||||||
|
function Remdebug:handle_debug_start()
|
||||||
|
if not self.target:find('^:remote') then
|
||||||
|
local cmd = self.lua..' -e "package.path=\''..backslash(self.remdebug_path)
|
||||||
|
cmd = cmd..'/?.lua;\'..package.path" -l remdebug '..self.target..' '..self:parameter_string()
|
||||||
|
print(cmd)
|
||||||
|
print 'spawning...'
|
||||||
|
ts = spawner.new(cmd)
|
||||||
|
ts:set_output('trace')
|
||||||
|
ts:run()
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
-- '%s -e "package.path=%s" -l remdebug %s'
|
||||||
|
|
||||||
|
local GTK = scite_GetProp('PLAT_GTK')
|
||||||
|
|
||||||
|
function Remdebug:command_line(target)
|
||||||
|
self.target = target
|
||||||
|
local rpath = self.remdebug_path
|
||||||
|
return self.lua..' -e "_DPROMPT=\'DBG\\n\'" '..rpath..'/controller.lua '..self.cmd_file
|
||||||
|
end
|
||||||
|
|
||||||
|
function Remdebug:dump_breakpoints(out)
|
||||||
|
for b in Breakpoints() do
|
||||||
|
out:write('setb '..b.file:gsub('\\','/')..' '..b.line..'\n')
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
function Remdebug:run_program(out,parms)
|
||||||
|
out:write('run\n')
|
||||||
|
end
|
||||||
|
|
||||||
|
function Remdebug:step()
|
||||||
|
dbg_command('step')
|
||||||
|
end
|
||||||
|
|
||||||
|
function Remdebug:step_over()
|
||||||
|
dbg_command('over')
|
||||||
|
end
|
||||||
|
|
||||||
|
function Remdebug:continue()
|
||||||
|
dbg_command('run')
|
||||||
|
end
|
||||||
|
|
||||||
|
function Remdebug:quit()
|
||||||
|
dbg_command('exec os.exit(0)')
|
||||||
|
end
|
||||||
|
|
||||||
|
function Remdebug:inspect(word)
|
||||||
|
dbg_command('eval',word)
|
||||||
|
end
|
||||||
|
|
||||||
|
function Remdebug:set_breakpoint(file,lno)
|
||||||
|
dbg_command('setb',file..' '..lno)
|
||||||
|
end
|
||||||
|
|
||||||
|
function Remdebug:clear_breakpoint(file,line,num)
|
||||||
|
if file then
|
||||||
|
-- this function will only pass us the filename part, not the path!
|
||||||
|
dbg_command('delb',fullpath(file)..' '..line)
|
||||||
|
else
|
||||||
|
print ('no breakpoint at '..file..':'..line)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
|
function Remdebug:backtrace(count)
|
||||||
|
end
|
||||||
|
|
||||||
|
function Remdebug:finish()
|
||||||
|
|
||||||
|
end
|
||||||
|
|
||||||
|
function Remdebug:locals()
|
||||||
|
dbg_command('locals')
|
||||||
|
end
|
||||||
|
|
||||||
|
function Remdebug:detect_program_end(line)
|
||||||
|
return find(line,'^Program finished')
|
||||||
|
end
|
||||||
|
|
||||||
|
register_debugger('remdebug','lua',Remdebug)
|
|
@ -0,0 +1,444 @@
|
||||||
|
-- extlib.lua
|
||||||
|
-- a useful set of SciTE Lua functions
|
||||||
|
scite_require 'class.lua'
|
||||||
|
local sub = string.sub
|
||||||
|
local append = table.insert
|
||||||
|
local find = string.find
|
||||||
|
|
||||||
|
local colours = {red = "#FF0000", blue = '#0000FF', green = '#00FF00',pink ="#FFAAAA" ,
|
||||||
|
black = '#000000', lightblue = '#AAAAFF',lightgreen = '#AAFFAA'}
|
||||||
|
local indicator_masks = {[0] = INDIC0_MASK, [1] = INDIC1_MASK, [2] = INDIC2_MASK}
|
||||||
|
WORD_PATTERN = "[a-zA-Z0-9_]"
|
||||||
|
NOT_WORD_PATTERN = "[^a-zA-Z0-9_]"
|
||||||
|
|
||||||
|
local GTK = scite_GetProp('PLAT_GTK')
|
||||||
|
local dirsep
|
||||||
|
if GTK then
|
||||||
|
dirsep = '/'
|
||||||
|
else
|
||||||
|
dirsep = '\\'
|
||||||
|
end
|
||||||
|
|
||||||
|
function join(path,part1,part2)
|
||||||
|
local res = path..dirsep..part1
|
||||||
|
if part2 then return res..dirsep..part2 else return res end
|
||||||
|
end
|
||||||
|
|
||||||
|
function fullpath(file)
|
||||||
|
return props['FileDir']..dirsep..file
|
||||||
|
end
|
||||||
|
|
||||||
|
function choose(cond,x,y)
|
||||||
|
if cond then return x else return y end
|
||||||
|
end
|
||||||
|
|
||||||
|
function split(s,re)
|
||||||
|
local i1 = 1
|
||||||
|
local sz = #s
|
||||||
|
local ls = {}
|
||||||
|
while true do
|
||||||
|
local i2,i3 = s:find(re,i1)
|
||||||
|
if not i2 then
|
||||||
|
append(ls,s:sub(i1))
|
||||||
|
return ls
|
||||||
|
end
|
||||||
|
append(ls,s:sub(i1,i2-1))
|
||||||
|
i1 = i3+1
|
||||||
|
if i1 >= sz then return ls end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
function split_list(s)
|
||||||
|
return split(s,'[%s,]+')
|
||||||
|
end
|
||||||
|
|
||||||
|
local function at (s,i)
|
||||||
|
return s:sub(i,i)
|
||||||
|
end
|
||||||
|
|
||||||
|
--- note: for finding the last occurance of a character, it's actualy
|
||||||
|
--- easier to do it in an explicit loop rather than use patterns.
|
||||||
|
--- (These are not time-critcal functions)
|
||||||
|
local function split_last (s,ch)
|
||||||
|
local i = #s
|
||||||
|
while i > 0 do
|
||||||
|
if at(s,i) == ch then
|
||||||
|
return s:sub(i+1),i
|
||||||
|
end
|
||||||
|
i = i - 1
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
function basename(s)
|
||||||
|
local res = split_last(s,dirsep)
|
||||||
|
if res then return res else return s end
|
||||||
|
end
|
||||||
|
|
||||||
|
function path_of (s)
|
||||||
|
local basename,idx = split_last(s,dirsep)
|
||||||
|
if idx then
|
||||||
|
return s:sub(1,idx-1)
|
||||||
|
else
|
||||||
|
return ''
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
function extension_of (s)
|
||||||
|
return split_last(s,'.')
|
||||||
|
end
|
||||||
|
|
||||||
|
function filename(path)
|
||||||
|
local fname = basename(path)
|
||||||
|
local _,idx = split_last(fname,'.')
|
||||||
|
if idx then return fname:sub(1,idx-1) else return fname end
|
||||||
|
end
|
||||||
|
|
||||||
|
function strip_eol(s)
|
||||||
|
if at(s,-1) == '\n' then
|
||||||
|
if at(s,-2) == '\r' then
|
||||||
|
return s:sub(1,-3)
|
||||||
|
else
|
||||||
|
return s:sub(1,-2)
|
||||||
|
end
|
||||||
|
else
|
||||||
|
return s
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
|
function rtrim(s)
|
||||||
|
return string.gsub(s,'%s*$','')
|
||||||
|
end
|
||||||
|
|
||||||
|
--line information functions --
|
||||||
|
|
||||||
|
function current_line()
|
||||||
|
return editor:LineFromPosition(editor.CurrentPos)
|
||||||
|
end
|
||||||
|
|
||||||
|
function current_output_line()
|
||||||
|
return output:LineFromPosition(output.CurrentPos)
|
||||||
|
end
|
||||||
|
|
||||||
|
function current_pos()
|
||||||
|
return editor.CurrentPos
|
||||||
|
end
|
||||||
|
|
||||||
|
-- start position of the given line; defaults to start of current line
|
||||||
|
function start_line_position(line)
|
||||||
|
if not line then line = current_line() end
|
||||||
|
return editor.LineEndPosition[line]
|
||||||
|
end
|
||||||
|
|
||||||
|
-- what is the word directly behind the cursor?
|
||||||
|
-- returns the word and its position.
|
||||||
|
function word_at_cursor()
|
||||||
|
local pos = editor.CurrentPos
|
||||||
|
local line_start = start_line_position()
|
||||||
|
-- look backwards to find the first non-word character!
|
||||||
|
local p1,p2 = editor:findtext(NOT_WORD_PATTERN,SCFIND_REGEXP,pos,line_start)
|
||||||
|
if p1 then
|
||||||
|
return editor:textrange(p2,pos),p2
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
-- this centers the cursor position
|
||||||
|
-- easy enough to make it optional!
|
||||||
|
function center_line(line)
|
||||||
|
if not line then line = current_line() end
|
||||||
|
local top = editor.FirstVisibleLine
|
||||||
|
local middle = top + editor.LinesOnScreen/2
|
||||||
|
editor:LineScroll(0,line - middle)
|
||||||
|
end
|
||||||
|
|
||||||
|
--general useful routines--
|
||||||
|
|
||||||
|
-- returns the character at position p as a string
|
||||||
|
function char_at(p)
|
||||||
|
return string.char(editor.CharAt[p])
|
||||||
|
end
|
||||||
|
|
||||||
|
-- allows you to use standard HTML '#RRGGBB' colours; there are also a few predefined colours available.
|
||||||
|
function colour_parse(str)
|
||||||
|
if sub(str,1,1) ~= '#' then
|
||||||
|
str = colours[str]
|
||||||
|
end
|
||||||
|
return tonumber(sub(str,6,7)..sub(str,4,5)..sub(str,2,4),16)
|
||||||
|
end
|
||||||
|
|
||||||
|
function expand_string(subst)
|
||||||
|
return string.gsub(subst,'%$%(([%w_]+)%)',function(arg)
|
||||||
|
local repl = props[arg]
|
||||||
|
return repl
|
||||||
|
end)
|
||||||
|
end
|
||||||
|
|
||||||
|
-- indicators --
|
||||||
|
-- INDIC_PLAIN Underlined with a single, straight line.
|
||||||
|
-- INDIC_SQUIGGLE A squiggly underline.
|
||||||
|
-- INDIC_TT A line of small T shapes.
|
||||||
|
-- INDIC_DIAGONAL Diagonal hatching.
|
||||||
|
-- INDIC_STRIKE Strike out.
|
||||||
|
-- INDIC_HIDDEN An indicator with no visual effect.
|
||||||
|
-- INDIC_BOX A rectangle around the text.
|
||||||
|
|
||||||
|
local function indicator_mask(ind)
|
||||||
|
return indicator_masks[ind]
|
||||||
|
end
|
||||||
|
|
||||||
|
-- this is the default situation: first 5 bits are for lexical styling
|
||||||
|
local style_mask = 31
|
||||||
|
|
||||||
|
-- get the lexical style at position p, without indicator bits!
|
||||||
|
function style_at(p)
|
||||||
|
return math.mod(editor.StyleAt[p],32)
|
||||||
|
end
|
||||||
|
|
||||||
|
-- define a given indicator's type and foreground colour
|
||||||
|
Indicator = class(function(self,which,typ,colour)
|
||||||
|
editor.IndicStyle[which] = typ
|
||||||
|
if colour then
|
||||||
|
editor.IndicFore[which] = colour_parse(colour)
|
||||||
|
end
|
||||||
|
self.ind = which
|
||||||
|
end)
|
||||||
|
|
||||||
|
-- set the given indicator ind between pos and endp inclusive
|
||||||
|
-- (the val arg is only used by indicator_clear)
|
||||||
|
function Indicator:set(pos,endp,val)
|
||||||
|
local es = editor.EndStyled
|
||||||
|
local mask = indicator_mask(self.ind)
|
||||||
|
if not val then
|
||||||
|
val = mask
|
||||||
|
end
|
||||||
|
editor:StartStyling(pos,mask)
|
||||||
|
editor:SetStyling(endp-pos,val)
|
||||||
|
editor:StartStyling(es,style_mask)
|
||||||
|
end
|
||||||
|
|
||||||
|
-- clear an indicator ind between pos and endp
|
||||||
|
function Indicator:clear(ind,pos,endp)
|
||||||
|
self:set(pos,endp,0)
|
||||||
|
end
|
||||||
|
|
||||||
|
-- find the next position which has indicator ind
|
||||||
|
-- (won't handle overlapping indicators!)
|
||||||
|
function Indicator:find(pos)
|
||||||
|
if not pos then pos = editor.CurrentPos end
|
||||||
|
local endp = editor.Length
|
||||||
|
local mask = indicator_mask(self.ind)
|
||||||
|
while pos ~= endp do
|
||||||
|
local style = editor.StyleAt[pos]
|
||||||
|
if style > style_mask then -- there are indicators!
|
||||||
|
-- but is the particular bit set?
|
||||||
|
local diff = style - mask
|
||||||
|
if diff >= 0 and diff < mask then
|
||||||
|
return pos
|
||||||
|
end
|
||||||
|
end
|
||||||
|
pos = pos + 1
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
-- markers --
|
||||||
|
|
||||||
|
Marker = class(function(self,idx,line,file)
|
||||||
|
buffer = scite_CurrentFile()
|
||||||
|
if not file then file = buffer end
|
||||||
|
self.idx = idx
|
||||||
|
self.file = file
|
||||||
|
self.line = line
|
||||||
|
if file == buffer then
|
||||||
|
self:create()
|
||||||
|
else
|
||||||
|
self.state = 'waiting'
|
||||||
|
end
|
||||||
|
end)
|
||||||
|
|
||||||
|
function Marker:create()
|
||||||
|
self.handle = editor:MarkerAdd(self.line-1,self.idx)
|
||||||
|
if self.handle == -1 then
|
||||||
|
self.state = 'dud'
|
||||||
|
if self.type then self:cannot_create(self.file,self.line) end
|
||||||
|
else
|
||||||
|
self.state = 'created'
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
function Marker:delete()
|
||||||
|
if self.file ~= scite_CurrentFile() then -- not the correct buffer!
|
||||||
|
self.state = 'expired'
|
||||||
|
else
|
||||||
|
editor:MarkerDelete(self.line-1,self.idx)
|
||||||
|
if self.type then self.type:remove(self) end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
function Marker:goto(centre)
|
||||||
|
editor:GotoLine(self.line-1)
|
||||||
|
if centre then center_line() end
|
||||||
|
end
|
||||||
|
|
||||||
|
function Marker:update_line()
|
||||||
|
self.line = editor:MarkerLineFromHandle(self.handle)+1
|
||||||
|
end
|
||||||
|
|
||||||
|
MarkerType = class(function(self,idx,typ,fore,back)
|
||||||
|
if typ then editor:MarkerDefine(idx,typ) end
|
||||||
|
if fore then editor:MarkerSetFore(idx,colour_parse(fore)) end
|
||||||
|
if back then editor:MarkerSetBack(idx,colour_parse(back)) end
|
||||||
|
self.idx = idx
|
||||||
|
self.markers = create_list()
|
||||||
|
-- there may be 'expired' markers which need to finally die!
|
||||||
|
scite_OnSwitchFile(function(f)
|
||||||
|
local ls = create_list()
|
||||||
|
for m in self:for_file() do
|
||||||
|
if m.state == 'expired' or m.state == 'dud' then
|
||||||
|
ls:append(m)
|
||||||
|
end
|
||||||
|
if m.state == 'waiting' then
|
||||||
|
m:create()
|
||||||
|
end
|
||||||
|
end
|
||||||
|
for m in ls:iter() do
|
||||||
|
m:delete()
|
||||||
|
end
|
||||||
|
end)
|
||||||
|
-- when a file is saved, we update any markers associated with it.
|
||||||
|
scite_OnSave(function(f)
|
||||||
|
local changed = false
|
||||||
|
for m in self:for_file() do
|
||||||
|
local lline = m.line
|
||||||
|
m:update_line()
|
||||||
|
changed = changed or lline ~= m.line
|
||||||
|
end
|
||||||
|
if changed then
|
||||||
|
self:has_changed('moved')
|
||||||
|
end
|
||||||
|
end)
|
||||||
|
end)
|
||||||
|
|
||||||
|
function MarkerType:has_changed(how)
|
||||||
|
if self.on_changed then
|
||||||
|
self:on_changed(how)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
function MarkerType:cannot_create(file,line)
|
||||||
|
print('error:',file,line)
|
||||||
|
end
|
||||||
|
|
||||||
|
function MarkerType:create(line,file)
|
||||||
|
local m = Marker(self.idx,line,file)
|
||||||
|
self.markers:append(m)
|
||||||
|
m.type = self
|
||||||
|
self:has_changed('create')
|
||||||
|
return m
|
||||||
|
end
|
||||||
|
|
||||||
|
function MarkerType:remove(marker)
|
||||||
|
if self.markers:remove(marker) then
|
||||||
|
self:has_changed('remove')
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
-- return an iterator for all markers defined in this file
|
||||||
|
-- (see PiL, 7.1)
|
||||||
|
function MarkerType:for_file(fname)
|
||||||
|
if not fname then fname = scite_CurrentFile() end
|
||||||
|
local i = 0
|
||||||
|
local n = table.getn(self.markers)
|
||||||
|
local t = self.markers
|
||||||
|
--~ print(n,t)
|
||||||
|
return function ()
|
||||||
|
i = i + 1
|
||||||
|
while i <= n do
|
||||||
|
--~ print (i,t[i].line)
|
||||||
|
if t[i].file == fname then
|
||||||
|
return t[i]
|
||||||
|
else
|
||||||
|
i = i + 1
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
function MarkerType:iter()
|
||||||
|
return self.markers:iter()
|
||||||
|
end
|
||||||
|
|
||||||
|
function MarkerType:dump()
|
||||||
|
for m in self:iter() do
|
||||||
|
print(m.line,m.file)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
Bookmark = MarkerType(1)
|
||||||
|
|
||||||
|
g = {} -- for globals that don't go away ;)
|
||||||
|
|
||||||
|
-- get the next line following the marker idx
|
||||||
|
-- from the specified line (optional)
|
||||||
|
function MarkerType:next(line)
|
||||||
|
if not line then line = current_line() end
|
||||||
|
local mask = math.pow(2,self.idx)
|
||||||
|
return editor:MarkerNext(line,mask)+1
|
||||||
|
end
|
||||||
|
|
||||||
|
------ Marker management -------
|
||||||
|
local active_cursor_idx = 5
|
||||||
|
local signalled_cursor_idx = 6
|
||||||
|
local breakpoint_idx = 7
|
||||||
|
local active_cursor = nil
|
||||||
|
local signalled_cursor = nil
|
||||||
|
local breakpoint = nil
|
||||||
|
local last_marker = nil
|
||||||
|
local initialized = false
|
||||||
|
|
||||||
|
local function init_breakpoints()
|
||||||
|
if not initialized then
|
||||||
|
active_cursor = MarkerType(active_cursor_idx,SC_MARK_BACKGROUND,nil,props['stdcolor.active'])
|
||||||
|
signalled_cursor = MarkerType(signalled_cursor_idx,SC_MARK_BACKGROUND,nil,props['stdcolor.error'])
|
||||||
|
breakpoint = MarkerType(breakpoint_idx,SC_MARK_ARROW,nil,'red')
|
||||||
|
initialized = true
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
function Breakpoints()
|
||||||
|
init_breakpoints()
|
||||||
|
return breakpoint:iter()
|
||||||
|
end
|
||||||
|
|
||||||
|
function RemoveLastMarker(do_remove)
|
||||||
|
if last_marker then
|
||||||
|
last_marker:delete()
|
||||||
|
end
|
||||||
|
if do_remove then
|
||||||
|
last_marker = nil
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
function OpenAtPos(fname,lineno,how)
|
||||||
|
init_breakpoints()
|
||||||
|
RemoveLastMarker(false)
|
||||||
|
if not last_marker or (last_marker and fname ~= last_marker.file) then
|
||||||
|
scite.Open(fname)
|
||||||
|
end
|
||||||
|
if how == 'active' then
|
||||||
|
last_marker = active_cursor:create(lineno)
|
||||||
|
elseif how == 'error' then
|
||||||
|
last_marker = signalled_cursor:create(lineno)
|
||||||
|
else
|
||||||
|
last_marker = nil
|
||||||
|
end
|
||||||
|
if last_marker then
|
||||||
|
last_marker:goto()
|
||||||
|
else
|
||||||
|
editor:GotoLine(lineno-1)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
function SetBreakMarker(line)
|
||||||
|
init_breakpoints()
|
||||||
|
return breakpoint:create(line)
|
||||||
|
end
|
|
@ -0,0 +1,62 @@
|
||||||
|
-- micromode.lua introduces Sciboo-style 'micro-modes' to SciTE.
|
||||||
|
-- For instance, if your C file begins like this:
|
||||||
|
-- // build@ gcc fred.c alice.o -o fred
|
||||||
|
-- then that will set the property command.build.* to 'gcc fred.c alice.o -o fred'.
|
||||||
|
-- build,compile and go are valid here; otherwise, the name is assumed to be a global Lua
|
||||||
|
-- function. that will handle this build operation
|
||||||
|
-- If the command ends with a single '*', it will be replaced with $(FileNameExt)
|
||||||
|
-- If the command is a valid global Lua function, it will be used instead. So:
|
||||||
|
-- --go@ dofile *
|
||||||
|
-- will mean that a Lua script is to be run using SciTE Lua.
|
||||||
|
|
||||||
|
local propset = {}
|
||||||
|
|
||||||
|
local function check_micro_mode(f)
|
||||||
|
if #propset > 0 then -- very important to keep clearing these guys out!
|
||||||
|
for i,k in ipairs(propset) do
|
||||||
|
props[k] = nil
|
||||||
|
end
|
||||||
|
propset = {}
|
||||||
|
end
|
||||||
|
local line = scite_Line(editor,0)
|
||||||
|
if not line then return end
|
||||||
|
local _,_,p,val = line:find('([a-z]+)@%s+(.+)')
|
||||||
|
if _ then
|
||||||
|
local custom_build, lua_function
|
||||||
|
if p ~= 'build' and p ~= 'compile' and p ~= 'go' then
|
||||||
|
custom_build = p
|
||||||
|
p = 'build'
|
||||||
|
end
|
||||||
|
local prop = 'command.'..p..'.*'
|
||||||
|
if val:sub(1,1) == '$' then -- might have been a property expansion!
|
||||||
|
val = val:sub(3,-2)
|
||||||
|
val = props[val]
|
||||||
|
end
|
||||||
|
if val == "" then return end
|
||||||
|
if val:find('%*$') then
|
||||||
|
val = val:sub(1,-2) .. '$(FileNameExt)'
|
||||||
|
end
|
||||||
|
local cmd = val:match('([%w_]+)')
|
||||||
|
lua_function = cmd and _G[cmd]
|
||||||
|
if not custom_build and not lua_function then
|
||||||
|
props[prop] = val
|
||||||
|
else
|
||||||
|
local subsys
|
||||||
|
-- a Lua function; use the 3 subsystem to evaluate it!
|
||||||
|
if custom_build then
|
||||||
|
props[prop] = custom_build..' '..val
|
||||||
|
subsys = 'command.build.subsystem.*'
|
||||||
|
else
|
||||||
|
props[prop] = val
|
||||||
|
subsys = 'command.go.subsystem.*'
|
||||||
|
end
|
||||||
|
props[subsys] = '3'
|
||||||
|
table.insert(propset,subsys)
|
||||||
|
end
|
||||||
|
table.insert(propset,prop)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
scite_OnOpenSwitch(check_micro_mode)
|
||||||
|
scite_OnSave(check_micro_mode)
|
||||||
|
|
|
@ -0,0 +1,303 @@
|
||||||
|
--creating an Interactive Lua prompt
|
||||||
|
------------------------------- Lua prompt -----------------------
|
||||||
|
scite_require 'switch_buffers.lua'
|
||||||
|
|
||||||
|
scite_Command 'Start Interactive Lua|start_lua_prompt'
|
||||||
|
scite_Command 'Load Lua into Session|load_current_lua_file'
|
||||||
|
|
||||||
|
local lua_p
|
||||||
|
local skipping
|
||||||
|
local lua_interactive
|
||||||
|
local SL_prefix='\01SL\02'
|
||||||
|
|
||||||
|
function OnExit(s)
|
||||||
|
s = tonumber(s)
|
||||||
|
if s ~= 0 then
|
||||||
|
scite.MenuCommand(IDM_NEXTMSG)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
local function write_to_lua(line,skip_output)
|
||||||
|
skipping = skip_output
|
||||||
|
lua_p:write(line..'\n')
|
||||||
|
end
|
||||||
|
|
||||||
|
function eval_lua(line)
|
||||||
|
local f,err = loadstring(line,'local')
|
||||||
|
if not f then
|
||||||
|
scite_Trace(err)
|
||||||
|
else
|
||||||
|
pcall(f)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
function write_output(s)
|
||||||
|
if not skipping then
|
||||||
|
local i1,i2 = s:find(SL_prefix)
|
||||||
|
if i1 == 1 then
|
||||||
|
eval_lua(s:sub(i2+1))
|
||||||
|
else
|
||||||
|
scite_Trace(s)
|
||||||
|
end
|
||||||
|
else
|
||||||
|
skipping = false
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
function edit (f)
|
||||||
|
scite.Open(f)
|
||||||
|
end
|
||||||
|
|
||||||
|
-- the cd() command is special, because it is evaluated both in the Lua session _and_ in SciTE.
|
||||||
|
-- (cmd type 3s are evaluated in both contexts)
|
||||||
|
function cd (path)
|
||||||
|
if path then
|
||||||
|
os.chdir(path)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
local cmds = {
|
||||||
|
cd = 3, dir = 1, edit = 2
|
||||||
|
}
|
||||||
|
|
||||||
|
local function check_command (line)
|
||||||
|
local cmd,rest = line:match('([%w_]+)(.*)')
|
||||||
|
local ctype = cmds[cmd]
|
||||||
|
if ctype then
|
||||||
|
local arg = rest:match('(%S+)')
|
||||||
|
if arg then
|
||||||
|
return cmd..'[['..arg..']]', ctype
|
||||||
|
else
|
||||||
|
return cmd..'()',ctype
|
||||||
|
end
|
||||||
|
else
|
||||||
|
return line,1
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
-- whenever SciTE changes its current directory, make sure that the prompt and SciTE are in sync!
|
||||||
|
scite_OnDirChange(function(dir)
|
||||||
|
if lua_p then
|
||||||
|
write_to_lua(('cd(%q)'):format(dir),true)
|
||||||
|
cd(dir)
|
||||||
|
end
|
||||||
|
end)
|
||||||
|
|
||||||
|
function evaluate_line(line)
|
||||||
|
line,ct = check_command (line)
|
||||||
|
if line == 'quit' then
|
||||||
|
if lua_interactive then
|
||||||
|
write_to_lua 'os.exit()'
|
||||||
|
else
|
||||||
|
write_to_lua 'quit'
|
||||||
|
end
|
||||||
|
print 'goodbye!'
|
||||||
|
scite.MenuCommand(IDM_WRAPOUTPUT)
|
||||||
|
lua_p = nil
|
||||||
|
return true
|
||||||
|
end
|
||||||
|
if ct == 2 or ct == 3 then
|
||||||
|
eval_lua(line)
|
||||||
|
if ct == 2 then scite_Trace '> ' end
|
||||||
|
end
|
||||||
|
if ct == 1 or ct == 3 then
|
||||||
|
write_to_lua(line)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
function start_lua_prompt()
|
||||||
|
if lua_p ~= nil then return end
|
||||||
|
local cmd = props['lua.prompt']
|
||||||
|
lua_interactive = cmd:find('-i',1,true)
|
||||||
|
scite.MenuCommand(IDM_WRAPOUTPUT)
|
||||||
|
lua_p = spawner.new(cmd)
|
||||||
|
lua_p:set_output('write_output')
|
||||||
|
lua_p:run()
|
||||||
|
scite_InteractivePromptHandler('>+ ',evaluate_line)
|
||||||
|
end
|
||||||
|
|
||||||
|
function load_current_lua_file()
|
||||||
|
if lua_p then
|
||||||
|
scite.MenuCommand(IDM_SAVE)
|
||||||
|
write_to_lua('print(pcall(dofile,[['..props['FilePath']..']]))',true)
|
||||||
|
scite.MenuCommand(IDM_SWITCHPANE)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
--- a general interactive prompt engine -----
|
||||||
|
|
||||||
|
local keymap
|
||||||
|
local lines
|
||||||
|
local lines_idx = 1
|
||||||
|
local line_callback
|
||||||
|
local prompt
|
||||||
|
local lastpos = 1
|
||||||
|
|
||||||
|
|
||||||
|
if not GTK then -- see winuser.h
|
||||||
|
keymap = {
|
||||||
|
[40] = SCK_DOWN,
|
||||||
|
[38] = SCK_UP,
|
||||||
|
[37] = SCK_LEFT,
|
||||||
|
[39] = SCK_RIGHT,
|
||||||
|
[36] = SCK_HOME,
|
||||||
|
[35] = SCK_END,
|
||||||
|
[33] = SCK_PRIOR,
|
||||||
|
[34] = SCK_NEXT,
|
||||||
|
[46] = SCK_DELETE,
|
||||||
|
[45] = SCK_INSERT,
|
||||||
|
[0x1B] = SCK_ESCAPE,
|
||||||
|
[8] = SCK_BACK,
|
||||||
|
[9] = SCK_TAB,
|
||||||
|
[13] = SCK_RETURN,
|
||||||
|
[0x6B] = SCK_ADD,
|
||||||
|
[0x6D] = SCK_SUBTRACT,
|
||||||
|
[0x6F] = SCK_DIVIDE,
|
||||||
|
[0x5B] = SCK_WIN,
|
||||||
|
[0x5C] = SCK_RWIN,
|
||||||
|
[18] = SCK_MENU,
|
||||||
|
}
|
||||||
|
else -- see gdk/gdkkeysyms.h
|
||||||
|
keymap = {
|
||||||
|
[0xFF54] = SCK_DOWN,
|
||||||
|
[0xFF52] = SCK_UP,
|
||||||
|
[0xFF51] = SCK_LEFT,
|
||||||
|
[0xFF53] = SCK_RIGHT,
|
||||||
|
[0xFF50] = SCK_HOME,
|
||||||
|
[0xFF57] = SCK_END,
|
||||||
|
[0xFF55] = SCK_PRIOR,
|
||||||
|
[0xFF56] = SCK_NEXT,
|
||||||
|
[0xFFFF] = SCK_DELETE,
|
||||||
|
[0xFF63] = SCK_INSERT,
|
||||||
|
[0xFF1B] = SCK_ESCAPE,
|
||||||
|
[0xFF08] = SCK_BACK,
|
||||||
|
[0xFF09] = SCK_TAB,
|
||||||
|
[0xFF0D] = SCK_RETURN,
|
||||||
|
[0xFFAB] = SCK_ADD,
|
||||||
|
[0xFFAD] = SCK_SUBTRACT,
|
||||||
|
[0xFFAF] = SCK_DIVIDE,
|
||||||
|
[0xFFEB] = SCK_WIN,
|
||||||
|
[0xFFEC] = SCK_RWIN,
|
||||||
|
[0xFF67] = SCK_MENU,
|
||||||
|
}
|
||||||
|
end
|
||||||
|
|
||||||
|
function scite_ConvertToSCK (key)
|
||||||
|
local res = keymap[key]
|
||||||
|
if res then return res else return key end
|
||||||
|
end
|
||||||
|
|
||||||
|
function enable_arrow_keys (yesno)
|
||||||
|
if yesno then
|
||||||
|
output:AssignCmdKey(SCK_TAB,0,SCI_TAB)
|
||||||
|
output:AssignCmdKey(SCK_UP,0,SCI_LINEUP)
|
||||||
|
output:AssignCmdKey(SCK_DOWN,0,SCI_LINEDOWN)
|
||||||
|
else
|
||||||
|
output:AssignCmdKey(SCK_TAB,0,SCI_NULL)
|
||||||
|
output:AssignCmdKey(SCK_UP,0,SCI_NULL)
|
||||||
|
output:AssignCmdKey(SCK_DOWN,0,SCI_NULL)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
function scite_ReplaceLine(pane,l,txt)
|
||||||
|
pane.TargetStart = lastpos --pane:PositionFromLine(l)
|
||||||
|
pane.TargetEnd = pane.LineEndPosition[l]
|
||||||
|
pane:ReplaceTarget(txt)
|
||||||
|
pane:GotoPos(pane.TargetEnd)
|
||||||
|
end
|
||||||
|
|
||||||
|
local function current_line ()
|
||||||
|
return output:LineFromPosition(output.CurrentPos)
|
||||||
|
end
|
||||||
|
|
||||||
|
function replace_current_line (txt)
|
||||||
|
local l = current_line()
|
||||||
|
--~ scite_ReplaceLine(output,l,prompt..txt)
|
||||||
|
scite_ReplaceLine(output,l,txt)
|
||||||
|
end
|
||||||
|
|
||||||
|
local function strip_prompt(line)
|
||||||
|
--~ local i1,i2 = line:find(prompt)
|
||||||
|
--~ if i1 == 1 then
|
||||||
|
--~ line = line:sub(i2+1)
|
||||||
|
--~ end
|
||||||
|
--~ return line
|
||||||
|
local l = current_line()-1
|
||||||
|
local p = output:PositionFromLine(l)
|
||||||
|
local offset = lastpos - p + 1
|
||||||
|
return line:sub(offset)
|
||||||
|
end
|
||||||
|
|
||||||
|
function handle_keys (key)
|
||||||
|
if editor.Focus then return end
|
||||||
|
key = scite_ConvertToSCK(key)
|
||||||
|
local delta
|
||||||
|
if key == SCK_UP then
|
||||||
|
if lines_idx == 1 then return end
|
||||||
|
delta = -1
|
||||||
|
elseif key == SCK_DOWN then
|
||||||
|
if lines_idx == #lines then return end
|
||||||
|
delta = 1
|
||||||
|
elseif key == SCK_TAB then
|
||||||
|
local line = strip_prompt(output:GetCurLine())
|
||||||
|
local matches = {}
|
||||||
|
for i,l in ipairs(lines) do
|
||||||
|
if l:find(line,1,true) == 1 then
|
||||||
|
table.insert(matches,1,l)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
if #matches == 0 then return end
|
||||||
|
if #matches == 1 then
|
||||||
|
replace_current_line(matches[1])
|
||||||
|
return
|
||||||
|
end
|
||||||
|
enable_arrow_keys (true)
|
||||||
|
scite_UserListShow(matches,1,function(l)
|
||||||
|
replace_current_line(l)
|
||||||
|
enable_arrow_keys (false)
|
||||||
|
end)
|
||||||
|
return
|
||||||
|
end
|
||||||
|
if delta then
|
||||||
|
lines_idx = lines_idx + delta
|
||||||
|
local txt = lines[lines_idx]
|
||||||
|
if txt then
|
||||||
|
replace_current_line(txt)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
function scite_Trace (s)
|
||||||
|
trace(s)
|
||||||
|
lastpos = output.CurrentPos
|
||||||
|
end
|
||||||
|
|
||||||
|
local function line_handler(line)
|
||||||
|
line = strip_prompt(line)
|
||||||
|
-- prevent immediate duplicates
|
||||||
|
if lines[#lines] ~= line then
|
||||||
|
table.insert(lines,line)
|
||||||
|
end
|
||||||
|
lines_idx = #lines + 1
|
||||||
|
if line_callback(line) then
|
||||||
|
scite_LeaveInteractivePrompt()
|
||||||
|
end
|
||||||
|
|
||||||
|
end
|
||||||
|
|
||||||
|
function scite_InteractivePromptHandler(the_prompt,fun)
|
||||||
|
prompt = the_prompt
|
||||||
|
line_callback = fun
|
||||||
|
lines_idx = 1
|
||||||
|
lines = {}
|
||||||
|
enable_arrow_keys(false)
|
||||||
|
scite_OnKey(handle_keys)
|
||||||
|
scite_OnOutputLine(line_handler)
|
||||||
|
end
|
||||||
|
|
||||||
|
function scite_LeaveInteractivePrompt ()
|
||||||
|
scite_OnOutputLine(line_handler,true)
|
||||||
|
enable_arrow_keys(true)
|
||||||
|
scite_OnKey(handle_keys,'remove')
|
||||||
|
end
|
||||||
|
|
|
@ -0,0 +1,41 @@
|
||||||
|
-- this experimental script makes it easy to select blocks with a single click.
|
||||||
|
-- The usual behaviour is to select the whole line, and if that line happens to be a fold line
|
||||||
|
-- then select the rest of that block.
|
||||||
|
|
||||||
|
scite_require 'bit.luax'
|
||||||
|
|
||||||
|
--scite_Command("Testit|gone|Escape")
|
||||||
|
|
||||||
|
local line = 0
|
||||||
|
local pos = 0
|
||||||
|
local last_line, last_pos
|
||||||
|
|
||||||
|
function line_selected()
|
||||||
|
-- if not scite_GetProp('fold') then return end
|
||||||
|
local s1 = editor.SelectionStart
|
||||||
|
local s2 = editor.SelectionEnd
|
||||||
|
pos = editor.CurrentPos
|
||||||
|
line = editor:LineFromPosition(pos)
|
||||||
|
if s2 > s1 then -- non-trivial selection
|
||||||
|
local line = editor:LineFromPosition(s1)
|
||||||
|
if editor:PositionFromLine(line) > s1 then
|
||||||
|
return -- because selection didn't start at begining of line
|
||||||
|
end
|
||||||
|
if s2 == editor:PositionFromLine(line+1) then -- whole line selected!
|
||||||
|
local lev = editor.FoldLevel[line]
|
||||||
|
if bit.band(lev,SC_FOLDLEVELHEADERFLAG) then -- a fold line
|
||||||
|
if math.abs(line - last_line) ~= 1 then
|
||||||
|
--print(line,pos,last_line,last_pos)
|
||||||
|
local lastl = editor:GetLastChild(line,-1)
|
||||||
|
s2 = editor:PositionFromLine(lastl+1)
|
||||||
|
editor:SetSel(s1,s2)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
last_line = line
|
||||||
|
last_pos = pos
|
||||||
|
end
|
||||||
|
|
||||||
|
scite_OnUpdateUI(line_selected)
|
||||||
|
|
|
@ -0,0 +1,29 @@
|
||||||
|
-- this extends the usual double-click behaviour; any group of chars with the same style
|
||||||
|
-- (such as a string or a comment) will be extended. It is called immediately after the
|
||||||
|
-- default behaviour, which selects words. If a word was selected, then the cursor will
|
||||||
|
-- be at the end, and we ignore this case.
|
||||||
|
|
||||||
|
function expand_same_style()
|
||||||
|
if not scite_GetPropBool("scite.double.click.select.string",false) then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
|
local pos = editor.CurrentPos
|
||||||
|
local style = editor.StyleAt[pos]
|
||||||
|
if style == 0 or not editor.Focus then return end
|
||||||
|
local p = pos
|
||||||
|
while p > -1 and editor.StyleAt[p] == style do
|
||||||
|
p = p - 1
|
||||||
|
end
|
||||||
|
local pstart = p+1
|
||||||
|
if pstart == pos then return end -- we're at the end!
|
||||||
|
p = pos
|
||||||
|
local sz = editor.Length-1
|
||||||
|
while p < sz and editor.StyleAt[p] == style do
|
||||||
|
p = p + 1
|
||||||
|
end
|
||||||
|
editor:SetSel(pstart,p)
|
||||||
|
end
|
||||||
|
|
||||||
|
scite_OnDoubleClick(expand_same_style)
|
||||||
|
|
|
@ -0,0 +1,315 @@
|
||||||
|
--~ scite_Command("Smart Paste|smart_paste|Shift+Ctrl+V")
|
||||||
|
--~ scite_Command("Block Select|block_select|Shift+Ctrl+A")
|
||||||
|
|
||||||
|
function indentation_of_line (line)
|
||||||
|
indent = editor.LineIndentation[line]
|
||||||
|
indent = indent / editor.TabWidth
|
||||||
|
return indent
|
||||||
|
end
|
||||||
|
|
||||||
|
-- note that we explicitly have to compare the result to zero, since
|
||||||
|
-- a zero value is NOT considered false in Lua!
|
||||||
|
function fold_line(line)
|
||||||
|
local lev = editor.FoldLevel[line]
|
||||||
|
return bit.band(lev,SC_FOLDLEVELHEADERFLAG) ~= 0
|
||||||
|
end
|
||||||
|
|
||||||
|
function goto_line_start(line)
|
||||||
|
local pos = editor:PositionFromLine(line)
|
||||||
|
editor:GotoPos(pos)
|
||||||
|
return pos
|
||||||
|
end
|
||||||
|
|
||||||
|
function smart_paste ()
|
||||||
|
local posE,nline
|
||||||
|
local new_indent = 0
|
||||||
|
local line = editor:LineFromPosition(editor.CurrentPos)
|
||||||
|
-- we want to insert from the start of the line
|
||||||
|
local str = editor:GetCurLine()
|
||||||
|
local indent = -1
|
||||||
|
-- deduce the current indentation from it
|
||||||
|
local ldent,lnext
|
||||||
|
if not str:find('%S') then
|
||||||
|
ldent = line-1
|
||||||
|
pos = goto_line_start(line)
|
||||||
|
lnext = line+1
|
||||||
|
else
|
||||||
|
ldent = line
|
||||||
|
pos = goto_line_start(line+1)
|
||||||
|
lnext = line+2
|
||||||
|
end
|
||||||
|
indent = indentation_of_line(ldent)
|
||||||
|
if fold_line(ldent) then
|
||||||
|
indent = indent + 1
|
||||||
|
end
|
||||||
|
--print(ldent+1,indent,editor:GetLine(ldent))
|
||||||
|
-- unless we're at the end, put a marker at the next line so
|
||||||
|
-- we can find the extent of the paste
|
||||||
|
local m
|
||||||
|
if lnext < editor.LineCount then
|
||||||
|
m = editor:MarkerAdd(lnext,1)
|
||||||
|
end
|
||||||
|
editor:BeginUndoAction()
|
||||||
|
editor:Paste()
|
||||||
|
if m then -- find out where the marker has moved to
|
||||||
|
nline = editor:MarkerLineFromHandle(m)
|
||||||
|
if lnext == line+2 then
|
||||||
|
nline = nline - 1
|
||||||
|
line = line + 1
|
||||||
|
end
|
||||||
|
posE = editor:PositionFromLine(nline)
|
||||||
|
editor:MarkerDeleteHandle(m)
|
||||||
|
-- look at the indentation of the inserted text
|
||||||
|
new_indent = indentation_of_line(line)
|
||||||
|
--print(line,new_indent,editor:GetLine(line))
|
||||||
|
else
|
||||||
|
posE = editor.Length - 1
|
||||||
|
end
|
||||||
|
editor:SetSel(pos,posE)
|
||||||
|
if indent ~= -1 then
|
||||||
|
local diff = indent - new_indent
|
||||||
|
if diff > 0 then
|
||||||
|
for i = 0,diff-1 do editor:Tab() end
|
||||||
|
elseif diff < 0 then
|
||||||
|
diff = -diff
|
||||||
|
for i = 0,diff-1 do editor:BackTab() end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
editor:EndUndoAction()
|
||||||
|
end
|
||||||
|
|
||||||
|
function block_select()
|
||||||
|
local line = editor:LineFromPosition(editor.CurrentPos)
|
||||||
|
local parent = editor.FoldParent[line]
|
||||||
|
if parent ~= -1 then
|
||||||
|
local lastl = editor:GetLastChild(parent,-1) --NB!
|
||||||
|
local posE = editor:PositionFromLine(lastl+1)
|
||||||
|
-- it is common practice for the open brace in C-style languages to be
|
||||||
|
-- on its own line. Adjust our upper line for this case.
|
||||||
|
if editor.Lexer == SCLEX_CPP and editor:GetLine(parent):find('^%s*{%s*$') then
|
||||||
|
parent = parent - 1
|
||||||
|
end
|
||||||
|
local pos = editor:PositionFromLine(parent)
|
||||||
|
editor:SetSel(pos,posE)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
|
--[[---------------
|
||||||
|
LuaBit v0.3
|
||||||
|
-------------------
|
||||||
|
a bitwise operation lib for lua.
|
||||||
|
|
||||||
|
http://luaforge.net/projects/bit/
|
||||||
|
|
||||||
|
Under the MIT license.
|
||||||
|
|
||||||
|
copyright(c) 2006 hanzhao (abrash_han@hotmail.com)
|
||||||
|
--]]---------------
|
||||||
|
|
||||||
|
do
|
||||||
|
|
||||||
|
------------------------
|
||||||
|
-- bit lib implementions
|
||||||
|
|
||||||
|
local function check_int(n)
|
||||||
|
-- checking not float
|
||||||
|
if(n - math.floor(n) > 0) then
|
||||||
|
error("trying to use bitwise operation on non-integer!")
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
local function to_bits(n)
|
||||||
|
check_int(n)
|
||||||
|
if(n < 0) then
|
||||||
|
-- negative
|
||||||
|
return to_bits(bit.bnot(math.abs(n)) + 1)
|
||||||
|
end
|
||||||
|
-- to bits table
|
||||||
|
local tbl = {}
|
||||||
|
local cnt = 1
|
||||||
|
while (n > 0) do
|
||||||
|
local last = math.mod(n,2)
|
||||||
|
if(last == 1) then
|
||||||
|
tbl[cnt] = 1
|
||||||
|
else
|
||||||
|
tbl[cnt] = 0
|
||||||
|
end
|
||||||
|
n = (n-last)/2
|
||||||
|
cnt = cnt + 1
|
||||||
|
end
|
||||||
|
|
||||||
|
return tbl
|
||||||
|
end
|
||||||
|
|
||||||
|
local function tbl_to_number(tbl)
|
||||||
|
local n = table.getn(tbl)
|
||||||
|
|
||||||
|
local rslt = 0
|
||||||
|
local power = 1
|
||||||
|
for i = 1, n do
|
||||||
|
rslt = rslt + tbl[i]*power
|
||||||
|
power = power*2
|
||||||
|
end
|
||||||
|
|
||||||
|
return rslt
|
||||||
|
end
|
||||||
|
|
||||||
|
local function expand(tbl_m, tbl_n)
|
||||||
|
local big = {}
|
||||||
|
local small = {}
|
||||||
|
if(table.getn(tbl_m) > table.getn(tbl_n)) then
|
||||||
|
big = tbl_m
|
||||||
|
small = tbl_n
|
||||||
|
else
|
||||||
|
big = tbl_n
|
||||||
|
small = tbl_m
|
||||||
|
end
|
||||||
|
-- expand small
|
||||||
|
for i = table.getn(small) + 1, table.getn(big) do
|
||||||
|
small[i] = 0
|
||||||
|
end
|
||||||
|
|
||||||
|
end
|
||||||
|
|
||||||
|
local function bit_or(m, n)
|
||||||
|
local tbl_m = to_bits(m)
|
||||||
|
local tbl_n = to_bits(n)
|
||||||
|
expand(tbl_m, tbl_n)
|
||||||
|
|
||||||
|
local tbl = {}
|
||||||
|
local rslt = math.max(table.getn(tbl_m), table.getn(tbl_n))
|
||||||
|
for i = 1, rslt do
|
||||||
|
if(tbl_m[i]== 0 and tbl_n[i] == 0) then
|
||||||
|
tbl[i] = 0
|
||||||
|
else
|
||||||
|
tbl[i] = 1
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
return tbl_to_number(tbl)
|
||||||
|
end
|
||||||
|
|
||||||
|
local function bit_and(m, n)
|
||||||
|
local tbl_m = to_bits(m)
|
||||||
|
local tbl_n = to_bits(n)
|
||||||
|
expand(tbl_m, tbl_n)
|
||||||
|
|
||||||
|
local tbl = {}
|
||||||
|
local rslt = math.max(table.getn(tbl_m), table.getn(tbl_n))
|
||||||
|
for i = 1, rslt do
|
||||||
|
if(tbl_m[i]== 0 or tbl_n[i] == 0) then
|
||||||
|
tbl[i] = 0
|
||||||
|
else
|
||||||
|
tbl[i] = 1
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
return tbl_to_number(tbl)
|
||||||
|
end
|
||||||
|
|
||||||
|
local function bit_not(n)
|
||||||
|
|
||||||
|
local tbl = to_bits(n)
|
||||||
|
local size = math.max(table.getn(tbl), 32)
|
||||||
|
for i = 1, size do
|
||||||
|
if(tbl[i] == 1) then
|
||||||
|
tbl[i] = 0
|
||||||
|
else
|
||||||
|
tbl[i] = 1
|
||||||
|
end
|
||||||
|
end
|
||||||
|
return tbl_to_number(tbl)
|
||||||
|
end
|
||||||
|
|
||||||
|
local function bit_xor(m, n)
|
||||||
|
local tbl_m = to_bits(m)
|
||||||
|
local tbl_n = to_bits(n)
|
||||||
|
expand(tbl_m, tbl_n)
|
||||||
|
|
||||||
|
local tbl = {}
|
||||||
|
local rslt = math.max(table.getn(tbl_m), table.getn(tbl_n))
|
||||||
|
for i = 1, rslt do
|
||||||
|
if(tbl_m[i] ~= tbl_n[i]) then
|
||||||
|
tbl[i] = 1
|
||||||
|
else
|
||||||
|
tbl[i] = 0
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
--table.foreach(tbl, print)
|
||||||
|
|
||||||
|
return tbl_to_number(tbl)
|
||||||
|
end
|
||||||
|
|
||||||
|
local function bit_rshift(n, bits)
|
||||||
|
check_int(n)
|
||||||
|
|
||||||
|
local high_bit = 0
|
||||||
|
if(n < 0) then
|
||||||
|
-- negative
|
||||||
|
n = bit_not(math.abs(n)) + 1
|
||||||
|
high_bit = 2147483648 -- 0x80000000
|
||||||
|
end
|
||||||
|
|
||||||
|
for i=1, bits do
|
||||||
|
n = n/2
|
||||||
|
n = bit_or(math.floor(n), high_bit)
|
||||||
|
end
|
||||||
|
return math.floor(n)
|
||||||
|
end
|
||||||
|
|
||||||
|
-- logic rightshift assures zero filling shift
|
||||||
|
local function bit_logic_rshift(n, bits)
|
||||||
|
check_int(n)
|
||||||
|
if(n < 0) then
|
||||||
|
-- negative
|
||||||
|
n = bit_not(math.abs(n)) + 1
|
||||||
|
end
|
||||||
|
for i=1, bits do
|
||||||
|
n = n/2
|
||||||
|
end
|
||||||
|
return math.floor(n)
|
||||||
|
end
|
||||||
|
|
||||||
|
local function bit_lshift(n, bits)
|
||||||
|
check_int(n)
|
||||||
|
|
||||||
|
if(n < 0) then
|
||||||
|
-- negative
|
||||||
|
n = bit_not(math.abs(n)) + 1
|
||||||
|
end
|
||||||
|
|
||||||
|
for i=1, bits do
|
||||||
|
n = n*2
|
||||||
|
end
|
||||||
|
return bit_and(n, 4294967295) -- 0xFFFFFFFF
|
||||||
|
end
|
||||||
|
|
||||||
|
local function bit_xor2(m, n)
|
||||||
|
local rhs = bit_or(bit_not(m), bit_not(n))
|
||||||
|
local lhs = bit_or(m, n)
|
||||||
|
local rslt = bit_and(lhs, rhs)
|
||||||
|
return rslt
|
||||||
|
end
|
||||||
|
|
||||||
|
--------------------
|
||||||
|
-- bit lib interface
|
||||||
|
|
||||||
|
bit = {
|
||||||
|
-- bit operations
|
||||||
|
bnot = bit_not,
|
||||||
|
band = bit_and,
|
||||||
|
bor = bit_or,
|
||||||
|
bxor = bit_xor,
|
||||||
|
brshift = bit_rshift,
|
||||||
|
blshift = bit_lshift,
|
||||||
|
bxor2 = bit_xor2,
|
||||||
|
blogic_rshift = bit_logic_rshift,
|
||||||
|
|
||||||
|
-- utility func
|
||||||
|
tobits = to_bits,
|
||||||
|
tonumb = tbl_to_number,
|
||||||
|
}
|
||||||
|
|
||||||
|
end
|
|
@ -0,0 +1,58 @@
|
||||||
|
--switch_buffers.lua
|
||||||
|
--drops down a list of buffers, in recently-used order
|
||||||
|
|
||||||
|
--~ scite_Command 'Switch Buffer|do_buffer_list|Alt+F12'
|
||||||
|
--~ scite_Command 'Last Buffer|last_buffer|Ctrl+F12'
|
||||||
|
|
||||||
|
local buffers = {}
|
||||||
|
local remove = table.remove
|
||||||
|
local insert = table.insert
|
||||||
|
local current_path
|
||||||
|
local _DirChange = {}
|
||||||
|
|
||||||
|
function scite_OnDirChange(fn,rem)
|
||||||
|
ex_append_unique(_DirChange,fn,rem)
|
||||||
|
end
|
||||||
|
|
||||||
|
scite_OnOpenSwitch(function(f)
|
||||||
|
--- swop the new current buffer with the last one!
|
||||||
|
local idx
|
||||||
|
for i,file in ipairs(buffers) do
|
||||||
|
if file == f then idx = i; break end
|
||||||
|
end
|
||||||
|
if idx then
|
||||||
|
remove(buffers,idx)
|
||||||
|
insert(buffers,1,f)
|
||||||
|
else
|
||||||
|
insert(buffers,1,f)
|
||||||
|
end
|
||||||
|
if current_path ~= props['FileDir'] then
|
||||||
|
current_path = props['FileDir']
|
||||||
|
DoDispatchOne(_DirChange,current_path)
|
||||||
|
end
|
||||||
|
end)
|
||||||
|
|
||||||
|
function last_buffer()
|
||||||
|
if #buffers > 1 then
|
||||||
|
scite.Open(buffers[2])
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
function do_buffer_list()
|
||||||
|
if not scite_GetPropBool('buffer.switch.fullpath',false) then
|
||||||
|
local files = {}
|
||||||
|
for i = 1,#buffers do
|
||||||
|
files[i] = basename(buffers[i])
|
||||||
|
end
|
||||||
|
scite_UserListShow(files,2,function(s)
|
||||||
|
for i = 1,#files do
|
||||||
|
if s == files[i] then
|
||||||
|
scite.Open(buffers[i])
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end)
|
||||||
|
else
|
||||||
|
scite_UserListShow(buffers,2,scite.Open)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
|
@ -0,0 +1,12 @@
|
||||||
|
function two(x)
|
||||||
|
print(x)
|
||||||
|
end
|
||||||
|
function one(y)
|
||||||
|
print(y)
|
||||||
|
two('go')
|
||||||
|
print('there')
|
||||||
|
end
|
||||||
|
|
||||||
|
one('dolly')
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,38 @@
|
||||||
|
// build@ g++ -g test1.cpp -o test1
|
||||||
|
#include <iostream>
|
||||||
|
#include <string>
|
||||||
|
using namespace std;
|
||||||
|
|
||||||
|
struct Pair {
|
||||||
|
string first;
|
||||||
|
string second;
|
||||||
|
|
||||||
|
Pair(string s1, string s2)
|
||||||
|
: first(s1), second(s2)
|
||||||
|
{}
|
||||||
|
};
|
||||||
|
|
||||||
|
void one(string s1, string s2)
|
||||||
|
{
|
||||||
|
int *pi = NULL;
|
||||||
|
//~ *pi = 0;
|
||||||
|
string s = s1 + s2;
|
||||||
|
Pair pp(s1,s2);
|
||||||
|
cout << s << endl;
|
||||||
|
}
|
||||||
|
|
||||||
|
void two(string s)
|
||||||
|
{
|
||||||
|
string t = "help";
|
||||||
|
one(s,t);
|
||||||
|
}
|
||||||
|
|
||||||
|
int main(int argc, char **argv)
|
||||||
|
{
|
||||||
|
for(int i = 0; i < argc; i++)
|
||||||
|
cout << argv[i] << endl;
|
||||||
|
two("hello");
|
||||||
|
//~ char ch;
|
||||||
|
//~ cin >> ch;
|
||||||
|
return 0;
|
||||||
|
}
|
|
@ -0,0 +1,8 @@
|
||||||
|
def one(x):
|
||||||
|
print x
|
||||||
|
|
||||||
|
def two(x,y):
|
||||||
|
one(x)
|
||||||
|
one(y)
|
||||||
|
|
||||||
|
two(10,20)
|
|
@ -0,0 +1,50 @@
|
||||||
|
// build@ gcc -g test3.c -o test3
|
||||||
|
#include <stdio.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
|
||||||
|
typedef struct {
|
||||||
|
int a,b;
|
||||||
|
} A;
|
||||||
|
|
||||||
|
typedef struct {
|
||||||
|
float x;
|
||||||
|
A* y;
|
||||||
|
} B;
|
||||||
|
|
||||||
|
|
||||||
|
void three(int i)
|
||||||
|
{
|
||||||
|
printf("three %d\n",i);
|
||||||
|
}
|
||||||
|
|
||||||
|
void two(int i)
|
||||||
|
{
|
||||||
|
A a = {10,20};
|
||||||
|
B b;
|
||||||
|
b.x = 2.3f;
|
||||||
|
b.y = &a;
|
||||||
|
int val = b.y->a;
|
||||||
|
three(i);
|
||||||
|
printf("i = %d\n",i);
|
||||||
|
}
|
||||||
|
|
||||||
|
void one(int i)
|
||||||
|
{
|
||||||
|
int k,j;
|
||||||
|
two(i);
|
||||||
|
switch(i) {
|
||||||
|
case 1: k = 10; break;
|
||||||
|
case 2: k = 44; break;
|
||||||
|
case 3: k = 55; break;
|
||||||
|
default: k = 10;
|
||||||
|
}
|
||||||
|
j = 1;
|
||||||
|
j = 2;
|
||||||
|
j = 3;
|
||||||
|
}
|
||||||
|
|
||||||
|
int main(int argc, char** argv)
|
||||||
|
{
|
||||||
|
one(2);
|
||||||
|
return 0;
|
||||||
|
}
|
|
@ -0,0 +1,34 @@
|
||||||
|
local tab = {
|
||||||
|
foo = {x = 1},
|
||||||
|
bar = 2
|
||||||
|
}
|
||||||
|
|
||||||
|
for i,v in ipairs(arg) do
|
||||||
|
print(i,v)
|
||||||
|
end
|
||||||
|
|
||||||
|
--~ dofile 'testdir/assert.lua'
|
||||||
|
|
||||||
|
local k
|
||||||
|
local p = 0
|
||||||
|
local tt
|
||||||
|
|
||||||
|
--~ tt.x = 1
|
||||||
|
|
||||||
|
print("Start")
|
||||||
|
|
||||||
|
function bar(x)
|
||||||
|
print("In bar",x)
|
||||||
|
p = p + 1
|
||||||
|
end
|
||||||
|
|
||||||
|
for i = 1, 3 do
|
||||||
|
k = 2*i
|
||||||
|
io.write 'go '
|
||||||
|
bar(i)
|
||||||
|
tab.foo.x = tab.foo.x * 2
|
||||||
|
-- a.x = 2
|
||||||
|
end
|
||||||
|
|
||||||
|
print("End of test3")
|
||||||
|
|
|
@ -0,0 +1,42 @@
|
||||||
|
# A modified main pdb debugger loop (see pdb.py in the Python library!)
|
||||||
|
from pdb import *
|
||||||
|
import sys,os,traceback
|
||||||
|
|
||||||
|
def main():
|
||||||
|
mainpyfile = sys.argv[1] # Get script filename
|
||||||
|
if not os.path.exists(mainpyfile):
|
||||||
|
print 'Error:', mainpyfile, 'does not exist'
|
||||||
|
sys.exit(1)
|
||||||
|
|
||||||
|
del sys.argv[0] # Hide "pdb.py" from argument list
|
||||||
|
# Replace pdb's dir with script's dir in front of module search path.
|
||||||
|
sys.path[0] = os.path.dirname(mainpyfile)
|
||||||
|
|
||||||
|
pdb = Pdb()
|
||||||
|
# 1st customization: prompt w/ a line feed!
|
||||||
|
pdb.prompt = '(PDB)\n'
|
||||||
|
# 2nd customization: not an infinite loop!
|
||||||
|
try:
|
||||||
|
pdb._runscript(mainpyfile)
|
||||||
|
if pdb._user_requested_quit:
|
||||||
|
return
|
||||||
|
print "The program finished and will not be restarted"
|
||||||
|
except SystemExit:
|
||||||
|
# In most cases SystemExit does not warrant a post-mortem session.
|
||||||
|
print "The program exited via sys.exit(). Exit status: ",
|
||||||
|
print sys.exc_info()[1]
|
||||||
|
except:
|
||||||
|
traceback.print_exc()
|
||||||
|
print "Uncaught exception. Entering post mortem debugging"
|
||||||
|
t = sys.exc_info()[2]
|
||||||
|
while t.tb_next is not None:
|
||||||
|
t = t.tb_next
|
||||||
|
pdb.interaction(t.tb_frame,t)
|
||||||
|
|
||||||
|
|
||||||
|
# When invoked as main program, invoke the debugger on a script
|
||||||
|
if __name__=='__main__':
|
||||||
|
main()
|
||||||
|
# under Windows, we need to run Python w/ the -i flag; this ensures that we die!
|
||||||
|
sys.exit(0)
|
||||||
|
|
After Width: | Height: | Size: 1.4 KiB |
After Width: | Height: | Size: 1.3 KiB |
After Width: | Height: | Size: 822 B |
After Width: | Height: | Size: 1.3 KiB |
After Width: | Height: | Size: 1.4 KiB |
After Width: | Height: | Size: 1.4 KiB |
After Width: | Height: | Size: 1.5 KiB |
After Width: | Height: | Size: 1.4 KiB |
After Width: | Height: | Size: 1.4 KiB |
|
@ -0,0 +1,329 @@
|
||||||
|
=================== Lua For Windows ===================
|
||||||
|
-=-=-=- Version 5.1.4-47
|
||||||
|
^ Updated stdlib to release 28.
|
||||||
|
|
||||||
|
08/07/2012 Version 5.1.4-46
|
||||||
|
* Fixes #43 - require('lpeg') -- system error 14001
|
||||||
|
^ Updated stdlib to release 25.
|
||||||
|
^ Updated the Visual C++ 8.0 run-time to SP1-4053.
|
||||||
|
^ Updated lpeg.dll manifest to allow running on older vcredist_x86.
|
||||||
|
^ Updated alien/core.dll manifest to allow running on older vcredist_x86.
|
||||||
|
^ Updated alien/struct.dll manifest to allow running on older vcredist_x86.
|
||||||
|
^ Updated examples/alien/tests/alientest.dll manifest to allow running on older vcredist_x86.
|
||||||
|
^ Updated LuaXML_lib.dll manifest to allow running on older vcredist_x86.
|
||||||
|
^ Updated w32.dll manifest to allow running on older vcredist_x86.
|
||||||
|
^ Updated Penlight to version 1.0.3.
|
||||||
|
^ Updated LuaUnit to version 2.0.
|
||||||
|
+ Added SubLua version 1.7.4 - Subversion binding
|
||||||
|
|
||||||
|
06/14/2011 Version 5.1.4-45
|
||||||
|
* Fixes #42 - Please update Tecgraf libs (CD, IM, IUP)
|
||||||
|
^ Updated IUP to version 3.5.0.
|
||||||
|
^ Updated CD to version 5.4.1.
|
||||||
|
^ Updated IM to version 3.6.3.
|
||||||
|
|
||||||
|
06/08/2011 Version 5.1.4-44
|
||||||
|
* Fixed pl.dir so you can use strict module
|
||||||
|
|
||||||
|
06/06/2011 Version 5.1.4-43
|
||||||
|
* Fixes #1 - LuaSocket example not upto date - cddb.lua.
|
||||||
|
* Fixes #24 - Commented-out visible whitespace acquires coment colour.
|
||||||
|
+ Closed #19 - Added LuaJSON v1.2.2 library.
|
||||||
|
^ Closed #41 - Updated Alien to version 0.5.0.
|
||||||
|
^ Updated LPeg to version 0.10-1.
|
||||||
|
^ Updated stdlib to release 21.
|
||||||
|
|
||||||
|
06/01/2011 Version 5.1.4-42
|
||||||
|
^ Updated LuaLogging to version 1.2.0.
|
||||||
|
^ Updated stdlib to release 20.
|
||||||
|
^ Updated Penlight to version 0.9.4.
|
||||||
|
|
||||||
|
01/11/2011 Version 5.1.4-41
|
||||||
|
* Fixes #34 - LuaXML clib delivered with LuaForWindows causes memory
|
||||||
|
leaks.
|
||||||
|
|
||||||
|
07/26/2010 Version 5.1.4-40
|
||||||
|
* Fixes #14 - Just a simple mistake in the link to LuaEx.
|
||||||
|
* Fixes #18 - Lua tutorial typo.
|
||||||
|
* Reverted to wxLua version 2.8.7 because there are issues with the new
|
||||||
|
versions stability. It will get updated later.
|
||||||
|
* Fixed pplot examples that ship with IUP.
|
||||||
|
^ Closed #20 - Updated IUP to version 3.2.0.
|
||||||
|
^ Updated Lanes to version 2.0.4.
|
||||||
|
+ Added Oil version 0.4-beta.
|
||||||
|
|
||||||
|
06/17/2010 Version 5.1.4-39
|
||||||
|
+ Added LuaRocks version 2.0.2.
|
||||||
|
* Fixes #13 - Updated wxLua to version 2.8.10.
|
||||||
|
^ Updated stdlib to release 15.
|
||||||
|
^ Updated stdlib to release 14.
|
||||||
|
^ Updated stdlib to release 13.
|
||||||
|
|
||||||
|
05/18/2010 Version 5.1.4-38
|
||||||
|
* Fixed #10 - LuaDoc incomplete. Added luadoc_start.bat.
|
||||||
|
* Fixed #09 - luanet kill lua.exe
|
||||||
|
^ Updated the SciTE .api file. Now includes lfs, bit and pack.
|
||||||
|
|
||||||
|
05/04/2010 Version 5.1.4-37
|
||||||
|
^ Updated Penlight to version 0.8.4
|
||||||
|
|
||||||
|
04/09/2010 Version 5.1.4-36
|
||||||
|
^ Updated Penlight to version 0.8.3
|
||||||
|
|
||||||
|
04/07/2010 Version 5.1.4-35
|
||||||
|
^ Updated lExecutor to version 1.01
|
||||||
|
^ Updated Penlight to version 0.8.2
|
||||||
|
|
||||||
|
03/18/2010 Version 5.1.4-34
|
||||||
|
^ Updated Penlight to version 0.8.1
|
||||||
|
|
||||||
|
03/15/2010 Version 5.1.4-33
|
||||||
|
+ Added LeMock v0.6
|
||||||
|
|
||||||
|
03/12/2010 Version 5.1.4-32
|
||||||
|
+ Added LuaRS232 v1.0.0
|
||||||
|
+ Added iLua.cmd to easily launch iLua. Also added it to the start menu.
|
||||||
|
* Fixed SciTE to properly run interactive Lua session.
|
||||||
|
^ Updated the clidebugger to take the same paramaters to allow for debug level.
|
||||||
|
^ Updated Penlight to version 0.8.0.
|
||||||
|
^ Updated IUP to version 3.0.0.
|
||||||
|
^ Updated CD to version 5.3.0.
|
||||||
|
^ Updated IM to version 3.6.0.
|
||||||
|
|
||||||
|
12/07/2009 Version 5.1.4-31
|
||||||
|
+ Added markdown v0.32 Lua module.
|
||||||
|
* Fixed Issue 4: C Run-Time Error R6034.
|
||||||
|
* Fixed LuaInterface manifest loading issue.
|
||||||
|
^ Updated luanet.dll to CoInitialize and search in the LUA_CPATH.
|
||||||
|
|
||||||
|
09/15/2009 Version 5.1.4-30
|
||||||
|
+ Added lbase64 version for 5.1 module.
|
||||||
|
+ Added gzio version 0.9.0 module.
|
||||||
|
^ Updated Stdlib to version 12.
|
||||||
|
^ Updated the LfW documentation to describe how to add your own modules
|
||||||
|
to the system.
|
||||||
|
|
||||||
|
09/02/2009 Version 5.1.4-29
|
||||||
|
+ Added Penlight v0.7.2 Lua module.
|
||||||
|
^ Updated LuaCOM to version 1.4.
|
||||||
|
^ Updated LuaGL to version 1.3.
|
||||||
|
^ Updated VStruct to version 1.0.2.
|
||||||
|
|
||||||
|
06/29/2009 Version 5.1.4-28
|
||||||
|
* Fixed SciTE debugger to allow it to debug modules in the same directory
|
||||||
|
as the file using the module.
|
||||||
|
^ Updated Stdlib to version 11.
|
||||||
|
|
||||||
|
04/27/2009 Version 5.1.4-27 rc4
|
||||||
|
* Fixed SciTE debugger looking for the temp file in the %TMP% location.
|
||||||
|
* Fixed debugging files with spaces in the filename.
|
||||||
|
^ Updated the IM, CD, and IUP examples.
|
||||||
|
^ Made SciTE use the lua5.1.dll.
|
||||||
|
^ Changed the version number to use a '-' as a build number of the LfW
|
||||||
|
package.
|
||||||
|
^ Changed the installer display name to 'Lua For Windows'.
|
||||||
|
|
||||||
|
04/23/2009 Version 5.1.4.26 rc3
|
||||||
|
+ Added an option to start the quickluatour.lua after installation
|
||||||
|
completes.
|
||||||
|
+ Added a link to the lExecutor documentation in the start menu.
|
||||||
|
+ Now you can launch quickluatour.lua at the end of the installer
|
||||||
|
^ Updated luaforwindows.html to be the right version in the example.
|
||||||
|
^ Updated the LuaQuickTour thanks to Dirk Feytons.
|
||||||
|
* Fixed SciTE saving a debugger file to the current running scripts
|
||||||
|
directory. Now it saves it to your local temp directory.
|
||||||
|
* Fixed SciTE toolbar icons being incorrect.
|
||||||
|
|
||||||
|
04/15/2009 Version 5.1.4.25 rc2
|
||||||
|
^ Updated lua51.dll manifest to allow running on Windows 64.
|
||||||
|
|
||||||
|
04/14/2009 Version 5.1.4.24 rc1
|
||||||
|
^ Updated LPeg to version 0.9.
|
||||||
|
^ Updated Copas to version 1.1.5.
|
||||||
|
^ Updated the Lua executables so they run on Windows 64.
|
||||||
|
|
||||||
|
02/06/2009 Version 5.1.4.23
|
||||||
|
+ Added MetaLua v0.5-rc1.
|
||||||
|
+ Added the 'strict.lua' file shipped in the Lua in the 'etc' directory.
|
||||||
|
+ Added Lanes v2.0.3 library.
|
||||||
|
^ Updated LuaFileSystem to version 1.4.2.
|
||||||
|
|
||||||
|
01/12/2009 Version 5.1.4.22
|
||||||
|
+ Added LuaBitOp v1.0.1 library.
|
||||||
|
* Fixed a bug in lExecutor to properly pass file loading error to the user.
|
||||||
|
* Fixed LuaDoc templates a bit for 'tables' and 'functions'.
|
||||||
|
* Fixed LuaXML so it actually works. Opps.
|
||||||
|
^ Updated Copas to version 1.1.4.
|
||||||
|
- Removed BitLib. Use LuaBitOp instead.
|
||||||
|
|
||||||
|
12/05/2008 Version 5.1.4.21
|
||||||
|
* Fixed a SciTE bug when opening the Lua manual.
|
||||||
|
+ Added lExecutor. This is a wxLua application that allows users to run console
|
||||||
|
Lua scripts in a simple GUI. Look at the documentation
|
||||||
|
(<LFW root>\docs\lexecutor) for more information.
|
||||||
|
+ Added *.lexe files to run using lExecutor.
|
||||||
|
+ Associated *.lexe files to a custom icon.
|
||||||
|
|
||||||
|
11/26/2008 Version 5.1.4.20
|
||||||
|
+ Added lpack (29 Jun 2007 19:27:20) module.
|
||||||
|
+ Added VStruct v 1.0 beta2 Lua module.
|
||||||
|
+ Added BitLib release 25 module.
|
||||||
|
+ Added LuaXML v1.3 module.
|
||||||
|
^ Updated IUP to version 2.7.
|
||||||
|
^ Updated CD to version 5.1.
|
||||||
|
^ Updated IM to version 3.4.
|
||||||
|
|
||||||
|
10/08/2008 Version 5.1.4.19
|
||||||
|
^ Updated vcredistx86.exe download link in the installer.
|
||||||
|
|
||||||
|
09/11/2008 Version 5.1.4.18
|
||||||
|
^ Updated Stdlib to version 8.
|
||||||
|
^ Updated the quickluatour.lua.
|
||||||
|
^ Updated the luaforwindows document.
|
||||||
|
* Fixed LuaInterface module.
|
||||||
|
|
||||||
|
09/02/2008 Version 5.1.4.17
|
||||||
|
* Fixed the readyiss.bat file to work with the new 'lua' directory.
|
||||||
|
|
||||||
|
08/29/2008 Version 5.1.4.16 - RC1
|
||||||
|
+ Added wxLua support.
|
||||||
|
^ Updated to Lua v5.1.4.
|
||||||
|
^ Changed the 'lualibs' to 'lua' to support the default locations.
|
||||||
|
^ Updated SciTE property file to make the help show up correctly.
|
||||||
|
- Removed setting the LUA_PATH and LUA_CPATH environment variables.
|
||||||
|
|
||||||
|
08/07/2008 Version 5.1.3.15
|
||||||
|
* Fixed SciTE install.
|
||||||
|
|
||||||
|
08/07/2008 Version 5.1.3.14
|
||||||
|
+ Added an environment variable called "LUA_DEV" to help C module developers
|
||||||
|
configure their build files. This allows for the paths to be common and
|
||||||
|
easily added to the project settings.
|
||||||
|
(e.g. $(LUA_DEV)/include; $(LUA_DEV)/lib)
|
||||||
|
+ Added the ability to download the 'vcredist_x86.exe'.
|
||||||
|
* Fixed Visual C++ 8.0 run-time problems. There now has to ba a run-time
|
||||||
|
for every dll loaded.
|
||||||
|
- Removed 'msvcr80.dll' from the root application directory.
|
||||||
|
^ Updated the Visual C++ 8.0 run-time to SP1.
|
||||||
|
^ Updated StdLib to version 6.
|
||||||
|
|
||||||
|
|
||||||
|
07/16/2008 Version 5.1.3.13
|
||||||
|
+ Added LOOP Module. NOTE: It does not have any examples.
|
||||||
|
+ Added IUP simple documentation.
|
||||||
|
+ Added LuaTask module.
|
||||||
|
+ Added LuaInterface module.
|
||||||
|
+ Added Lua's headers and libraries so that you can develope Lua modules.
|
||||||
|
- Removed the 'alien/gtk.lua' example. It was Unix only.
|
||||||
|
^ Updated LuaCURL with a better supported version.
|
||||||
|
^ Updated the LuaCURL example.
|
||||||
|
|
||||||
|
07/08/2008 Version 5.1.3.12
|
||||||
|
+ Added Rings module.
|
||||||
|
+ Added copas module.
|
||||||
|
+ Added coxpcall module.
|
||||||
|
* Fixed a couple of typos in quickluatour.lua.
|
||||||
|
^ Updated to the latest version of luaforwindows.html.
|
||||||
|
^ Updated io_ext.lua to handle backslashes as well as forward slashes.
|
||||||
|
|
||||||
|
06/27/2008 Version 5.1.3.11 - RC1
|
||||||
|
+ Added the ability to "self-host" the creation of this installer.
|
||||||
|
That means if INNO Setup is installed on the installers machine they
|
||||||
|
can create the LfW installer. This gives anybody the ability to add or
|
||||||
|
remove items and modules from the installer.
|
||||||
|
See <LfW_Install>\installer\support\readyiss.bat for more information.
|
||||||
|
+ Added a basic guide to using IUP.
|
||||||
|
+ Added the ability to completely uninstall the environment variables.
|
||||||
|
* Fixed a few typos in quickluatour.lua.
|
||||||
|
^ Updated all no-extension files to have a .txt extension.
|
||||||
|
^ Updated all the *.lua and *.wlua files to use Windows line endings.
|
||||||
|
|
||||||
|
06/24/2008 Version 5.1.3.10 - Alpha 7
|
||||||
|
+ Added classlib for creating classes in Lua.
|
||||||
|
+ Added quickluatour.lua.
|
||||||
|
+ Added SciTE as the default script editor.
|
||||||
|
^ Updated to the latest version of luaforwindows.html.
|
||||||
|
|
||||||
|
05/27/2008 Version 5.1.3.9 - Alpha 6
|
||||||
|
+ Added lrexlib
|
||||||
|
+ Added stdlib
|
||||||
|
+ Added Lua-Ex
|
||||||
|
+ Added LuaGL
|
||||||
|
^ Updated the luaforwindows.html file with more formatting.
|
||||||
|
- Removed "wlua.exe.manifest" because it is now built into 'wlua.exe'.
|
||||||
|
|
||||||
|
05/23/2008 Version 5.1.3.8 - Alpha 5
|
||||||
|
+ Added Lua-GD
|
||||||
|
+ Added the PN help file.
|
||||||
|
+ Added Lua file associations for limited users.
|
||||||
|
^ Updated the installer to check if PN is running and display a
|
||||||
|
message if it is.
|
||||||
|
^ Changed the way it makes web links in the start menu. The icons should
|
||||||
|
now be the machines default icon for the shortcuts.
|
||||||
|
^ Switched to html for the LuaForWindows documentation.
|
||||||
|
^ Moved the 'Lua On The Web' shortcut to the documentation directory under
|
||||||
|
the start menu.
|
||||||
|
- Removed the .lua extention from the PATHEXT environment variable.
|
||||||
|
This was leading to possible application named the same thing not
|
||||||
|
getting called when it has the same name as your lua script.
|
||||||
|
This only changes the need for the .lua on the end of you script
|
||||||
|
name. (e.g. MyScript.lua param1 param2 instead of MyScript param1 param2)
|
||||||
|
|
||||||
|
05/21/2008 Version 5.1.3.7 - Alpha 4
|
||||||
|
+ Added LuaLogging examples and documentation.
|
||||||
|
+ Added LuaForWindows documentation initial draft.
|
||||||
|
* Fixed the Lua file icon not showing up.
|
||||||
|
* Fixed the the default color scheme to have a black color
|
||||||
|
for Identifiers.
|
||||||
|
|
||||||
|
05/20/2008 Version 5.1.3.6 - Alpha 3
|
||||||
|
+ Added the ability to install when not an administrator.
|
||||||
|
^ Updated the default color scheme to have a slightly different color
|
||||||
|
for Identifiers.
|
||||||
|
|
||||||
|
05/17/2008 Version 5.1.3.5 - Alpha 3
|
||||||
|
* Internal release only.
|
||||||
|
+ Added more keywords to the Lua lexer in PN.
|
||||||
|
|
||||||
|
05/16/2008 Version 5.1.3.4 - Alpha 2
|
||||||
|
+ LuaCOM
|
||||||
|
|
||||||
|
05/16/2008 Version 5.1.3.3 - Alpha 2
|
||||||
|
+ LuaUnit
|
||||||
|
+ LuaZip
|
||||||
|
+ LuaExpat
|
||||||
|
+ LuaDate
|
||||||
|
+ LuaProfiler
|
||||||
|
+ MD5
|
||||||
|
+ LuaSQL - Only the SQLite3 driver is tested.
|
||||||
|
+ LuaCURL
|
||||||
|
+ Alien
|
||||||
|
+ LPeg
|
||||||
|
+ LuaCOM
|
||||||
|
+ Added a 'utils' directory to hold helpful Lua tools like the
|
||||||
|
LuaProfiler summary tool
|
||||||
|
+ Added a Start Menu shortcut to the documentation
|
||||||
|
+ Added the LuaDoc examples
|
||||||
|
* Fixed the missing documentation for LuaDoc
|
||||||
|
* Fix PN so that it has a profile for wlua.
|
||||||
|
|
||||||
|
|
||||||
|
05/14/2008 Version 5.1.3.2 - Alpha 1
|
||||||
|
^ First public alpha
|
||||||
|
+ Programmer Notepad for a simple IDE
|
||||||
|
+ Registers .lua and .wlua files so they can just be double-clicked on
|
||||||
|
+ Registers .lua and .wlua files act just like executables
|
||||||
|
(e.g. script param1 param2 NOT script.lua param1 param2)
|
||||||
|
+ Added the needed paths to the PATH environment variable
|
||||||
|
+ LuaBiniaries
|
||||||
|
+ LuaFileSystem
|
||||||
|
+ LuaSocket
|
||||||
|
+ LuaLogging
|
||||||
|
+ LuaDoc
|
||||||
|
+ IUP
|
||||||
|
+ w32 - Wrappers for Win32 API functions & constants
|
||||||
|
|
||||||
|
_______________________________________________________________
|
||||||
|
Legend:
|
||||||
|
|
||||||
|
'+' = Addition, '*' = Bug Fix, '-' = Removed, '~' = Move, '^' = Updated
|