Compare commits

...

110 Commits
0.38 ... 0.381

Author SHA1 Message Date
Paul Kulchenko
f28d4da053 Fixed having duplicate tabs after SaveAs with existing file name. 2013-09-08 14:38:59 -07:00
Paul Kulchenko
858742bf05 Fixed showing redirected 'print' messages after debugging is terminated. 2013-09-06 21:29:33 -07:00
Paul Kulchenko
d559afd9e2 Updated CFBundleIdentifier in plist files to allow references from OSX programs. 2013-09-06 15:07:43 -07:00
Paul Kulchenko
9acec71c7a Added package GetEditorNotebook method (ref #166). 2013-09-06 15:01:34 -07:00
Paul Kulchenko
8568f61ba4 Added 'molokai' color scheme (ref #200). 2013-09-05 22:23:28 -07:00
Paul Kulchenko
6714f29302 Updated un/comment to toggle selection as a group rather than line by line. 2013-09-04 19:09:28 -07:00
Paul Kulchenko
f0b7cff06a Added file activation for abbreviated file names in error messages. 2013-09-04 15:26:54 -07:00
Paul Kulchenko
25589fc45a Reorganized path separator handling to minimize use of global variables. 2013-09-04 12:00:57 -07:00
Paul Kulchenko
6a7c8e78c0 Added abbreviation of project directories to keep unique parts visible. 2013-09-03 22:35:33 -07:00
Paul Kulchenko
443f936ac6 Added debugger.redirect configuration option. 2013-09-02 21:07:48 -07:00
Paul Kulchenko
12525ad189 Added editor.saveallonrun configuration option. 2013-09-02 10:43:03 -07:00
Paul Kulchenko
69fae9a36c Fixed using default interpreter when no interpreter is selected. 2013-09-02 10:32:47 -07:00
Paul Kulchenko
725a38b182 Improved IDE activation during debugging on Windows (closes #199); thanks to jpoag. 2013-09-01 22:28:04 -07:00
Paul Kulchenko
13c4ca1a2f Fixed stepping through blocks with undefined variables when 'strict' is in effect (upgraded Mobdebug to 0.5401). 2013-09-01 21:17:47 -07:00
Paul Kulchenko
3e68447415 Updated CHANGELOG with recent changes. 2013-08-29 19:19:42 -07:00
Paul Kulchenko
0419e6812b Added package GetOutput method (ref #166). 2013-08-27 14:15:36 -07:00
Paul Kulchenko
cd1b9d7cd2 Added package onAppLoad/onAppClose events (ref #166). 2013-08-27 14:14:36 -07:00
Paul Kulchenko
d63dda5e6a Cleaned up code. 2013-08-27 14:12:29 -07:00
Paul Kulchenko
32f4b8694b Updated NewFile to accept a file name. 2013-08-27 11:19:50 -07:00
Paul Kulchenko
2dbb6644cb Fixed loading of files with incorrect UTF-8 encoding and control characters (fixes #198). 2013-08-27 10:11:32 -07:00
Paul Kulchenko
649e3c620a Added package onIdleOnce event (ref #166). 2013-08-26 20:22:16 -07:00
Paul Kulchenko
0e7bb32024 Fixed package sample to take into account new documents. 2013-08-25 19:19:30 -07:00
Paul Kulchenko
96f0f876bf Renamed package onEditorPostSave event to onEditorSave for consistency (ref #166). 2013-08-24 17:02:06 -07:00
Paul Kulchenko
58a494931c Added manifest to the Windows executable and re-signed. 2013-08-23 16:04:08 -07:00
Paul Kulchenko
f04160fad1 Updated 'get hostname' logic to avoid using non-resolvable names (mostly on OSX). 2013-08-22 20:38:02 -07:00
Paul Kulchenko
671c62871a Added Notepad++ color scheme (thanks to Florian/SiENcE; closes #193). 2013-08-21 08:54:03 -07:00
Paul Kulchenko
6a6e7ec770 Fixed crash on OSX after opening 'application' in 'Open File' dialog. 2013-08-20 14:55:09 -07:00
Paul Kulchenko
eff4eb8b05 Disabled markup styling for specs without comment styles. 2013-08-20 12:09:02 -07:00
Paul Kulchenko
2781c0ea00 Removed comment from default spec as it forces undesired markup styling. 2013-08-20 12:08:27 -07:00
Paul Kulchenko
fa507450e4 Added clearing document styles after saving file with a different extension. 2013-08-20 12:04:11 -07:00
Paul Kulchenko
a4f069afc0 Fixed windows resource file to properly reference the manifest. 2013-08-17 22:24:50 -07:00
Paul Kulchenko
f3b84edc24 Fixed missing default api for files with unknown extensions. 2013-08-16 21:59:17 -07:00
Paul Kulchenko
ba1c1a678e Added workaround to avoid crash on OSX after Close All Pages (closes #190).
The issue is with wxwidgets (filed as ticket 15417); the only workaround I
have been able to find is to disable this functionality on OSX (as there
are other alternatives to closing tabs in groups). The issue only happens
when the last tab is closed from the drop down menu linked to editor tabs.
2013-08-15 15:54:43 -07:00
Paul Kulchenko
267deea3df Merge branch 'master' of git://git.code.sf.net/p/estrelaeditor/code into estrela-new 2013-08-15 15:36:18 -07:00
Paul Kulchenko
1089f2619e Added return type for string.* functions to assist in auto-complete (ref #189). 2013-08-14 12:43:55 -07:00
Paul Kulchenko
e8c5e7fd78 Added handling of string literals in type assignments (closes #189). 2013-08-14 12:37:49 -07:00
Christoph Kubisch
ff6deedf79 OpenGL 4.4 and ARB extensions added as well as NV_gpu_shader5 functions 2013-08-14 14:19:50 +02:00
Paul Kulchenko
52c7150e51 Switched to using POSIX compatible regexp with '()' used for captures. 2013-08-13 14:50:21 -07:00
Paul Kulchenko
24555a3b3d Fix spurious replacement after 'search, clear selection, replace' actions. 2013-08-13 14:47:01 -07:00
Paul Kulchenko
cc432b65b0 Added support for captures in regexp replacement (\1-\9). 2013-08-13 14:39:06 -07:00
Paul Kulchenko
8d1cca26a3 Fixed using auto-complete with multiple selections (fixes #188). 2013-08-11 15:04:42 -07:00
Paul Kulchenko
c077c94371 Fixed looping in auto-complete with array references (ref #143). 2013-08-11 15:00:32 -07:00
Paul Kulchenko
1ba300213d Added ability to cancel FindInFiles search by closing search dialog (ref #162). 2013-08-10 21:38:50 -07:00
Paul Kulchenko
3fbf0ef81b Added activating Output window before showing search results (ref #162). 2013-08-10 21:38:11 -07:00
Paul Kulchenko
aced5d1bc3 Changed un/comment to act from the beginning of the line for multi-line selection.
Fixed handling of EOL markers (un/commenting doesn't modify them anymore).
Added processing of rectangular selections.
2013-08-09 14:52:25 -07:00
Paul Kulchenko
bf072c1685 Added support for packages from different platforms to co-exist (ref #166). 2013-08-07 23:23:14 -07:00
Paul Kulchenko
4215054b87 Improved logic to jump to file/line indicated in error messages. 2013-08-06 09:20:15 -07:00
Paul Kulchenko
cd85d6f2e8 Added ability to save complex data in package settings (ref #166). 2013-08-05 19:12:05 -07:00
Paul Kulchenko
6fc448b87c Fixed incorrect change for line count calculation for dynamic words.
Fixed commit d6cda0d677.
2013-08-04 22:20:59 -07:00
Paul Kulchenko
d6cda0d677 Optimized line count calculation for dynamic words when text is deleted. 2013-08-04 22:12:13 -07:00
Paul Kulchenko
5355234b85 Fixed showing auto-complete after comma. 2013-08-04 21:37:26 -07:00
Paul Kulchenko
700dfe1765 Optimized dynamic word processing for large files. 2013-08-04 20:29:41 -07:00
Paul Kulchenko
1c068c221f Merge branch 'master' of git://git.code.sf.net/p/estrelaeditor/code into estrela-changes 2013-08-04 17:51:53 -07:00
Paul Kulchenko
5679d90bcd Added support for multiple inheritance in auto-complete (ref #101). 2013-08-03 15:38:24 -07:00
Paul Kulchenko
9b5f6fa67f Added ability to add/remove API descriptions from plugins (ref #166). 2013-08-02 11:05:00 -07:00
Christoph Kubisch
a8060b63cd updated glewgl api for OpenGL4.4 and removed non-core duplicate functions/enums 2013-08-02 10:23:52 +02:00
Paul Kulchenko
7324afb8e3 Reorganized API processing to allow loading API description from a plugin. 2013-08-01 11:03:23 -07:00
Paul Kulchenko
e209f3f440 Added package GetSettings/SetSettings methods (ref #166). 2013-07-28 22:24:44 -07:00
Paul Kulchenko
08ef16a42d Added methods to save/restore package settings (ref #166). 2013-07-27 22:23:41 -07:00
Paul Kulchenko
4fafcff592 Fixed 'cannot get official hostname' message on low privilege accounts (fixes #183). 2013-07-26 08:15:53 -07:00
Paul Kulchenko
6e0e3d07e3 Updated Estrela reference in README. 2013-07-25 14:49:03 -07:00
Paul Kulchenko
fb9c0ba0a6 Disabled showing tooltip when auto-complete suggestions are shown. 2013-07-25 14:48:27 -07:00
Paul Kulchenko
1b4f707232 Updated build script on Windows to enable debugging (ref #164). 2013-07-24 09:50:49 -07:00
Paul Kulchenko
1749c54f71 Updated build script with a (temporary) fix for wxlua issue (mingw32). 2013-07-24 09:48:51 -07:00
Paul Kulchenko
e4201b745c Fixed displaying variable instances when code has invalid blocks (fixes #182). 2013-07-23 14:50:29 -07:00
Paul Kulchenko
9c810b3520 Fixed tooltip to ignore string parameters (ref #101). 2013-07-23 10:07:29 -07:00
Paul Kulchenko
93d3b69335 Removed auto-complete suggestion when it is already typed (ref #101). 2013-07-22 18:45:44 -07:00
Paul Kulchenko
35617caa0e Updated tooltip to use the same type inference as auto-complete (ref #101). 2013-07-22 18:21:52 -07:00
Paul Kulchenko
e07ed0a817 Fixed tooltip display between empty brackets (ref #101). 2013-07-22 17:49:39 -07:00
Paul Kulchenko
aeb35ebf6f Added ability to add/remove specs from plugins (ref #166). 2013-07-22 16:11:18 -07:00
Paul Kulchenko
c84bd3222b Enabled support for xml/html folding. 2013-07-21 22:22:30 -07:00
Paul Kulchenko
e398a216a8 Added ability to add/remove interpreters from plugins (ref #166). 2013-07-20 23:21:44 -07:00
Paul Kulchenko
4137b9d88d Added wxlua patch for twoface compatibility. 2013-07-20 15:17:09 -07:00
Paul Kulchenko
a630dd95c7 Added setfenv for Lua 5.2 compatibility. 2013-07-19 12:51:53 -07:00
Paul Kulchenko
0b748d6389 Updated static analyzer to report only first instance of 'unknown field'. 2013-07-18 16:28:12 -07:00
Paul Kulchenko
790f9d5b45 Added links to project page and documentation (closes #180). 2013-07-18 15:26:00 -07:00
Paul Kulchenko
43513c9153 Updated filename/source code heuristic in the debugger (Mobdebug 0.5362).
If the "chunkname" has no newline, it's treated as a file name.
This helps with handling cases when the application engine reports
filenames without @ (for example, when they are loaded using
loadstring("chunk", "file") instead of loadstring("chunk", "@file"));
also helps with debugging cocos2dx apps that load Lua files.
2013-07-18 15:20:59 -07:00
Paul Kulchenko
f58f185850 Enabled path remapping for local debugging.
This helps in local debugging when project files are copied to a temporary
location, but need to be debugged from the project folder (for example,
with debugging of cocos2d-x apps in iOS simulator).
2013-07-18 14:10:54 -07:00
Paul Kulchenko
ebbeb107a7 Disabled error reporting after debugging has been terminated. 2013-07-17 16:54:12 -07:00
Paul Kulchenko
e0674f9c9a Limited activation of code fragments to the beginning of debugging session.
This can still be configured using `editor.autoactivate` option.
2013-07-16 16:52:31 -07:00
Paul Kulchenko
89cafbec45 Enabled slower and more thorough static analysis (ref #149; ref #168). 2013-07-15 22:02:30 -07:00
Paul Kulchenko
e0f543c262 Updated CHANGELOG with recent changes. 2013-07-14 20:27:24 -07:00
Paul Kulchenko
b73526586c Fixed indentation after lines with brackets in strings. 2013-07-13 09:14:12 -07:00
Paul Kulchenko
cc177264f6 Fixed indentation after lines with anonymous functions. 2013-07-12 22:49:55 -07:00
Paul Kulchenko
2f98bc30a6 Added German translation (thanks to Riidom; ref #70). 2013-07-11 16:38:32 -07:00
Paul Kulchenko
b9374894c9 Set search in subdirectories as default in Find in Files dialog (ref #162). 2013-07-10 16:32:26 -07:00
Paul Kulchenko
17a995a810 Fixed indicator showing at the end of not terminated long comment. 2013-07-09 22:54:23 -07:00
Paul Kulchenko
35d1bc0f03 Fixed an issue with LUA_DEV including files instead of directories. 2013-07-07 23:35:15 -07:00
Paul Kulchenko
6f044d8b2e Added default value to package config (ref #176). 2013-07-06 15:27:31 -07:00
Paul Kulchenko
735f8492e2 Fixed project switching to close all files when switching to a subdirectory.
Some of the files could have been left open if the name starts with
the name of a subdirectory the project is being switched to.
2013-07-05 16:52:22 -07:00
Paul Kulchenko
4eb57fcbda Fixed saving projects that do not have any open files. 2013-07-04 16:48:12 -07:00
Paul Kulchenko
c882b8d0e0 Added handling of ?51.dll and required DLLs for LuaForWindows interpreter. 2013-07-03 17:40:01 -07:00
Paul Kulchenko
ce8552f044 Added plugin::GetConfig method (ref #166). 2013-07-03 14:25:06 -07:00
ardente
6968364c58 windows: adopt native user home 2013-07-03 16:39:57 +04:00
Paul Kulchenko
9ab72209c2 Added erasing current line in Console (ref #173). 2013-07-01 18:46:31 -07:00
Paul Kulchenko
c872934157 Added search/completion in the local and remote console (closes #173). 2013-06-30 20:41:42 -07:00
Paul Kulchenko
ea2d7c289a Replaced package onEditorActivated event with onEditorFocus* events (ref #166). 2013-06-30 13:09:44 -07:00
Paul Kulchenko
19ab4df922 Updated SaveAll to allow saving (only) files with filenames (ref #172).
This is useful when `SaveAll` is called from a plugin and user interaction
(asking for a file name) is not desired.
2013-06-30 10:06:19 -07:00
Paul Kulchenko
7dda2c00fd Added package onAppFocus* events (ref #166; ref #172). 2013-06-30 09:27:16 -07:00
Paul Kulchenko
3d3ae5ca00 Fixed debugger to accept filenames without '@'; thanks to Tim Mensch (closes #174). 2013-06-28 21:55:27 -07:00
Paul Kulchenko
28c3b79b8b Added Chinese translation (thanks to Chow CheeWen; ref #70). 2013-06-28 21:37:05 -07:00
Paul Kulchenko
a91bba8bd0 Added editor.autoreload to enable reload of updated files (ref #172).
Thanks for Tim Mensch for suggestion and implementation.
2013-06-26 23:27:31 -07:00
Paul Kulchenko
ed874063ea Added creating (missing) folders when saving a file (fixes #171). 2013-06-25 17:10:57 -07:00
Paul Kulchenko
6259918648 Added an example of styling individual keywords. 2013-06-24 21:03:07 -07:00
Paul Kulchenko
0995c5a061 Added fold indication of a current block (ref #168). 2013-06-24 21:01:49 -07:00
Paul Kulchenko
f07e42c4b4 Fixed sorting when the sorted fragment ends with a newline. 2013-06-24 17:15:02 -07:00
Paul Kulchenko
7e62939df6 Moved 'Sort' menu to 'Edit'. 2013-06-24 17:12:26 -07:00
Paul Kulchenko
b57bf55ef0 Added reporting of process id for a conflicting process. 2013-06-23 21:58:40 -07:00
Paul Kulchenko
8ed91f76cc Disabled 'Fold' menu instead of removing when no folding is allowed (ref #169). 2013-06-22 22:14:20 -07:00
Mika Attila
9e6ec10be9 Make code folding optional
Some users might consider code folding a needless distraction.
Several editors offer the option to turn code folding off.

This commit adds the editor.fold option, which is a boolean.
true enables code folding (default)
false disables code folding
2013-06-22 12:02:31 +02:00
50 changed files with 3694 additions and 2822 deletions

View File

@@ -1,5 +1,109 @@
# ZeroBrane Studio Changelog
## Current master (Aug 29 2013)
### Special thanks
- To Chow CheeWen for Chinese translation.
- To [Riidom](https://github.com/Riidom) for German translation.
- To [ardente](https://github.com/ardente) for user home patch for Windows.
- To [Mika Attila](https://github.com/crumblingstatue) for code folding patch.
- To [Tim Mensch](https://github.com/TimMensch) for auto-save, auto-reload, and debugger improvements.
- To [Florian](https://github.com/SiENcE) for Notepad++ color scheme.
### Improvements
- Added package GetOutput method (ref #166).
- Added package onAppLoad/onAppClose events (ref #166).
- Added package onIdleOnce event (ref #166).
- Added manifest to the Windows executable and re-signed.
- Added Notepad++ color scheme (thanks to Florian/SiENcE; closes #193).
- Added clearing document styles after saving file with a different extension.
- Added workaround to avoid crash on OSX after `Close All Pages` (closes #190).
- Added return type for string.* functions to assist in auto-complete (ref #189).
- Added handling of string literals in type assignments (closes #189).
- Added support for captures in regexp replacement (\1-\9).
- Added ability to cancel FindInFiles search by closing search dialog (ref #162).
- Added activating Output window before showing search results (ref #162).
- Added support for packages from different platforms to co-exist (ref #166).
- Added ability to save complex data in package settings (ref #166).
- Added support for multiple inheritance in auto-complete (ref #101).
- Added ability to add/remove API descriptions from plugins (ref #166).
- Added package GetSettings/SetSettings methods (ref #166).
- Added methods to save/restore package settings (ref #166).
- Added ability to add/remove specs from plugins (ref #166).
- Added ability to add/remove interpreters from plugins (ref #166).
- Added wxlua patch for twoface compatibility.
- Added `setfenv` for Lua 5.2 compatibility.
- Added links to project page and documentation (closes #180).
- Added German translation (thanks to Riidom; ref #70).
- Added default value to package config (ref #176).
- Added handling of ?51.dll and required DLLs for LuaForWindows interpreter.
- Added plugin::GetConfig method (ref #166).
- Added erasing current line in Console (ref #173).
- Added search/completion in the local and remote console (closes #173).
- Added package onAppFocus* events (ref #166; ref #172).
- Added Chinese translation (thanks to Chow CheeWen; ref #70).
- Added `editor.autoreload` to enable reload of updated files (ref #172).
- Added creating (missing) folders when saving a file (fixes #171).
- Added an example of styling individual keywords.
- Added fold indication of a current block (ref #168).
- Added reporting of process id for a conflicting process.
- Changed `un/comment` to act from the beginning of the line for multi-line selection.
- Disabled markup styling for specs without comment styles.
- Disabled showing tooltip when auto-complete suggestions are shown.
- Disabled error reporting after debugging has been terminated.
- Disabled 'Fold' menu instead of removing when no folding is allowed (ref #169).
- Enabled support for xml/html folding.
- Enabled path remapping for local debugging.
- Enabled slower and more thorough static analysis (ref #149; ref #168).
- Improved logic to jump to file/line indicated in error messages.
- Limited activation of code fragments to the beginning of debugging session.
- Make code folding optional (thanks to [Mika Attila](https://github.com/crumblingstatue))
- Moved 'Sort' menu to 'Edit'.
- OpenGL 4.4 and ARB extensions added as well as NV_gpu_shader5 functions
- Optimized line count calculation for dynamic words when text is deleted.
- Optimized dynamic word processing for large files.
- Renamed package onEditorPostSave event to onEditorSave for consistency (ref #166).
- Removed comment from default spec as it forces undesired markup styling.
- Removed auto-complete suggestion when it is already typed (ref #101).
- Reorganized API processing to allow loading API description from a plugin.
- Replaced package onEditorActivated event with onEditorFocus* events (ref #166).
- Set search in subdirectories as default in Find in Files dialog (ref #162).
- Switched to using POSIX compatible regexp with '()' used for captures.
- Updated `NewFile` to accept a file name.
- Updated 'get hostname' logic to avoid using non-resolvable names (mostly on OSX).
- Updated tooltip to use the same type inference as auto-complete (ref #101).
- Updated Estrela reference in README.
- Updated build script on Windows to enable debugging (ref #164).
- Updated build script with a (temporary) fix for wxlua issue (mingw32).
- updated glewgl api for OpenGL4.4 and removed non-core duplicate functions/enums
- Updated static analyzer to report only first instance of 'unknown field'.
- Updated filename/source code heuristic in the debugger (Mobdebug 0.5362).
- Updated `SaveAll` to allow saving (only) files with filenames (ref #172).
- windows: adopt native user home (thanks to [ardente](https://github.com/ardente))
### Fixes
- Fixed loading of files with incorrect UTF-8 encoding and control characters (fixes #198).
- Fixed package sample to take into account new documents.
- Fixed crash on OSX after opening 'application' in 'Open File' dialog.
- Fixed windows resource file to properly reference the manifest.
- Fixed missing default api for files with unknown extensions.
- Fix spurious replacement after 'search, clear selection, replace' actions.
- Fixed using auto-complete with multiple selections (fixes #188).
- Fixed looping in auto-complete with array references (ref #143).
- Fixed showing auto-complete after comma.
- Fixed 'cannot get official hostname' message on low privilege accounts (fixes #183).
- Fixed displaying variable instances when code has invalid blocks (fixes #182).
- Fixed tooltip to ignore string parameters (ref #101).
- Fixed tooltip display between empty brackets (ref #101).
- Fixed indentation after lines with brackets in strings.
- Fixed indentation after lines with anonymous functions.
- Fixed indicator showing at the end of not terminated long comment.
- Fixed an issue with LUA_DEV including files instead of directories.
- Fixed project switching to close all files when switching to a subdirectory.
- Fixed saving projects that do not have any open files.
- Fixed debugger to accept filenames without '@'; thanks to Tim Mensch (closes #174).
- Fixed sorting when the sorted fragment ends with a newline.
## v0.38 (Jun 21 2013)
### Highlights

View File

@@ -42,7 +42,7 @@ Overriding default configuration:
e.g.: zbstudio -cfg "editor.fontsize=12" somefile.lua
Loading custom configuration:
zbstudio -cfg config/file.lua [<filename>]
zbstudio -cfg path/file.lua [<filename>]
e.g.: zbstudio -cfg cfg/estrela.lua
```
@@ -58,12 +58,13 @@ Loading custom configuration:
## Where is Estrela?
The projects have been merged and zbstudio will lead the future.
Please reassociate files with zbstudio. To keep your history of files and
projects copy the contents of the `EstrelaEditor.ini` in your HOME directory
to `ZeroBraneStudio.ini`. If you have used Estrela for graphics shader
authoring or luxinia, create/modify the `cfg/user.lua` to include the content
of `cfg/estrela.lua` to load all tools and specifications by default again.
The projects have been merged and ZeroBrane Studio will lead the future.
Please reassociate files with ZeroBrane Studio. To keep your history of files
and projects copy the contents of the `EstrelaEditor.ini` in your HOME
directory to `ZeroBraneStudio.ini`. If you have used Estrela for graphics
shader authoring or luxinia, create/modify the `cfg/user.lua` to include the
content of `cfg/estrela.lua` to load all tools and specifications by default
again.
## License

View File

@@ -64,6 +64,11 @@ smoothstep = fn "clip and smooth blend [a,b]. - (vecN)(vecN a, b, x)",
floatBitsToInt = fn "returns the 32-bit integer representation of an IEEE 754 floating-point scalar or vector - (uintN/intN)(floatN)",
intBitsToFloat = fn "returns the float value corresponding to a given bit represention.of a scalar int value or vector of int values. - (floatN)(intN)",
uintBitsToFloat = fn "returns the float value corresponding to a given bit represention.of a scalar int value or vector of int values. - (floatN)(uintN)",
doubleBitsToInt64 = fn "returns the 64-bit integer representation of an IEEE 754 double precision floating-point scalar or vector - (int64N)(doubleN)",
doubleBitsToUint64 = fn "returns the 64-bit integer representation of an IEEE 754 double precision floating-point scalar or vector - (uint64N)(doubleN)",
int64BitsToDouble = fn "returns the double value corresponding to a given bit represention.of a scalar int value or vector of int values. - (doubleN)(uint64N)",
uint64BitsToDouble = fn "returns the double value corresponding to a given bit represention.of a scalar int value or vector of int values. - (doubleN)(uint64N)",
fma = fn "return a*b + c, treated as single operation when using precise - (vecN a, vecN b, vecN c)",
frexp = fn "splits scalars and vectors into normalized fraction [0.5,1.0) and a power of 2. - (vecN)(vecN x, out vecN e)",
ldexp = fn "build floating point number from x and the corresponding integral exponen of 2 in exp. - (vecN)(vecN x, exp)",
@@ -73,12 +78,19 @@ packUnorm4x8 = fn "Converts each comp. of v into 8-bit ints, packs results into
packSnorm4x8 = fn "Converts each comp. of v into 8-bit ints, packs results into the returned 32-bit uint. - (uint)(vec4 v)",
packDouble2x32 = fn "Packs components of v into a 64-bit value and returns a double-prec value. - (double)(uvec2 v)",
packHalf2x16 = fn "Converts each comp. of v into 16-bit half float, packs results into the returned 32-bit uint. - (uint)(vec2 v)",
packInt2x32 = fn "Packs two 32 bit into one 64-bit value. - (int64_t)(ivec2)",
packUint2x32 = fn "Packs two 32 bit into one 64-bit value. - (uint64_t)(uvec2)",
packFloat2x16 = fn "returns an unsigned integer obtained by interpreting the components of a two-component 16-bit floating-point as integers and packing them into 32 bit. - (uint)(f16vec2 v)",
unpackUnorm2x16 = fn "Unpacks 32-bit p into two 16-bit uints and converts them to normalized float. - (vec2)(uint p)",
unpackUnorm4x8 = fn "Unpacks 32-bit p into four 8-bit uints and converts them to normalized float. - (vec4)(uint p)",
unpackSnorm4x8 = fn "Unpacks 32-bit p into four 8-bit uints and converts them to normalized float. - (vec4)(uint p)",
unpackDouble2x32 = fn "Returns a 2 component vector representation of v. - (uvec2)(double v)",
unpackHalf2x16 = fn "Interprets p as two 16-bit half floats and returns them as vector. - (vec2)(uint p)",
unpackInt2x32 = fn "Unpacks 64-bit into two 32-bit values. - (ivec2)(int64_t)",
unpackUint2x32 = fn "Unpacks 64-bit into two 32-bit values. - (uvec2)(uint64_t)",
unpackFloat2x16 = fn "returns a two-component vector with 16-bit floating-point components obtained by unpacking a 32-bit unsigned integer into a pair of 16-bit values. - (f16vec2)(uint)",
length = fn "return scalar Euclidean length of a vector. - (type)(vecN)",
distance = fn "return the Euclidean distance between two points. - (vecN)(vecN a, b)",
@@ -170,6 +182,10 @@ textureGather = fn "gather lookup (pixel quad of 4 single channel samples at onc
textureGatherOffset = fn "gather lookup (pixel quad of 4 single channel samples at once) with offset. Component 0: x, 1: y ... is ignored for shadow samplers instead reference value must be passed. Only 2D/Cube. Illegal for MS. - (vec4)(samplerN, vecN coord, [float shadowRefZ], intN offset / intN offset[4] , [int comp])",
texelFetch = fn "integer coordinate lookup for a single texel. No lod parameter for Buffer, MS, Rect. Illegal for Cube - (vec4)(samplerN, intN coord, [int lod/sample])",
texelFetchOffset = fn "integer coordinate lookup for a single texel with offset. No lod parameter for Buffer, MS, Rect. Illegal for Cube, Buffer, MS. - (vec4)(samplerN, intN coord, [int lod/sample], intN offset)",
anyInvocationARB = fn "returns true if and only if <value> is true for at least one active invocation in the group. - (bool)(bool value)",
allInvocationsARB = fn "returns true if and only if <value> is true for all active invocations in the group - (bool)(bool value)",
allInvocationsEqualARB = fn "returns true if <value> is the same for all active invocation in the group. - (bool)(bool value)",
}
local keyw =
@@ -178,6 +194,18 @@ local keyw =
ivec2 ivec3 ivec4 uvec2 uvec3 uvec4 bvec2 bvec3 bvec4
mat2 mat3 mat4 mat2x2 mat3x3 mat4x4 mat2x3 mat3x2 mat4x2 mat2x4 mat4x3 mat3x4
dmat2 dmat3 dmat4 dmat2x2 dmat3x3 dmat4x4 dmat2x3 dmat3x2 dmat4x2 dmat2x4 dmat4x3 dmat3x4
float16_t f16vec2 f16vec3 f16vec4
float32_t f32vec2 f32vec3 f32vec4
float64_t f64vec2 f64vec3 f64vec4
int8_t i8vec2 i8vec3 i8vec4
int8_t i8vec2 i8vec3 i8vec4
int16_t i16vec2 i16vec3 i16vec4
int32_t i32vec2 i32vec3 i32vec4
int64_t i64vec2 i64vec3 i64vec4
uint8_t u8vec2 u8vec3 u8vec4
uint16_t u16vec2 u16vec3 u16vec4
uint32_t u32vec2 u32vec3 u32vec4
uint64_t u64vec2 u64vec3 u64vec4
struct typedef void
usampler1D usampler2D usampler3D usampler2DRect usamplerCube isampler1DArray usampler2DARRAY usamplerCubeArray usampler2DMS usampler2DMSArray
isampler1D isampler2D isampler3D isampler2DRect isamplerCube isampler1DArray isampler2DARRAY isamplerCubeArray isampler2DMS isampler2DMSArray
@@ -189,7 +217,7 @@ local keyw =
layout location vertices line_strip triangle_strip max_vertices stream
triangles quads equal_spacing isolines fractional_even_spacing lines points
fractional_odd_spacing cw ccw point_mode lines_adjacency triangles_adjacency
invocations
invocations offset align xfb_offset xfb_buffer
origin_upper_left pixel_center_integer depth_greater depth_greater depth_greater depth_unchanged
smooth flat noperspective highp mediump lowp shared packed std140 std430 row_major column_major buffer
gl_FrontColor gl_BackColor gl_FrontSecondaryColor gl_BackSecondaryColor gl_Color gl_SecondaryColor
@@ -205,6 +233,7 @@ local keyw =
gl_FragData gl_FragDepth gl_SampleMask
gl_NumWorkGroups gl_WorkGroupSize gl_WorkGroupID gl_LocalInvocationID gl_GlobalInvocationID gl_LocalInvocationIndex
local_size_x local_size_y local_size_z
gl_BaseVertexARB gl_BaseInstanceARB gl_DrawIDARB
coherent volatile restrict readonly writeonly
image1D image2D image3D image2DRect imageCube imageBuffer image1DArray image2DArray imageCubeArray image2DMS image2DMSArray

View File

@@ -324,12 +324,14 @@ return {
description = "Receives zero or more integers. Returns a string with length equal to the number of arguments, in which each character has the internal numerical code equal to its corresponding argument.\n\nNumerical codes are not necessarily portable across platforms.",
args = "(...)",
returns = "(string)",
valuetype = "string",
},
dump = {
type = "function",
description = "Returns a string containing a binary representation of the given function, so that a later load on this string returns a copy of the function (but with new upvalues).",
args = "(function: function)",
returns = "(string)",
valuetype = "string",
},
find = {
type = "function",
@@ -342,6 +344,7 @@ return {
description = "Returns a formatted version of its variable number of arguments following the description given in its first argument (which must be a string).\n\nThe format string follows the same rules as the C function sprintf. The only differences are that the options/modifiers *, h, L, l, n, and p are not supported and that there is an extra option, q. The q option formats a string between double quotes, using escape sequences when necessary to ensure that it can safely be read back by the Lua interpreter.\n\nOptions A and a (when available) (VALUES ADDED IN Lua 5.2), E, e, f, G, and g all expect a number as argument. Options c, d, i, o, u, X, and x also expect a number, but the range of that number may be limited by the underlying C implementation. For options o, u, X, and x, the number cannot be negative. Option q expects a string; option s expects a string without embedded zeros. If the argument to option s is not a string, it is converted to one following the same rules of tostring (BEHAVIOR ADDED IN Lua 5.2).",
args = "(formatstring, ...)",
returns = "(string)",
valuetype = "string",
},
gmatch = {
type = "function",
@@ -354,6 +357,7 @@ return {
description = "Returns a copy of s in which all (or the first n, if given) occurrences of the pattern have been replaced by a replacement string specified by repl, which can be a string, a table, or a function.\n\ngsub also returns, as its second value, the total number of matches that occurred. The name gsub comes from Global SUBstitution.\n\nIf repl is a string, then its value is used for replacement. The character % works as an escape character: any sequence in repl of the form %d, with d between 1 and 9, stands for the value of the d-th captured substring. The sequence %0 stands for the whole match. The sequence %% stands for a single %.\n\nIf repl is a table, then the table is queried for every match, using the first capture as the key.\n\nIf repl is a function, then this function is called every time a match occurs, with all captured substrings passed as arguments, in order.\n\nIn any case, if the pattern specifies no captures, then it behaves as if the whole pattern was inside a capture.\n\nIf the value returned by the table query or by the function call is a string or a number, then it is used as the replacement string; otherwise, if it is false or nil, then there is no replacement (that is, the original match is kept in the string).",
args = "(s: string, pattern: string, repl: string|table|function [, n: number])",
returns = "(string, number)",
valuetype = "string",
},
len = {
type = "function",
@@ -366,36 +370,42 @@ return {
description = "Receives a string and returns a copy of this string with all uppercase letters changed to lowercase.\n\nAll other characters are left unchanged. The definition of what an uppercase letter is depends on the current locale.",
args = "(s: string)",
returns = "(string)",
valuetype = "string",
},
match = {
type = "function",
description = "Looks for the first match of pattern in the string s.\n\nIf it finds one, then match returns the captures from the pattern; otherwise it returns nil.\n\nIf pattern specifies no captures, then the whole match is returned. A third, optional numerical argument init specifies where to start the search; its default value is 1 and can be negative.",
args = "(s: string, pattern: string [, init: number])",
returns = "(string|nil [,...])",
valuetype = "string",
},
rep = {
type = "function",
description = "Returns a string that is the concatenation of n copies of the string s separated by the string sep.\n\nThe default value for sep is the empty string (that is, no separator). ARGUMENT ADDED IN Lua 5.2.",
args = "(s: string, n: number [, sep: string])",
returns = "(string)",
valuetype = "string",
},
reverse = {
type = "function",
description = "Returns a string that is the string s reversed.",
args = "(s: string)",
returns = "(string)",
valuetype = "string",
},
sub = {
type = "function",
description = "Returns the substring of s that starts at i and continues until j; i and j can be negative.\n\nIf j is absent, then it is assumed to be equal to -1 (which is the same as the string length). In particular, the call string.sub(s,1,j) returns a prefix of s with length j, and string.sub(s, -i) returns a suffix of s with length i.\n\nIf, after the translation of negative indices, i is less than 1, it is corrected to 1. If j is greater than the string length, it is corrected to that length. If, after these corrections, i is greater than j, the function returns the empty string.",
args = "(s: string, i: number [, j: number])",
returns = "(string)",
valuetype = "string",
},
upper = {
type = "function",
description = "Receives a string and returns a copy of this string with all lowercase letters changed to uppercase.\n\nAll other characters are left unchanged. The definition of what a lowercase letter is depends on the current locale.",
args = "(s: string)",
returns = "(string)",
valuetype = "string",
},
},
},
@@ -410,6 +420,7 @@ return {
description = "Given a list where all elements are strings or numbers, returns list[i]..sep..list[i+1] ··· sep..list[j].\n\nThe default value for sep is the empty string, the default for i is 1, and the default for j is #list. If i is greater than j, returns the empty string.",
args = "(list: table [, sep: string [, i: number [, j: number]]])",
returns = "(string)",
valuetype = "string",
},
insert = {
type = "function",

File diff suppressed because it is too large Load Diff

View File

@@ -13,7 +13,7 @@
<key>CFBundleIconFile</key>
<string></string>
<key>CFBundleIdentifier</key>
<string></string>
<string>org.Lua.LuaInterpreter</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleLongVersionString</key>

View File

@@ -44,6 +44,10 @@ if [ $# -eq 0 ]; then
exit 0
fi
WXLUASTRIP="/strip"
WXLUABUILD="MinSizeRel"
WXWIDGETSDEBUG="--disable-debug"
# iterate through the command line arguments
for ARG in "$@"; do
case $ARG in
@@ -68,6 +72,10 @@ for ARG in "$@"; do
zbstudio)
BUILD_ZBSTUDIO=true
;;
debug)
WXLUASTRIP=""
WXWIDGETSDEBUG="--enable-debug"
;;
all)
BUILD_WXWIDGETS=true
BUILD_LUA=true
@@ -121,7 +129,7 @@ if [ $BUILD_WXWIDGETS ]; then
svn co "$WXWIDGETS_URL" "$WXWIDGETS_BASENAME" || { echo "Error: failed to checkout wxWidgets"; exit 1; }
svn revert -R "$WXWIDGETS_BASENAME"
cd "$WXWIDGETS_BASENAME"
./configure --prefix="$INSTALL_DIR" --disable-debug --disable-shared --enable-unicode \
./configure --prefix="$INSTALL_DIR" $WXWIDGETSDEBUG --disable-shared --enable-unicode \
--with-libjpeg=builtin --with-libpng=builtin --with-libtiff=no --with-expat=no \
--with-zlib=builtin --disable-richtext \
CFLAGS="-Os -fno-keep-inline-dllexport" CXXFLAGS="-Os -fno-keep-inline-dllexport"
@@ -151,18 +159,26 @@ if [ $BUILD_WXLUA ]; then
cd "$WXLUA_BASENAME/wxLua"
sed -i 's|:-/\(.\)/|:-\1:/|' "$INSTALL_DIR/bin/wx-config"
sed -i 's/execute_process(COMMAND/& sh/' build/CMakewxAppLib.cmake modules/wxstedit/build/CMakewxAppLib.cmake
# the following patches wxlua source to fix live coding support in wxlua apps
# http://www.mail-archive.com/wxlua-users@lists.sourceforge.net/msg03225.html
sed -i 's/\(m_wxlState = wxLuaState(wxlState.GetLuaState(), wxLUASTATE_GETSTATE|wxLUASTATE_ROOTSTATE);\)/\/\/ removed by ZBS build process \/\/ \1/' modules/wxlua/wxlcallb.cpp
# remove check for Lua 5.2 as it doesn't work with Twoface ABI mapper
sed -i 's/LUA_VERSION_NUM < 502/0/' modules/wxlua/wxlcallb.cpp
# (temporary) fix for compilation issue in wxlua in Windows using mingw (r184)
sed -i 's/defined(__MINGW32__) || defined(__GNUWIN32__)/0/' modules/wxbind/src/wxcore_bind.cpp
cp "$INSTALL_DIR/lib/libwxscintilla-2.9.a" "$INSTALL_DIR/lib/libwx_mswu_scintilla-2.9.a"
echo "set_target_properties(wxLuaModule PROPERTIES LINK_FLAGS -static)" >> modules/luamodule/CMakeLists.txt
cmake -G "MSYS Makefiles" -DBUILD_INSTALL_PREFIX="$INSTALL_DIR" -DCMAKE_BUILD_TYPE=MinSizeRel -DBUILD_SHARED_LIBS=FALSE \
cmake -G "MSYS Makefiles" -DBUILD_INSTALL_PREFIX="$INSTALL_DIR" -DCMAKE_BUILD_TYPE=$WXLUABUILD -DBUILD_SHARED_LIBS=FALSE \
-DwxWidgets_CONFIG_EXECUTABLE="$INSTALL_DIR/bin/wx-config" \
-DwxWidgets_COMPONENTS="stc;html;aui;adv;core;net;base" \
-DwxLuaBind_COMPONENTS="stc;html;aui;adv;core;net;base" -DwxLua_LUA_LIBRARY_USE_BUILTIN=FALSE \
-DwxLua_LUA_INCLUDE_DIR="$INSTALL_DIR/include" -DwxLua_LUA_LIBRARY="$INSTALL_DIR/lib/lua51.dll" .
(cd modules/luamodule; make $MAKEFLAGS) || { echo "Error: failed to build wxLua"; exit 1; }
(cd modules/luamodule; make install/strip)
(cd modules/luamodule; make install$WXLUASTRIP)
[ -f "$INSTALL_DIR/bin/libwx.dll" ] || { echo "Error: libwx.dll isn't found"; exit 1; }
cd ../..
rm -rf "$WXLUA_BASENAME"

231
cfg/i18n/cn.lua Normal file
View File

@@ -0,0 +1,231 @@
return {
["%d instance"] = "%d 个体", -- src\editor\findreplace.lua
["&About"] = "关于(&A)", -- src\editor\menu_help.lua
["&Add Watch"] = "添加监视(&A)", -- src\editor\debugger.lua
["&Break"] = "中断", -- src\editor\menu_project.lua
["&Close Page"] = "关闭页面", -- src\editor\menu_file.lua, src\editor\gui.lua
["&Compile"] = "编译", -- src\editor\menu_project.lua
["&Copy"] = "复制", -- src\editor\editor.lua, src\editor\menu_edit.lua
["&Default Layout"] = "布局", -- src\editor\menu_view.lua
["&Delete Watch"] = "删除监视", -- src\editor\debugger.lua
["&Down"] = "往下", -- src\editor\findreplace.lua
["&Edit Watch"] = "编辑监视", -- src\editor\debugger.lua
["&Edit"] = "编辑", -- src\editor\menu_edit.lua
["&File"] = "文件", -- src\editor\menu_file.lua
["&Find All"] = "查找全部", -- src\editor\findreplace.lua
["&Find Next"] = "查找下一个", -- src\editor\findreplace.lua
["&Find"] = "查找", -- src\editor\menu_search.lua
["&Fold/Unfold All"] = "全 折叠/展开", -- src\editor\menu_edit.lua
["&Goto Line"] = "到...行", -- src\editor\menu_search.lua
["&Help"] = "帮助", -- src\editor\menu_help.lua
["&New"] = "新建", -- src\editor\menu_file.lua
["&Open..."] = "打开...", -- src\editor\menu_file.lua
["&Output/Console Window"] = "输出/主控台视窗", -- src\editor\menu_view.lua
["&Paste"] = "粘贴", -- src\editor\editor.lua, src\editor\menu_edit.lua
["&Project"] = "项目", -- src\editor\menu_project.lua, src\editor\inspect.lua
["&Redo"] = "重做", -- src\editor\editor.lua, src\editor\menu_edit.lua
["&Replace All"] = "全替换", -- src\editor\findreplace.lua
["&Replace"] = "替换", -- src\editor\findreplace.lua, src\editor\menu_search.lua
["&Run"] = "执行", -- src\editor\menu_project.lua
["&Save"] = "保存", -- src\editor\menu_file.lua, src\editor\gui.lua
["&Search"] = "搜索", -- src\editor\menu_search.lua
["&Sort"] = "分类", -- src\editor\menu_search.lua
["&Stack Window"] = "叠视窗/堆栈视窗", -- src\editor\menu_view.lua
["&Start Debugger Server"] = "开启除错器伺服机", -- src\editor\menu_project.lua
["&Subdirectories"] = "子文件夹", -- src\editor\findreplace.lua
["&Undo"] = "撤消", -- src\editor\editor.lua, src\editor\menu_edit.lua
["&Up"] = "往上", -- src\editor\findreplace.lua
["&View"] = "视图", -- src\editor\menu_view.lua
["&Watch Window"] = "监视视窗", -- src\editor\menu_view.lua
["About %s"] = "关于 %s", -- src\editor\menu_help.lua
["Add Watch Expression"] = "添加监视表达式", -- src\editor\editor.lua
["Add to Scratchpad"] = "添加至暂存器", -- src\editor\editor.lua
["All files"] = "全部文件", -- src\editor\commands.lua
["Allow external process to start debugging"] = "允许外部进程开启除错", -- src\editor\menu_project.lua
["Analyze the source code"] = "分析源代码", -- src\editor\inspect.lua
["Analyze"] = "分析", -- src\editor\inspect.lua
["Auto Complete Identifiers"] = "自动补全标识符", -- src\editor\menu_edit.lua
["Auto complete while typing"] = "当输入时自动补全", -- src\editor\menu_edit.lua
["Break execution at the next executed line of code"] = "执行下一语句之后中断执行", -- src\editor\menu_project.lua, src\editor\gui.lua
["C&lear Output Window"] = "清除输出视窗", -- src\editor\menu_project.lua
["C&omment/Uncomment"] = "注释/消除注释", -- src\editor\menu_edit.lua
["Can't debug the script in the active editor window."] = "不能在现行编辑视窗对脚本进行除错", -- src\editor\debugger.lua
["Can't find file '%s' in the current project to activate for debugging. Update the project or open the file in the editor before debugging."] = "在当前项目中寻找不到文件 '%s' 以进行激活然后除错, 更新项目或是在编辑器里开启文件后再除错", -- src\editor\debugger.lua
["Can't process auto-recovery record; invalid format: %s."] = "不能处理自动恢复存档: %s", -- src\editor\commands.lua
["Can't run the entry point script ('%s')."] = "不能执行entry point脚本 ('%s')", -- src\editor\debugger.lua
["Can't start debugging session due to internal error '%s'."] = "除错动作失败 '%s'.", -- src\editor\debugger.lua
["Can't start debugging without an opened file or with the current file not being saved ('%s')."] = "不能启动除错,没有文档被开启或当前更改过的文档还没保存('%s')", -- src\editor\debugger.lua
["Cancel"] = "取消", -- src\editor\findreplace.lua
["Choose ..."] = "请选 ...", -- src\editor\menu_project.lua
["Choose a project directory"] = "选择项目文件夹", -- src\editor\findreplace.lua, src\editor\menu_project.lua
["Clear &Dynamic Words"] = "清除动态词汇", -- src\editor\menu_edit.lua
["Clear the output window before compiling or debugging"] = "编译或除错前清除输出视窗", -- src\editor\menu_project.lua
["Close &Other Pages"] = "关闭其他页面", -- src\editor\gui.lua
["Close A&ll Pages"] = "关闭全部页面", -- src\editor\gui.lua
["Close the current editor window"] = "关闭当前编译视窗", -- src\editor\menu_file.lua
["Co&ntinue"] = "继续", -- src\editor\menu_project.lua
["Col: %d"] = "列: %d", -- src\editor\editor.lua
["Comment or uncomment current or selected lines"] = "注释/消除注释 当前或被选的语句", -- src\editor\menu_edit.lua
["Compilation error"] = "编译错误", -- src\editor\debugger.lua, src\editor\commands.lua
["Compilation successful; %.0f%% success rate (%d/%d)."] = "编译成功; 成功率: %.0f%% (%d/%d).", -- src\editor\commands.lua
["Compile the current file"] = "编译当前的文档", -- src\editor\menu_project.lua
["Complete &Identifier"] = "补全标识符", -- src\editor\menu_edit.lua
["Complete the current identifier"] = "补全当前标识符", -- src\editor\menu_edit.lua
["Copy selected text to clipboard"] = "复制被选的text到clipboard", -- src\editor\menu_edit.lua
["Couldn't activate file '%s' for debugging; continuing without it."] = "不能激活 '%s' 以除错; 省略后继续进行", -- src\editor\debugger.lua
["Create an empty document"] = "新建空文档", -- src\editor\menu_file.lua, src\editor\gui.lua
["Cu&t"] = "剪切", -- src\editor\editor.lua, src\editor\menu_edit.lua
["Cut selected text to clipboard"] = "剪切被选的text到clipboard", -- src\editor\menu_edit.lua
["Debugger server started at %s:%d."] = "除错伺服器起始于 %s:%d.", -- src\editor\debugger.lua
["Debugging session completed (%s)."] = "除错会话完成 (%s)", -- src\editor\debugger.lua
["Debugging session started in '%s'."] = "除错会话于 '%s' 起始", -- src\editor\debugger.lua
["Debugging suspended at %s:%s (couldn't activate the file)."] = "除错挂起于 %s:%s (不能激活文档).", -- src\editor\debugger.lua
["Directory"] = "文件夹", -- src\editor\findreplace.lua
["Do you want to reload it?"] = "需要重新导入吗?", -- src\editor\editor.lua
["Do you want to save the changes to '%s'?"] = "需要把更改保存于 '%s'?", -- src\editor\commands.lua
["E&xit"] = "离开", -- src\editor\menu_file.lua
["Enter Lua code and press Enter to run it."] = "输入Lua代码然后按 <Enter> 以执行", -- src\editor\shellbox.lua
["Enter line number"] = "输入行号码", -- src\editor\menu_search.lua
["Error while loading API file: %s"] = "导入API档时出错误: %s", -- src\editor\autocomplete.lua
["Error while loading configuration file: %s"] = "导入configuration档时出错误: %s", -- src\editor\style.lua
["Error while processing API file: %s"] = "处理API档时出错误: %s", -- src\editor\autocomplete.lua
["Error while processing configuration file: %s"] = "处理configuration档时出错误: %s", -- src\editor\style.lua
["Error"] = "错误", -- src\editor\commands.lua
["Evaluate in Console"] = "在主控台中估值", -- src\editor\editor.lua
["Execute the current project/file and keep updating the code to see immediate results"] = "执行当前项目/文档和更新代码以便得到执行结果", -- src\editor\menu_project.lua
["Execute the current project/file"] = "执行当前项目/文档", -- src\editor\menu_project.lua
["Execution error"] = "执行出错误", -- src\editor\debugger.lua
["Exit program"] = "离开程式", -- src\editor\menu_file.lua
["Expr"] = "表达式", -- src\editor\debugger.lua
["Expression"] = "表达式", -- src\editor\debugger.lua
["File '%s' has been modified on disk."] = "磁碟上的文档 '%s' 已被更改", -- src\editor\editor.lua
["File '%s' has more recent timestamp than restored '%s'; please review before saving."] =
"文档 '%s' 的时间戳比 '%s' 更新近; 请检验后再保存", -- src\editor\commands.lua
["File '%s' no longer exists."] = "文档 '%s' 已不存在", -- src\editor\editor.lua, src\editor\menu_file.lua
["File Type"] = "文档类", -- src\editor\findreplace.lua
["File history"] = "文档历史", -- src\editor\menu_file.lua
["Find &In Files"] = "在文档中查找", -- src\editor\menu_search.lua
["Find &Next"] = "查找下一个", -- src\editor\menu_search.lua
["Find &Previous"] = "查找上一个", -- src\editor\menu_search.lua
["Find In Files"] = "在文档中查找", -- src\editor\findreplace.lua
["Find and replace text in files"] = "在文档中查找text然后更换", -- src\editor\menu_search.lua
["Find and replace text"] = "查找text然后更换", -- src\editor\menu_search.lua, src\editor\gui.lua
["Find text in files"] = "在文档中查找text", -- src\editor\menu_search.lua
["Find text"] = "查找text", -- src\editor\menu_search.lua, src\editor\gui.lua
["Find the earlier text occurence"] = "查找之前出现的text", -- src\editor\menu_search.lua
["Find the next text occurrence"] = "查找之後将出现的text", -- src\editor\menu_search.lua
["Find"] = "查找", -- src\editor\findreplace.lua
["Fold or unfold all code folds"] = "折叠/展开所有代码折叠", -- src\editor\menu_edit.lua
["Found auto-recovery record and restored saved session."] = "找到自动恢复存档和恢复已存对话", -- src\editor\commands.lua
["Found"] = "找到", -- src\editor\findreplace.lua
["Full &Screen"] = "全屏", -- src\editor\menu_view.lua
["Go to a selected line"] = "到所选的行", -- src\editor\menu_search.lua
["Goto Line"] = "到...行", -- src\editor\menu_search.lua
["INS"] = "INS", -- src\editor\editor.lua
["In Files"] = "在档案里", -- src\editor\findreplace.lua
["Jump to a function definition..."] = "跳到函数定义", -- src\editor\editor.lua
["Known Files"] = "所知的文档", -- src\editor\commands.lua
["Ln: %d"] = "行: %d", -- src\editor\editor.lua
["Local console"] = "本地主控台", -- src\editor\shellbox.lua, src\editor\gui.lua
["Lua &Interpreter"] = "Lua 解释器", -- src\editor\menu_project.lua
["Mapped remote request for '%s' to '%s'."] = "映射远程请求 '%s' 至 '%s'", -- src\editor\debugger.lua
["Match &case"] = "case匹配", -- src\editor\findreplace.lua
["Match &whole word"] = "全句匹配", -- src\editor\findreplace.lua
["Mixed end-of-line encodings detected."] = "发现混杂的EOL编码", -- src\editor\commands.lua
["OVR"] = "OVR", -- src\editor\editor.lua
["Open an existing document"] = "打开现存文档", -- src\editor\menu_file.lua, src\editor\gui.lua
["Open file"] = "打开文档", -- src\editor\commands.lua
["Options"] = "选项", -- src\editor\findreplace.lua
["Output (running)"] = "输出 (进行中)", -- src\editor\output.lua
["Output"] = "输出", -- src\editor\output.lua, src\editor\settings.lua, src\editor\gui.lua
["Paste text from the clipboard"] = "从clipboard粘贴text", -- src\editor\menu_edit.lua
["Preferences"] = "首选项", -- src\editor\menu_edit.lua
["Prepend '=' to show complex values on multiple lines."] = "在多行展现复杂值请前置 '='", -- src\editor\shellbox.lua
["Press cancel to abort."] = "按 <cancel> 以退出", -- src\editor\commands.lua
["Program '%s' started in '%s' (pid: %d)."] = "程式 '%s' 执行于 '%s' (pid: %d).", -- src\editor\output.lua
["Program can't start because conflicting process is running as '%s'."] = "程序不能启动因为有名为 '%s' 的冲突进程", -- src\editor\output.lua
["Program completed in %.2f seconds (pid: %d)."] = "程序于 %.2f 秒完成 (pid: %d).", -- src\editor\output.lua
["Program starting as '%s'."] = "程式以 '%s' 执行", -- src\editor\output.lua
["Program stopped (pid: %d)."] = "程式停止 (pid: %d).", -- src\editor\debugger.lua
["Program unable to run as '%s'."] = "程式不能以 '%s' 执行", -- src\editor\output.lua
["Project Directory"] = "项目文件夹", -- src\editor\menu_project.lua
["Project"] = "项目", -- src\editor\settings.lua, src\editor\gui.lua
["Project/&FileTree Window"] = "项目/文档树 视窗", -- src\editor\menu_view.lua
["R/O"] = "唯读", -- src\editor\editor.lua
["R/W"] = "读写", -- src\editor\editor.lua
["Re&place In Files"] = "在文档中替换", -- src\editor\menu_search.lua
["Recent Files"] = "最近的文档", -- src\editor\menu_file.lua
["Redo last edit undone"] = "重做最后被取消的编辑", -- src\editor\menu_edit.lua
["Refused a request to start a new debugging session as there is one in progress already."] = "因为有另一个除错在进行,拒绝开启新的除错对话", -- src\editor\debugger.lua
["Regular &expression"] = "正则表达式", -- src\editor\findreplace.lua
["Remote console"] = "远程主控台", -- src\editor\shellbox.lua
["Replace &All"] = "更换全部", -- src\editor\findreplace.lua
["Replace"] = "更换", -- src\editor\findreplace.lua
["Replaced an invalid UTF8 character with %s."] = "以%s更换无效的UTF8字元", -- src\editor\commands.lua
["Replaced"] = "更换", -- src\editor\findreplace.lua
["Replacing"] = "更换中", -- src\editor\findreplace.lua
["Reset to default layout"] = "重置缺省布局", -- src\editor\menu_view.lua
["Resets the dynamic word list for autocompletion"] = "为自动补全重置动态word list", -- src\editor\menu_edit.lua
["Run as Scratchpad"] = "以Scratchpad执行", -- src\editor\menu_project.lua
["S&top Debugging"] = "停止除错", -- src\editor\menu_project.lua
["S&top Process"] = "停止进程", -- src\editor\menu_project.lua
["Save &As..."] = "另存为...", -- src\editor\menu_file.lua, src\editor\gui.lua
["Save A&ll"] = "全部存档", -- src\editor\menu_file.lua
["Save Changes?"] = "存档更新?", -- src\editor\commands.lua
["Save all open documents"] = "保存所有开启的文档", -- src\editor\menu_file.lua, src\editor\gui.lua
["Save file as"] = "文档另存为", -- src\editor\commands.lua
["Save file?"] = "保存文档?", -- src\editor\commands.lua
["Save the current document to a file with a new name"] = "用新档案名称保存当前文档", -- src\editor\menu_file.lua
["Save the current document"] = "保存当前文档", -- src\editor\menu_file.lua, src\editor\gui.lua
["Saved auto-recover at %s."] = "在 %s 存档自动恢复", -- src\editor\commands.lua
["Scope"] = "范围", -- src\editor\findreplace.lua
["Scratchpad error"] = "暂存器错误", -- src\editor\debugger.lua
["Searching for"] = "搜索", -- src\editor\findreplace.lua
["Select &All"] = "选全部", -- src\editor\editor.lua, src\editor\menu_edit.lua
["Select all text in the editor"] = "选编辑器内的所有text", -- src\editor\menu_edit.lua
["Set From Current File"] = "从当前文档设置", -- src\editor\menu_project.lua
["Set project directory from current file"] = "从当前文档设置项目文件夹", -- src\editor\menu_project.lua, src\editor\gui.lua
["Set the interpreter to be used"] = "设置解释器", -- src\editor\menu_project.lua
["Set the project directory to be used"] = "设置项目文件夹", -- src\editor\menu_project.lua
["Settings: System"] = "设置: 系统", -- src\editor\menu_edit.lua
["Settings: User"] = "设置: 用户", -- src\editor\menu_edit.lua
["Show &Tooltip"] = "展现tooltip", -- src\editor\menu_edit.lua
["Show tooltip for current position; place cursor after opening bracket of function"] = "在当前的位置展现tooltip; 把游标放置于函数的开括号之后", -- src\editor\menu_edit.lua
["Sort selected lines"] = "对被选的行进行排列", -- src\editor\menu_search.lua
["Stack"] = "堆栈", -- src\editor\debugger.lua
["Start &Debugging"] = "开始除错", -- src\editor\menu_project.lua
["Start debugging"] = "开始除错", -- src\editor\menu_project.lua, src\editor\gui.lua
["Step &Into"] = "除错运行 进入子程序/函数", -- src\editor\menu_project.lua
["Step &Over"] = "除错运行 掠过子程序/函数", -- src\editor\menu_project.lua
["Step O&ut"] = "除错运行 离开子程序/函数", -- src\editor\menu_project.lua
["Step into"] = "除错运行 进入子程序/函数", -- src\editor\menu_project.lua, src\editor\gui.lua
["Step out of the current function"] = "除错运行 离开当前的函数", -- src\editor\menu_project.lua, src\editor\gui.lua
["Step over"] = "除错运行 掠过子程序/函数", -- src\editor\menu_project.lua, src\editor\gui.lua
["Stop the currently running process"] = "终止目前进行着的进程", -- src\editor\menu_project.lua, src\editor\gui.lua
["Switch to or from full screen mode"] = "切换全屏模式", -- src\editor\menu_view.lua
["Text not found."] = "寻找不到text", -- src\editor\findreplace.lua
["The API file must be located in a subdirectory of the API directory."] = "API file必须存放在API文件夹中的子文件夹", -- src\editor\autocomplete.lua
["Toggle Break&point"] = "切换中断点", -- src\editor\menu_project.lua
["Toggle breakpoint"] = "切换中断点", -- src\editor\menu_project.lua, src\editor\gui.lua
["Tr&ace"] = "追踪", -- src\editor\menu_project.lua
["Trace execution showing each executed line"] = "执行追踪展示每一执行过的语句", -- src\editor\menu_project.lua
["Unable to load file '%s'."] = "导出文件失败 '%s'.", -- src\editor\commands.lua
["Unable to save file '%s': %s"] = "保存文件失败 '%s': %s", -- src\editor\commands.lua
["Unable to stop program (pid: %d), code %d."] = "停止程序失败 (pid: %d), 代码 %d.", -- src\editor\debugger.lua
["Undo last edit"] = "清除前编辑动作", -- src\editor\menu_edit.lua
["Use '%s' to see full description."] = "用 '%s' 来看全解析", -- src\editor\editor.lua
["Use '%s' to show line endings and '%s' to convert them."] = "用 '%s' 来显示语句的终结和 '%s' 来进行转换", -- src\editor\commands.lua
["Use 'clear' to clear the shell output and the history."] = "用 'clear' 来清除shell的输出和历史", -- src\editor\shellbox.lua
["Use Shift-Enter for multiline code."] = "用 <Shift-Enter> 来处理多行代码", -- src\editor\shellbox.lua
["Value"] = "数值", -- src\editor\debugger.lua
["View the output/console window"] = "查看输出/主控台视窗", -- src\editor\menu_view.lua
["View the project/filetree window"] = "查看项目/文件树视窗", -- src\editor\menu_view.lua
["View the stack window"] = "查看堆栈视窗", -- src\editor\menu_view.lua, src\editor\gui.lua
["View the watch window"] = "查看监视视窗", -- src\editor\menu_view.lua, src\editor\gui.lua
["Watch"] = "监视", -- src\editor\debugger.lua
["Welcome to the interactive Lua interpreter."] = "欢迎来到互动 Lua interpreter.", -- src\editor\shellbox.lua
["Wrap ar&ound"] = "卷绕", -- src\editor\findreplace.lua
["You must save the program first."] = "必须先保存程序", -- src\editor\commands.lua
["on line %d"] = "在 %d 行", -- src\editor\debugger.lua, src\editor\commands.lua
["traced %d instruction"] = "追踪 %d 指令", -- src\editor\debugger.lua
}

236
cfg/i18n/de.lua Normal file
View File

@@ -0,0 +1,236 @@
return {
[0] = function(c) return c == 1 and 1 or 2 end, -- plural
["%d instance"] = {"%d Instanz", "%d Instanzen"}, -- src\editor\findreplace.lua
["%s event failed: %s"] = "Ereignis fehlgeschlagen : %s", -- src\editor\package.lua
["&About"] = "&Über", -- src\editor\menu_help.lua
["&Add Watch"] = "&Beobachtungspunkt hinzufügen", -- src\editor\debugger.lua
["&Break"] = "&Unterbrechung", -- src\editor\menu_project.lua
["&Close Page"] = "S&eite schließen", -- src\editor\menu_file.lua, src\editor\gui.lua
["&Compile"] = "&Compiler", -- src\editor\menu_project.lua
["&Copy"] = "&Kopieren", -- src\editor\editor.lua, src\editor\menu_edit.lua
["&Default Layout"] = "Standard-&Layout", -- src\editor\menu_view.lua
["&Delete Watch"] = "&Beobachtungspunkt entfernen", -- src\editor\debugger.lua
["&Down"] = "&Runter", -- src\editor\findreplace.lua
["&Edit Watch"] = "&Beobachtungspunkt bearbeiten", -- src\editor\debugger.lua
["&Edit"] = "&Bearbeiten", -- src\editor\menu_edit.lua
["&File"] = "&Datei", -- src\editor\menu_file.lua
["&Find All"] = "&Alle finden", -- src\editor\findreplace.lua
["&Find Next"] = "&Nächsten finden", -- src\editor\findreplace.lua
["&Find"] = "&Finden", -- src\editor\menu_search.lua
["&Fold/Unfold All"] = "A&lles ein-/ausklappen", -- src\editor\menu_edit.lua
["&Goto Line"] = "&Gehe zu Zeile", -- src\editor\menu_search.lua
["&Help"] = "&Hilfe", -- src\editor\menu_help.lua
["&New"] = "&Neu", -- src\editor\menu_file.lua
["&Open..."] = "&Öffnen...", -- src\editor\menu_file.lua
["&Output/Console Window"] = "&Ausgabefenster/Konsole", -- src\editor\menu_view.lua
["&Paste"] = "&Einfügen", -- src\editor\editor.lua, src\editor\menu_edit.lua
["&Project"] = "&Projekt", -- src\editor\menu_project.lua, src\editor\inspect.lua
["&Redo"] = "&Wiederholen", -- src\editor\editor.lua, src\editor\menu_edit.lua
["&Replace All"] = "&Alles ersetzen", -- src\editor\findreplace.lua
["&Replace"] = "&Ersetzen", -- src\editor\findreplace.lua, src\editor\menu_search.lua
["&Run"] = "&Starten", -- src\editor\menu_project.lua
["&Save"] = "&Speichern", -- src\editor\menu_file.lua, src\editor\gui.lua
["&Search"] = "&Suchen", -- src\editor\menu_search.lua
["&Sort"] = "&Sortieren", -- src\editor\menu_search.lua
["&Stack Window"] = "&Stapel/Stack", -- src\editor\menu_view.lua
["&Start Debugger Server"] = "De&bugserver starten", -- src\editor\menu_project.lua
["&Subdirectories"] = "&Unterverzeichnisse", -- src\editor\findreplace.lua
["&Undo"] = "&Rückgängig", -- src\editor\editor.lua, src\editor\menu_edit.lua
["&Up"] = "&Hoch", -- src\editor\findreplace.lua
["&View"] = "&Ansicht", -- src\editor\menu_view.lua
["&Watch Window"] = "&Beobachtungspunkte", -- src\editor\menu_view.lua
[".&bak on Replace"] = ".&bak bei Ersetzen", -- src\editor\findreplace.lua
["About %s"] = "Über %s", -- src\editor\menu_help.lua
["Add Watch Expression"] = "Beobachtungspunkt hinzufügen", -- src\editor\editor.lua
["Add To Scratchpad"] = "Zu Entwurf hinzufügen", -- src\editor\editor.lua
["All files"] = "Alle Dateien", -- src\editor\commands.lua
["Allow external process to start debugging"] = "Externem Prozeß erlauben, den Debugger zu starten", -- src\editor\menu_project.lua
["Analyze the source code"] = "Quellcode analysieren", -- src\editor\inspect.lua
["Analyze"] = "&Analyseroutine", -- src\editor\inspect.lua
["Auto Complete Identifiers"] = "Auto-Vervollständigen von Bezeichnern", -- src\editor\menu_edit.lua
["Auto complete while typing"] = "Auto-Vervollständigen beim Tippen", -- src\editor\menu_edit.lua
["Break execution at the next executed line of code"] = "Programmausführung bei der nächsten ausgeführten Zeile stoppen", -- src\editor\menu_project.lua, src\editor\gui.lua
["C&lear Output Window"] = "Ausgabefenster &löschen", -- src\editor\menu_project.lua
["C&omment/Uncomment"] = "(Aus-)/&Kommentieren", -- src\editor\menu_edit.lua
["Can't debug the script in the active editor window."] = "Script kann im aktiven Editorfenster nicht gedebuggt werden.", -- src\editor\debugger.lua
["Can't find file '%s' in the current project to activate for debugging. Update the project or open the file in the editor before debugging."] = "Kann Datei '%s' zwecks Debugging im aktuellen Projekt nicht finden. Bitte Projekt aktualisieren oder Datei in den Editor laden.", -- src\editor\debugger.lua
["Can't process auto-recovery record; invalid format: %s."] = "Auto-Wiederherstellen nicht möglich; ungültiges Format: %s.", -- src\editor\commands.lua
["Can't run the entry point script ('%s')."] = "Kann Script für Einsprungspunkt ('%s') nicht ausführen.", -- src\editor\debugger.lua
["Can't start debugging session due to internal error '%s'."] = "Debugging kann nicht gestartet werden wegen internem Fehler '%s'.", -- src\editor\debugger.lua
["Can't start debugging without an opened file or with the current file not being saved ('%s')."] = "Debugging kann nicht gestartet werden ohne geöffnete Datei oder wenn die aktuelle Datei nicht gespeichert ist ('%s').", -- src\editor\debugger.lua
["Cancel"] = "Abbrechen", -- src\editor\findreplace.lua
["Choose ..."] = "Wählen...", -- src\editor\menu_project.lua
["Choose a project directory"] = "Projektverzeichnis auswählen", -- src\editor\findreplace.lua, src\editor\menu_project.lua
["Clear &Dynamic Words"] = "&Dynamic Words löschen", -- src\editor\menu_edit.lua
["Clear the output window before compiling or debugging"] = "Vor Kompilieren oder Debuggen das Ausgabefenster löschen", -- src\editor\menu_project.lua
["Close &Other Pages"] = "A&ndere Seiten schließen", -- src\editor\gui.lua
["Close A&ll Pages"] = "&Alle Seiten schließen", -- src\editor\gui.lua
["Close the current editor window"] = "Aktuelles Editorfenster schließen", -- src\editor\menu_file.lua
["Co&ntinue"] = "&Fortsetzen", -- src\editor\menu_project.lua
["Col: %d"] = "Spalte: %d", -- src\editor\editor.lua
["Comment or uncomment current or selected lines"] = "Ausgewählte bzw. aktive Zeile (un-)kommentieren", -- src\editor\menu_edit.lua
["Compilation error"] = "Fehler beim Kompilieren", -- src\editor\debugger.lua, src\editor\commands.lua
["Compilation successful; %.0f%% success rate (%d/%d)."] = "Kompilieren erfolgreich; Erfolgsquote von %.0f%% (%d/%d).", -- src\editor\commands.lua
["Compile the current file"] = "Aktuelle Datei kompilieren", -- src\editor\menu_project.lua
["Complete &Identifier"] = "&Bezeichner vervollständigen", -- src\editor\menu_edit.lua
["Complete the current identifier"] = " Aktuellen Bezeichner vervollständigen", -- src\editor\menu_edit.lua
["Copy selected text to clipboard"] = "Text in Zwischenablage kopieren", -- src\editor\menu_edit.lua
["Couldn't activate file '%s' for debugging; continuing without it."] = "Konnte Datei '%s' zwecks nicht Debugging aktivieren; fahre ohne die Datei fort.", -- src\editor\debugger.lua
["Create an empty document"] = "Leeres Dokument anlegen", -- src\editor\menu_file.lua, src\editor\gui.lua
["Cu&t"] = "A&usschneiden", -- src\editor\editor.lua, src\editor\menu_edit.lua
["Cut selected text to clipboard"] = "Schneide ausgewählten Text in die Zwischenablage hinein", -- src\editor\menu_edit.lua
["Debugger server started at %s:%d."] = "Debugserver gestartet an %s:%d.", -- src\editor\debugger.lua
["Debugging session completed (%s)."] = "Debugging Session beendet (%s).", -- src\editor\debugger.lua
["Debugging session started in '%s'."] = "Debugging Session gestartet '%s'.", -- src\editor\debugger.lua
["Debugging suspended at %s:%s (couldn't activate the file)."] = "Debugging angehalten bei %s:%s (konnte Datei nicht aktivieren).", -- src\editor\debugger.lua
["Directory"] = "Verzeichnis", -- src\editor\findreplace.lua
["Do you want to reload it?"] = "Neu laden?", -- src\editor\editor.lua
["Do you want to save the changes to '%s'?"] = "Änderungen an '%s' speichern?", -- src\editor\commands.lua
["E&xit"] = "&Beenden", -- src\editor\menu_file.lua
["Enter Lua code and press Enter to run it."] = "Lua-Code eingeben und Enter drücken zum Ausführen.", -- src\editor\shellbox.lua
["Enter line number"] = "Zeilennummer eingeben", -- src\editor\menu_search.lua
["Error while loading API file: %s"] = "Fehler beim Laden von API-Datei: %s", -- src\editor\autocomplete.lua
["Error while loading configuration file: %s"] = "Fehler beim Laden von Konfigurationsdatei: %s", -- src\editor\style.lua
["Error while processing API file: %s"] = "Fehler beim Lesen von API-Datei: %s", -- src\editor\autocomplete.lua
["Error while processing configuration file: %s"] = "Fehler beim Lesen von Konfiguratonsdatei: %s", -- src\editor\style.lua
["Error"] = "Fehler", -- src\editor\commands.lua
["Evaluate In Console"] = "In Konsole auswerten", -- src\editor\editor.lua
["Execute the current project/file and keep updating the code to see immediate results"] = "Aktuelles Projekt/ aktuelle Datei ausführen und Quellcode ändern, um Ergebnisse in Echtzeit zu sehen", -- src\editor\menu_project.lua
["Execute the current project/file"] = "Aktuelles Projekt/ aktuelle Datei ausführen", -- src\editor\menu_project.lua
["Execution error"] = "Fehler bei Ausführung", -- src\editor\debugger.lua
["Exit program"] = "Programm beenden", -- src\editor\menu_file.lua
["Expr"] = "Ausdr.", -- src\editor\debugger.lua
["Expression"] = "Ausdruck", -- src\editor\debugger.lua
["File '%s' has been modified on disk."] = "Datei '%s' wurde auf der Festplatte geändert.", -- src\editor\editor.lua
["File '%s' has more recent timestamp than restored '%s'; please review before saving."] = "Datei '%s' hat neueren Zeitstempel als wiederhergestellte Datei '%s'; bitte vor dem Speichern kontrollieren.", -- src\editor\commands.lua
["File '%s' no longer exists."] = "Datei '%s' existiert nicht mehr.", -- src\editor\editor.lua, src\editor\menu_file.lua
["File Type"] = "Dateityp", -- src\editor\findreplace.lua
["File history"] = "Dateiverlauf", -- src\editor\menu_file.lua
["Find &In Files"] = "Finde &in Dateien", -- src\editor\menu_search.lua
["Find &Next"] = "Finde &Nächste", -- src\editor\menu_search.lua
["Find &Previous"] = "Finde &Vorherige", -- src\editor\menu_search.lua
["Find In Files"] = "Finde in Dateien", -- src\editor\findreplace.lua
["Find and replace text in files"] = "Finde und ersetze Text in Dateien", -- src\editor\menu_search.lua
["Find and replace text"] = "Finde und ersetze Text", -- src\editor\menu_search.lua, src\editor\gui.lua
["Find text in files"] = "Finde Text in Dateien", -- src\editor\menu_search.lua
["Find text"] = "Finde Text", -- src\editor\menu_search.lua, src\editor\gui.lua
["Find the earlier text occurence"] = "Finde vorheriges Auftreten des Textes", -- src\editor\menu_search.lua
["Find the next text occurrence"] = "Finde nächstes Auftreten des Textes", -- src\editor\menu_search.lua
["Find"] = "Finden", -- src\editor\findreplace.lua
["Fold or unfold all code folds"] = "Alle Stellen im Code ein-/ausklappen ", -- src\editor\menu_edit.lua
["Found auto-recovery record and restored saved session."] = "Autowiederherstellen-Aufzeichnung gefunden und vorherige Sitzung wiederhergestellt.", -- src\editor\commands.lua
["Found"] = "Gefunden", -- src\editor\findreplace.lua
["Full &Screen"] = "&Vollbild", -- src\editor\menu_view.lua
["Go To Definition"] = "Gehe zu Definition", -- src\editor\editor.lua
["Go to a selected line"] = "Gehe zu ausgewählter Zeile", -- src\editor\menu_search.lua
["Goto Line"] = "Gehe zu Zeile", -- src\editor\menu_search.lua
["INS"] = "INS", -- src\editor\editor.lua
["In Files"] = "In Dateien", -- src\editor\findreplace.lua
["Jump to a function definition..."] = "Springe zu Funktions-Definition...", -- src\editor\editor.lua
["Known Files"] = "Bekannte Dateien", -- src\editor\commands.lua
["Ln: %d"] = "Zeile: %d", -- src\editor\editor.lua
["Local console"] = "Lokale Konsole", -- src\editor\shellbox.lua, src\editor\gui.lua
["Lua &Interpreter"] = "&Lua Interpreter", -- src\editor\menu_project.lua
["Mapped remote request for '%s' to '%s'."] = "Mapped remote request for '%s' to '%s'.", -- src\editor\debugger.lua
["Match &case"] = "&Groß-/Kleinschreibung", -- src\editor\findreplace.lua
["Match &whole word"] = "Ganzes &Wort", -- src\editor\findreplace.lua
["Mixed end-of-line encodings detected."] = "Gemischte End-of-Line Kodierung entdeckt.", -- src\editor\commands.lua
["OVR"] = "OVR", -- src\editor\editor.lua
["Open an existing document"] = "Öffne existierendes Dokument", -- src\editor\menu_file.lua, src\editor\gui.lua
["Open file"] = "Öffne Datei", -- src\editor\commands.lua
["Options"] = "Optionen", -- src\editor\findreplace.lua
["Output (running)"] = "Ausgabe (ausgeführt)", -- src\editor\output.lua
["Output"] = "Ausgabe", -- src\editor\output.lua, src\editor\settings.lua, src\editor\gui.lua
["Paste text from the clipboard"] = "Text aus Zwischenablage einfügen", -- src\editor\menu_edit.lua
["Preferences"] = "Einstellungen", -- src\editor\menu_edit.lua
["Prepend '=' to show complex values on multiple lines."] = "'=' voranstellen, um komplexe Ausdrücke auf mehrere Zeilen zu verteilen.", -- src\editor\shellbox.lua
["Press cancel to abort."] = "Abbrechen Drücken zum Beenden.", -- src\editor\commands.lua
["Program '%s' started in '%s' (pid: %d)."] = "Programm '%s' gestartet in '%s' (pid : %d).", -- src\editor\output.lua
["Program can't start because conflicting process is running as '%s'."] = "Programm kann nicht starten, da blockierender Prozeß als '%s' läuft.", -- src\editor\output.lua
["Program completed in %.2f seconds (pid: %d)."] = "Programm beendet nach %.2f Sekunden (pid : %d).", -- src\editor\output.lua
["Program starting as '%s'."] = "Programm gestartet als '%s'.", -- src\editor\output.lua
["Program stopped (pid: %d)."] = "Programm gestoppt (pid: %d).", -- src\editor\debugger.lua
["Program unable to run as '%s'."] = "Programm kann nicht als '%s' laufen.", -- src\editor\output.lua
["Project Directory"] = "&Projektverzeichnis", -- src\editor\menu_project.lua
["Project"] = "Projekt", -- src\editor\settings.lua, src\editor\gui.lua
["Project/&FileTree Window"] = "&Projekt/Datei Fenster", -- src\editor\menu_view.lua
["R/O"] = "R/O", -- src\editor\editor.lua
["R/W"] = "R/W", -- src\editor\editor.lua
["Re&place In Files"] = "Ersetze in &Dateien", -- src\editor\menu_search.lua
["Recent Files"] = "Letzte Dateien", -- src\editor\menu_file.lua
["Redo last edit undone"] = "Stelle letzte rückgängig gemachte Bearbeitung wieder her", -- src\editor\menu_edit.lua
["Refused a request to start a new debugging session as there is one in progress already."] = "Starten einer neuen Debuggingsession abgelehnt, da bereits eine läuft.", -- src\editor\debugger.lua
["Regular &expression"] = "&Regulärer Ausdruck", -- src\editor\findreplace.lua
["Remote console"] = "Fensteuerungs-Konsole", -- src\editor\shellbox.lua
["Rename All Instances"] = "Umbenennen aller Instanzen", -- src\editor\editor.lua
["Replace &All"] = "&Alles ersetzen", -- src\editor\findreplace.lua
["Replace"] = "Ersetzen", -- src\editor\findreplace.lua
["Replaced an invalid UTF8 character with %s."] = "Unbekanntes UTF8-Symbol ersetzt mit %s.", -- src\editor\commands.lua
["Replaced"] = "Ersetzt:", -- src\editor\findreplace.lua
["Replacing"] = "Am Ersetzen", -- src\editor\findreplace.lua
["Reset to default layout"] = "Standard-Layout wiederherstellen", -- src\editor\menu_view.lua
["Resets the dynamic word list for autocompletion"] = "Zurücksetzen der Liste der dynamischen Wörter für Autovervollständigung", -- src\editor\menu_edit.lua
["Run as Scratchpad"] = "Als &Entwurf starten", -- src\editor\menu_project.lua
["S&top Debugging"] = "Debugging a&nhalten", -- src\editor\menu_project.lua
["S&top Process"] = "Prozeß &anhalten", -- src\editor\menu_project.lua
["Save &As..."] = "S&peichern als...", -- src\editor\menu_file.lua, src\editor\gui.lua
["Save A&ll"] = "&Alle Speichern", -- src\editor\menu_file.lua
["Save Changes?"] = "Änderungen speichern?", -- src\editor\commands.lua
["Save all open documents"] = "Alle offenen Dokumente speichern", -- src\editor\menu_file.lua, src\editor\gui.lua
["Save file as"] = "Datei speichern als", -- src\editor\commands.lua
["Save file?"] = "Datei speichern?", -- src\editor\commands.lua
["Save the current document to a file with a new name"] = "Aktuelles Dokument unter neuem Namen speichern", -- src\editor\menu_file.lua
["Save the current document"] = "Aktuelles Dokument speichern", -- src\editor\menu_file.lua, src\editor\gui.lua
["Saved auto-recover at %s."] = "Autowiederherstellen gespeichert unter %s.", -- src\editor\commands.lua
["Scope"] = "Richtung", -- src\editor\findreplace.lua
["Scratchpad error"] = "Fehler im Entwurf", -- src\editor\debugger.lua
["Searching for"] = "Suchen nach", -- src\editor\findreplace.lua
["Select &All"] = "&Alles Auswählen", -- src\editor\editor.lua, src\editor\menu_edit.lua
["Select all text in the editor"] = "Kompletten Text im Editor auswählen", -- src\editor\menu_edit.lua
["Set From Current File"] = "Anhand der aktuellen Datei festlegen", -- src\editor\menu_project.lua
["Set project directory from current file"] = "Lege Projektverzeichnis anhand der aktuellen Datei fest", -- src\editor\menu_project.lua, src\editor\gui.lua
["Set the interpreter to be used"] = "Wähle zu benutzenden Interpreter aus", -- src\editor\menu_project.lua
["Set the project directory to be used"] = "Lege zu benutzendes Projektverzeichnis fest", -- src\editor\menu_project.lua
["Settings: System"] = "Einstellungen: System", -- src\editor\menu_edit.lua
["Settings: User"] = "Einstellungen: Nutzer", -- src\editor\menu_edit.lua
["Show &Tooltip"] = "&Tooltip zeigen", -- src\editor\menu_edit.lua
["Show Location"] = "Ordner öffnen", -- src\editor\gui.lua, src\editor\filetree.lua
["Show tooltip for current position; place cursor after opening bracket of function"] = "Zeige Tooltip für aktuelle Position; setze Cursor hinter die öffnende Klammer der Funktion", -- src\editor\menu_edit.lua
["Sort selected lines"] = "Ausgewählte Zeilen sortieren", -- src\editor\menu_search.lua
["Stack"] = "Stack", -- src\editor\debugger.lua
["Start &Debugging"] = "&Debugging starten", -- src\editor\menu_project.lua
["Start debugging"] = "Debugging starten", -- src\editor\menu_project.lua, src\editor\gui.lua
["Step &Into"] = "Schritt h&inein", -- src\editor\menu_project.lua
["Step &Over"] = "&Überspringen", -- src\editor\menu_project.lua
["Step O&ut"] = "Schritt &raus", -- src\editor\menu_project.lua
["Step into"] = "Schritt hinein", -- src\editor\menu_project.lua, src\editor\gui.lua
["Step out of the current function"] = "Schritt aus der aktuellen Funktion heraus", -- src\editor\menu_project.lua, src\editor\gui.lua
["Step over"] = "Überspringen", -- src\editor\menu_project.lua, src\editor\gui.lua
["Stop the currently running process"] = "Aktuell laufenden Prozeß stoppen", -- src\editor\menu_project.lua, src\editor\gui.lua
["Switch to or from full screen mode"] = "Vollbild an/aus", -- src\editor\menu_view.lua
["Text not found."] = "Text nicht gefunden.", -- src\editor\findreplace.lua
["The API file must be located in a subdirectory of the API directory."] = "Die API-Datei muß sich in einem Unterverzeichnis des API-Vereichnisses befinden.", -- src\editor\autocomplete.lua
["Toggle Break&point"] = "&Haltepunkt an/aus", -- src\editor\menu_project.lua
["Toggle breakpoint"] = "Haltepunkt an/aus", -- src\editor\menu_project.lua, src\editor\gui.lua
["Tr&ace"] = "Ablauf &verfolgen", -- src\editor\menu_project.lua
["Trace execution showing each executed line"] = "Ablaufverfolgung zeigt jede ausgeführte Zeile an", -- src\editor\menu_project.lua
["Unable to load file '%s'."] = "Scheitern beim Laden von Datei '%s'.", -- src\editor\commands.lua
["Unable to save file '%s': %s"] = "Scheitern beim Speichern von Datei '%s' : %s", -- src\editor\commands.lua
["Unable to stop program (pid: %d), code %d."] = "Scheitern beim Stoppen des Prozesses (pid : %d), code %d.", -- src\editor\debugger.lua
["Undo last edit"] = "Letzte Änderung rückgängig machen", -- src\editor\menu_edit.lua
["Use '%s' to see full description."] = "'%s' für eine komplette Beschreibung.", -- src\editor\editor.lua
["Use '%s' to show line endings and '%s' to convert them."] = "'%s' um Zeilenende-Codes zu sehen, und '%s' um sie zu konvertieren.", -- src\editor\commands.lua
["Use 'clear' to clear the shell output and the history."] = "'clear' um Ausgabefenster und Verlauf zu löschen.", -- src\editor\shellbox.lua
["Use Shift-Enter for multiline code."] = "<Umsch-Eingabetaste> für Code in mehreren Zeilen.", -- src\editor\shellbox.lua
["Value"] = "Wert", -- src\editor\debugger.lua
["View the output/console window"] = "Ausgabe-/Konsolenfenster ansehen", -- src\editor\menu_view.lua
["View the project/filetree window"] = "Projekt-/Dateifenster ansehen", -- src\editor\menu_view.lua
["View the stack window"] = "Stapel/Stack-Fenster ansehen", -- src\editor\menu_view.lua, src\editor\gui.lua
["View the watch window"] = "Fenster für Beobachtungspunkte ansehen", -- src\editor\menu_view.lua, src\editor\gui.lua
["Watch"] = "Beobachtungspunkte", -- src\editor\debugger.lua
["Welcome to the interactive Lua interpreter."] = "Willkommen zum interaktiven Lua-Interpretr!", -- src\editor\shellbox.lua
["Wrap ar&ound"] = "Am Anfang fortsetzen", -- src\editor\findreplace.lua
["You must save the program first."] = "Erst das Programm speichern.", -- src\editor\commands.lua
["on line %d"] = "in Zeile %d", -- src\editor\debugger.lua, src\editor\commands.lua, src\editor\editor.lua
["traced %d instruction"] = {"%d Anweisung verfolgt", "%d Anweisungen verfolgt"} -- src\editor\debugger.lua
}

View File

@@ -1,5 +1,5 @@
--[[
1. Pick a color scheme by clicking on a link:
1. Pick a color scheme by clicking on its name:
- [Tomorrow](macro:shell(ApplyStyleConfig('cfg/tomorrow.lua','Tomorrow')))
- [TomorrowContrast](macro:shell(ApplyStyleConfig('cfg/tomorrow.lua','TomorrowContrast')))
- [TomorrowNight](macro:shell(ApplyStyleConfig('cfg/tomorrow.lua','TomorrowNight')))
@@ -8,8 +8,10 @@
- [TomorrowNightEighties](macro:shell(ApplyStyleConfig('cfg/tomorrow.lua','TomorrowNightEighties')))
- [Zenburn](macro:shell(ApplyStyleConfig('cfg/tomorrow.lua','Zenburn')))
- [Monokai](macro:shell(ApplyStyleConfig('cfg/tomorrow.lua','Monokai')))
- [Molokai](macro:shell(ApplyStyleConfig('cfg/tomorrow.lua','Molokai')))
- [SolarizedDark](macro:shell(ApplyStyleConfig('cfg/tomorrow.lua','SolarizedDark')))
- [SolarizedLight](macro:shell(ApplyStyleConfig('cfg/tomorrow.lua','SolarizedLight')))
- [Notepad++](macro:shell(ApplyStyleConfig('cfg/tomorrow.lua','NotepadPlusPlus')))
- [ZeroBrane Studio](macro:shell(ide.config.styles = StylesGetDefault(); ReApplySpecAndStyles()))

View File

@@ -135,6 +135,20 @@ local colors = {
Blue = H'F92672',
Purple = H'A6E22E',
},
Molokai = { -- based on https://github.com/tomasr/molokai/blob/master/colors/molokai.vim
Background = H'1B1D1E',
CurrentLine = H'293739',
Selection = H'49483E',
Foreground = H'F8F8F2',
Comment = H'7E8E91',
Red = H'AE81FF',
Orange = H'AE81FF',
Yellow = H'F8F8F2',
Green = H'E6DB74',
Aqua = H'66D9EF',
Blue = H'F92672',
Purple = H'A6E22E',
},
SolarizedDark = {
Background = H'042029',
CurrentLine = H'0A2933',
@@ -163,6 +177,20 @@ local colors = {
Blue = H'859900',
Purple = H'268BD2',
},
NotepadPlusPlus = { -- contributed by Florian (https://github.com/SiENcE)
Background = H'FFFFFF',
CurrentLine = H'E9E2FF',
Selection = H'ADADA1',
Foreground = H'000000',
Comment = H'008000',
Red = H'FF6900',
Orange = H'00FF00',
Yellow = H'FF4E00',
Green = H'808080',
Aqua = H'260099',
Blue = H'2123FF',
Purple = H'FFFFFF',
},
}
-- add more of the specified color (keeping all in 0-255 range)
@@ -221,7 +249,7 @@ return {
sel = {bg = C.Selection},
caret = {fg = C.Foreground},
caretlinebg = {bg = C.CurrentLine},
fold = {fg = C.Comment, bg = C.Background},
fold = {fg = C.Comment, bg = C.Background, sel = mixer(C.Comment, 1, 96)},
whitespace = {fg = C.Comment, bg = C.Background},
indicator = {

View File

@@ -57,3 +57,17 @@ ide.app.postinit = function()
end
end
--]]
--[[ An example of how individual keywords can be styled
local G = ... -- this now points to the global environment in the script
local luaspec = G.ide.specs['lua']
local num = #luaspec.keywords
-- take a new slot in the list of keywords (starting from 1)
luaspec.keywords[num+1] = 'return'
-- remove 'return' from the list of "regular" keywords
luaspec.keywords[1] = luaspec.keywords[1]:gsub(' return', '')
-- assign new style to the added slot (starting from 0)
styles["keywords"..num] = {fg = {240, 0, 0}, b = true}
--]]

View File

@@ -34,9 +34,21 @@ return {
end
local code = ([[xpcall(function() io.stdout:setvbuf('no'); %s end,function(err) print(debug.traceback(err)) end)]]):format(script)
local cmd = '"'..exe..'" -e "'..code..'"'
-- add "LUA_DEV\clibs" to PATH to allow required DLLs to load
local _, path = wx.wxGetEnv("PATH")
local clibs = MergeFullPath(GetPathWithSep(exe), 'clibs')
if path and not path:find(clibs, 1, true) then
wx.wxSetEnv("PATH", path..';'..clibs)
end
-- CommandLineRun(cmd,wdir,tooutput,nohide,stringcallback,uid,endcallback)
return CommandLineRun(cmd,self:fworkdir(wfilename),true,false,nil,nil,
local pid = CommandLineRun(cmd,self:fworkdir(wfilename),true,false,nil,nil,
function() ide.debugger.pid = nil end)
-- restore PATH
wx.wxSetEnv("PATH", path)
return pid
end,
fprojdir = function(self,wfilename)
return wfilename:GetPath(wx.wxPATH_GET_VOLUME)

View File

@@ -19,7 +19,7 @@ local function match_string(s, pos)
pos = pos + 1
while 1 do
pos = s:find("[" .. c .. "\\]", pos)
if not pos then return s:sub(posa), #s end -- not terminated string
if not pos then return s:sub(posa), #s + 1 end -- not terminated string
if s:sub(pos,pos) == c then
local part = s:sub(posa, pos)
return part, pos + 1
@@ -31,7 +31,7 @@ local function match_string(s, pos)
local sc = s:match("^%[(=*)%[", pos)
if sc then
local _; _, pos = s:find("%]" .. sc .. "%]", pos)
if not pos then return s:sub(posa), #s end -- not terminated string
if not pos then return s:sub(posa), #s + 1 end -- not terminated string
local part = s:sub(posa, pos)
return part, pos + 1
else
@@ -120,7 +120,7 @@ function M.lex(code, f, pos)
f('Comment', tok, pos)
pos = pos2
elseif n1 == '\'' or n1 == '\"' or n2 == '[[' or n2 == '[=' then
local tok, _pos2 = match_string(code, pos)
local tok = match_string(code, pos)
if tok then
f('String', tok, pos)
pos = pos + #tok

View File

@@ -200,12 +200,12 @@ function PARSE.parse_scope_resolve(lx, f, vars)
return setmetatable(newvars, {__index=vars})
end
vars = vars or newscope({}, nil, 1)
vars = vars or newscope({[0] = 0}, nil, 1)
vars[NEXT] = false -- vars that come into scope upon next statement
vars[INSIDE] = false -- vars that come into scope upon entering block
PARSE.parse_scope(lx, function(op, name, lineinfo)
-- in some (rare) cases VarNext can follow Statement event (which copies
-- vars[NEXT]). This may case vars[0] to be `nil`, so default to 1.
-- vars[NEXT]). This may cause vars[0] to be `nil`, so default to 1.
local var = op:find("^Var") and
{fpos = lineinfo, at = (vars[0] or 1) + (op == 'VarInside' and 1 or 0),
masked = vars[name], self = (op == 'VarSelf') or nil } or nil

View File

@@ -1,12 +1,12 @@
--
-- MobDebug 0.535
-- MobDebug 0.5401
-- Copyright 2011-13 Paul Kulchenko
-- Based on RemDebug 1.0 Copyright Kepler Project 2005
--
local mobdebug = {
_NAME = "mobdebug",
_VERSION = 0.535,
_VERSION = 0.5401,
_COPYRIGHT = "Paul Kulchenko",
_DESCRIPTION = "Mobile Remote Debugger for the Lua programming language",
port = os and os.getenv and os.getenv("MOBDEBUG_PORT") or 8172,
@@ -26,6 +26,8 @@ local require = require
local setmetatable = setmetatable
local string = string
local tonumber = tonumber
local unpack = table.unpack or unpack
local rawget = rawget
-- if strict.lua is used, then need to avoid referencing some global
-- variables, as they can be undefined;
@@ -302,7 +304,9 @@ local function restore_vars(vars)
while i > 0 do
local name = debug.getlocal(3, i)
if not written_vars[name] then
if string.sub(name, 1, 1) ~= '(' then debug.setlocal(3, i, vars[name]) end
if string.sub(name, 1, 1) ~= '(' then
debug.setlocal(3, i, rawget(vars, name))
end
written_vars[name] = true
end
i = i - 1
@@ -314,7 +318,9 @@ local function restore_vars(vars)
local name = debug.getupvalue(func, i)
if not name then break end
if not written_vars[name] then
if string.sub(name, 1, 1) ~= '(' then debug.setupvalue(func, i, vars[name]) end
if string.sub(name, 1, 1) ~= '(' then
debug.setupvalue(func, i, rawget(vars, name))
end
written_vars[name] = true
end
i = i + 1
@@ -338,6 +344,13 @@ local function capture_vars(level)
if string.sub(name, 1, 1) ~= '(' then vars[name] = value end
i = i + 1
end
-- returned 'vars' table plays a dual role: (1) it captures local values
-- and upvalues to be restored later (in case they are modified in "eval"),
-- and (2) it provides an environment for evaluated chunks.
-- getfenv(func) is needed to provide proper environment for functions,
-- including access to globals, but this causes vars[name] to fail in
-- restore_vars on local variables or upvalues with `nil` values when
-- 'strict' is in effect. To avoid this `rawget` is used in restore_vars.
setmetatable(vars, { __index = getfenv(func), __newindex = getfenv(func) })
return vars
end
@@ -463,9 +476,10 @@ local function debug_hook(event, line)
-- some file systems allow newlines in file names; remove these.
file = file:gsub("\n", ' ')
else
-- serialize and return the source code; need serialization as scripts
-- may include newlines, but the names are expected to one one line.
file = serpent.line(file) -- serialize file content as a string
-- this is either a file name coming from loadstring("chunk", "file"),
-- or the actual source code that needs to be serialized (as it may
-- include newlines); assume it's a file name if it's all on one line.
file = file:find("[\r\n]") and serpent.line(file) or file
end
-- set to true if we got here; this only needs to be done once per
@@ -812,13 +826,18 @@ local function isrunning()
return coro_debugger and coroutine.status(coro_debugger) == 'suspended'
end
local lasthost, lastport
-- Starts a debug session by connecting to a controller
local function start(controller_host, controller_port)
-- only one debugging session can be run (as there is only one debug hook)
if isrunning() then return end
controller_host = controller_host or "localhost"
controller_port = controller_port or mobdebug.port
lasthost = controller_host or lasthost
lastport = controller_port or lastport
controller_host = lasthost or "localhost"
controller_port = lastport or mobdebug.port
server = (socket.connect4 or socket.connect)(controller_host, controller_port)
if server then
@@ -853,6 +872,7 @@ local function start(controller_host, controller_port)
end
coro_debugger = coroutine.create(debugger_loop)
debug.sethook(debug_hook, "lcr")
seen_hook = nil -- reset in case the last start() call was refused
step_into = true -- start with step command
return true
else
@@ -864,8 +884,11 @@ local function controller(controller_host, controller_port, scratchpad)
-- only one debugging session can be run (as there is only one debug hook)
if isrunning() then return end
controller_host = controller_host or "localhost"
controller_port = controller_port or mobdebug.port
lasthost = controller_host or lasthost
lastport = controller_port or lastport
controller_host = lasthost or "localhost"
controller_port = lastport or mobdebug.port
local exitonerror = not scratchpad
server = (socket.connect4 or socket.connect)(controller_host, controller_port)
@@ -1160,7 +1183,7 @@ local function handle(params, client, options)
print("Error in processing results: " .. err)
return nil, nil, "Error in processing results: " .. err
end
print((table.unpack or unpack)(res))
print(unpack(res))
return res[1], res
end
elseif status == "201" then
@@ -1383,8 +1406,9 @@ local function done()
debug.sethook()
server:close()
coro_debugger = nil -- this is to make sure isrunning() returns `false`
seen_hook = nil -- this is to make sure that the next start() call works
coro_debugger = nil -- to make sure isrunning() returns `false`
seen_hook = nil -- to make sure that the next start() call works
abort = nil -- to make sure that callback calls use proper "abort" value
end
-- make public functions available

View File

@@ -21,8 +21,9 @@ local events = {
onEditorClose = function(self, editor) end,
onEditorNew = function(self, editor) end,
onEditorPreSave = function(self, editor, filepath) end, -- return false
onEditorPostSave = function(self, editor) end,
onEditorActivated = function(self, editor) end,
onEditorSave = function(self, editor) end,
onEditorFocusLost = function(self, editor) end,
onEditorFocusSet = function(self, editor) end,
onEditorKeyDown = function(self, editor, event) end, -- return false
onEditorCharAdded = function(self, editor, event) end, -- return false
onMenuEditor = function(self, menu, editor, event) end,
@@ -32,14 +33,23 @@ local events = {
onProjectClose = function(self, project) end,
onInterpreterLoad = function(self, interpreter) end,
onInterpreterClose = function(self, interpreter) end,
onIdleOnce = function(self, event) end,
onAppFocusLost = function(self, app) end,
onAppFocusSet = function(self, app) end,
onAppLoad = function(self, app) end,
onAppClose = function(self, app) end,
}
--[[ Uncomment this to see event names printed in the Output window
for k in pairs(events) do
if k:find("^on") then
P[k] = k:find("^onEditor")
and function(self, ed) DisplayOutputLn(self:GetFileName(), k, ide:GetDocument(ed):GetFilePath()) end
or function(self, ...) DisplayOutputLn(self:GetFileName(), k, ...) end
and function(self, ed)
-- document can be empty for newly added documents
local doc = ide:GetDocument(ed)
DisplayOutputLn(self:GetFileName(), k, doc and doc:GetFilePath() or "new document") end
or function(self, ...)
DisplayOutputLn(self:GetFileName(), k, ...) end
end
end

View File

@@ -43,6 +43,18 @@ return {
ivec2 ivec3 ivec4 uvec2 uvec3 uvec4 bvec2 bvec3 bvec4
mat2 mat3 mat4 mat2x2 mat3x3 mat4x4 mat2x3 mat3x2 mat4x2 mat2x4 mat4x3 mat3x4
dmat2 dmat3 dmat4 dmat2x2 dmat3x3 dmat4x4 dmat2x3 dmat3x2 dmat4x2 dmat2x4 dmat4x3 dmat3x4
float16_t f16vec2 f16vec3 f16vec4
float32_t f32vec2 f32vec3 f32vec4
float64_t f64vec2 f64vec3 f64vec4
int8_t i8vec2 i8vec3 i8vec4
int8_t i8vec2 i8vec3 i8vec4
int16_t i16vec2 i16vec3 i16vec4
int32_t i32vec2 i32vec3 i32vec4
int64_t i64vec2 i64vec3 i64vec4
uint8_t u8vec2 u8vec3 u8vec4
uint16_t u16vec2 u16vec3 u16vec4
uint32_t u32vec2 u32vec3 u32vec4
uint64_t u64vec2 u64vec3 u64vec4
struct typedef void
usampler1D usampler2D usampler3D usampler2DRect usamplerCube isampler1DArray usampler2DARRAY usamplerCubeArray usampler2DMS usampler2DMSArray
isampler1D isampler2D isampler3D isampler2DRect isamplerCube isampler1DArray isampler2DARRAY isamplerCubeArray isampler2DMS isampler2DMSArray
@@ -51,10 +63,10 @@ return {
usamplerBuffer isamplerBuffer samplerBuffer samplerRenderbuffer isamplerRenderbuffer usamplerRenderbuffer
in out inout uniform const centroid sample attribute varying patch index true false
return switch case for do while if else break continue main inline
layout location vertices line_strip triangle_strip max_vertices stream
layout location vertices line_strip triangle_strip max_vertices stream
triangles quads equal_spacing isolines fractional_even_spacing lines points
fractional_odd_spacing cw ccw point_mode lines_adjacency triangles_adjacency
invocations
invocations offset align xfb_offset xfb_buffer
origin_upper_left pixel_center_integer depth_greater depth_greater depth_greater depth_unchanged
smooth flat noperspective highp mediump lowp shared packed std140 std430 row_major column_major buffer
gl_FrontColor gl_BackColor gl_FrontSecondaryColor gl_BackSecondaryColor gl_Color gl_SecondaryColor
@@ -70,6 +82,7 @@ return {
gl_FragData gl_FragDepth gl_SampleMask
gl_NumWorkGroups gl_WorkGroupSize gl_WorkGroupID gl_LocalInvocationID gl_GlobalInvocationID gl_LocalInvocationIndex
local_size_x local_size_y local_size_z
gl_BaseVertexARB gl_BaseInstanceARB gl_DrawIDARB
coherent volatile restrict readonly writeonly
image1D image2D image3D image2DRect imageCube imageBuffer image1DArray image2DArray imageCubeArray image2DMS image2DMSArray
@@ -88,6 +101,10 @@ return {
packUnorm2x16 packUnorm4x8 packSnorm4x8
unpackUnorm2x16 unpackUnorm4x8 unpackSnorm4x8
packDouble2x32 unpackDouble2x32 packHalf2x16 unpackHalf2x16
packInt2x32 packUint2x32 unpackInt2x32 unpackUint2x32
packFloat2x16 unpackFloat2x16 doubleBitsToInt64
doubleBitsToUint64 int64BitsToDouble uint64BitsToDouble
length distance dot cross normalize ftransform faceforward
reflect refract
matrixCompMult outerProduct transpose determinant inverse
@@ -140,6 +157,8 @@ return {
atomicCounterIncrement atomicCounterDecrement atomicCounter
atomicMin atomicMax atomicAdd atomicAnd atomicOr atomicXor atomicExchange atomicCompSwap
anyInvocationARB allInvocationsARB allInvocationsEqualARB
x y z w
xxxx xxxy xxxz xxxw xxyx xxyy xxyz xxyw xxzx xxzy

View File

@@ -49,13 +49,15 @@ return {
return match and 1 or 0, match and term and 1 or 0
end,
isincindent = function(str)
local term = str:match("^%s*(%w+)[^%w]*")
local term = str:match("^%s*(%w+)%W*")
term = term and incindent[term] and 1 or 0
str = str:gsub("'.-'",""):gsub('".-"','')
local _, opened = str:gsub("([%{%(])", "%1")
local _, closed = str:gsub("([%}%)])", "%1")
local func = (isfndef(str) or str:match("[^%w]+function%s*%(")) and 1 or 0
local func = (isfndef(str) or str:match("%W+function%s*%(")) and 1 or 0
-- ended should only be used to negate term and func effects
local ended = (term + func > 0) and str:match("[^%w]+end%s*$") and 1 or 0
local anon = str:match("%W+function%s*%(.+%Wend%W")
local ended = (term + func > 0) and (str:match("%W+end%s*$") or anon) and 1 or 0
return opened - closed + func + term - ended
end,
@@ -151,6 +153,11 @@ return {
typ = nil
end
typ = typ and typ:gsub("%s","")
typ = typ and typ:gsub(".+", function(s)
return (s:find("^'[^']*'$")
or s:find('^"[^"]*"$')
or s:find('^%[=*%[.*%]=*%]$')) and 'string' or s
end)
if (var and typ) then
class,func = typ:match(varname.."[%.:]"..varname)
if (assigns[typ]) then

View File

@@ -100,17 +100,21 @@ config = {
calltipdelay = nil, -- delay to show calltip (in ms)
autoactivate = false, -- auto-activate/open files during debugging
smartindent = false, -- use smart indentation if spec allows
fold = true, -- enable code folding
foldcompact = true, -- use compact fold that includes empty lines
checkeol = true, -- check for eol encoding on loaded files and use it
-- also report mixed eol encodings
defaulteol = nil, -- default line-endings for new files; valid values are
-- wxstc.wxSTC_EOL_CRLF, wxstc.wxSTC_EOL_LF and nil (OS default)
nomousezoom = nil, -- disable zooming using mouse wheel
autoreload = nil, -- trigger auto-reload when file is updated
saveallonrun = nil, -- save all modified files before Run/Debug
},
default = {
name = 'untitled',
fullname = 'untitled.lua',
interpreter = 'luadeb',
},
debugger = {
@@ -119,6 +123,7 @@ config = {
port = nil, -- port number to use
runonstart = nil, -- if debugger should run immediately after starting
-- default values are different for different interpreters
redirect = nil, -- "d", "c", or "r" values for default, copy, or redirect
}
outputshell = { -- output and shell settings

View File

@@ -36,54 +36,70 @@ local apis = {
lua = newAPI(),
}
function GetApi(apitype)
return apis[apitype] or apis["none"]
end
function GetApi(apitype) return apis[apitype] or apis.none end
----------
-- API loading
local function addAPI(apifile,only,subapis,known) -- relative to API directory
local ftype, fname = apifile:match("api[/\\]([^/\\]+)[/\\](.*)%.")
if not ftype or not fname then
DisplayOutputLn(TR("The API file must be located in a subdirectory of the API directory."))
return
end
if ((only and ftype ~= only) or (known and not known[ftype])) then
return
end
if (subapis and not subapis[fname]) then return end
local fn,err = loadfile(apifile)
if err then
DisplayOutputLn(TR("Error while loading API file: %s"):format(err))
return
end
local env = apis[ftype] or newAPI()
apis[ftype] = env
env = env.ac.childs
local suc,res = pcall(function()return fn(env) end)
if (not suc) then
DisplayOutputLn(TR("Error while processing API file: %s"):format(res))
elseif (res) then
local function gennames(tab,prefix)
for i,v in pairs(tab) do
v.classname = (prefix and (prefix..".") or "")..i
if(v.childs) then
gennames(v.childs,v.classname)
end
end
end
gennames(res)
for i,v in pairs(res) do
env[i] = v
local function gennames(tab, prefix)
for i,v in pairs(tab) do
v.classname = (prefix and (prefix..".") or "")..i
if (v.childs) then
gennames(v.childs,v.classname)
end
end
end
local function loadallAPIs (only,subapis,known)
local function addAPI(ftype, fname) -- relative to API directory
local env = apis[ftype] or newAPI()
local res
local api = ide.apis[ftype][fname]
if type(api) == 'table' then
res = api
else
local fn, err = loadfile(api)
if err then
DisplayOutputLn(TR("Error while loading API file: %s"):format(err))
return
end
local suc
suc, res = pcall(function() return fn(env.ac.childs) end)
if (not suc) then
DisplayOutputLn(TR("Error while processing API file: %s"):format(res))
return
end
-- cache the result
ide.apis[ftype][fname] = res
end
apis[ftype] = env
gennames(res)
for i,v in pairs(res) do env.ac.childs[i] = v end
end
local function loadallAPIs(only, subapis, known)
for ftype, v in pairs(only and {[only] = ide.apis[only]} or ide.apis) do
if (not known or known[ftype]) then
for fname in pairs(v) do
if (not subapis or subapis[fname]) then addAPI(ftype, fname) end
end
end
end
end
local function scanAPIs()
for _, file in ipairs(FileSysGetRecursive("api", true, "*.lua")) do
if not file:match(string_Pathsep.."$") then addAPI(file,only,subapis,known) end
if not IsDirectory(file) then
local ftype, fname = file:match("api[/\\]([^/\\]+)[/\\](.*)%.")
if not ftype or not fname then
DisplayOutputLn(TR("The API file must be located in a subdirectory of the API directory."))
return
end
ide.apis[ftype] = ide.apis[ftype] or {}
ide.apis[ftype][fname] = file
end
end
end
@@ -219,9 +235,9 @@ local function resolveAssign(editor,tx)
-- this can happen if it's a reference to a value with a known type
classname = classname or assigns[c..w]
if (s ~= "" and old ~= classname) then
c = classname..s
-- continue checking unless this can lead to recursive substitution
change = not classname:find("^"..w)
change = not classname:find("^"..w) and not classname:find("^"..c..w)
c = classname..s
else
c = c..w..s
end
@@ -243,15 +259,21 @@ end
function GetTipInfo(editor, content, short, fullmatch)
if not content then return end
UpdateAssignCache(editor)
-- try to resolve the class
content = content:gsub("%b[]",".0")
local tab, rest = resolveAssign(editor, content)
local caller = content:match("([%w_]+)%(?%s*$")
local class = caller and content:match("([%w_]+)[%.:]"..caller.."%(?%s*$") or ""
local class = (tab and tab.classname
or caller and content:match("([%w_]+)[%.:]"..caller.."%(?%s*$") or "")
local tip = editor.api.tip
local classtab = short and tip.shortfinfoclass or tip.finfoclass
local funcstab = short and tip.shortfinfo or tip.finfo
UpdateAssignCache(editor)
if (editor.assignscache and not (class and classtab[class])) then
local assigns = editor.assignscache.assigns
class = assigns and assigns[class] or class
@@ -293,6 +315,7 @@ do
-- by defaul load every known api except lua
known.lua = false
scanAPIs()
loadallAPIs(nil,nil,known)
generateAPIInfo()
end
@@ -353,11 +376,8 @@ function DynamicWordsReset ()
end
local function getEditorLines(editor,line,numlines)
local tx = ""
for i=0,numlines do
tx = tx..editor:GetLine(line + i)
end
return tx
return editor:GetTextRange(
editor:PositionFromLine(line),editor:PositionFromLine(line+numlines+1))
end
function DynamicWordsAdd(ev,editor,content,line,numlines)
@@ -541,21 +561,26 @@ function CreateAutoCompList(editor,key)
-- list from api
local apilist = getAutoCompApiList(tab.childs or tab,rest,method)
-- handle inheritance; add matches from the parent class/lib
local seen = {tab = true}
while tab.inherits do
local base = tab.inherits
tab = ac
-- map "a.b.c" to class hierarchy (a.b.c)
for class in base:gmatch("[%w_]+") do tab = tab.childs[class] end
if not tab or seen[tab] then break end
seen[tab] = true
local function addInheritance(tab, apilist, seen)
if not tab.inherits then return end
for base in tab.inherits:gmatch("[%w_"..sep.."]+") do
local tab = ac
-- map "a.b.c" to class hierarchy (a.b.c)
for class in base:gmatch("[%w_]+") do tab = tab.childs[class] end
for _,v in pairs(getAutoCompApiList(tab.childs,rest,method)) do
table.insert(apilist, v)
if tab and not seen[tab] then
seen[tab] = true
for _,v in pairs(getAutoCompApiList(tab.childs,rest,method)) do
table.insert(apilist, v)
end
addInheritance(tab, apilist, seen)
end
end
end
-- handle (multiple) inheritance; add matches from the parent class/lib
addInheritance(tab, apilist, {[tab] = true})
local compstr = ""
if apilist then
if (#rest > 0) then

View File

@@ -11,12 +11,15 @@ local CURRENT_LINE_MARKER = StylesGetMarker("currentline")
local CURRENT_LINE_MARKER_VALUE = 2^CURRENT_LINE_MARKER
local BREAKPOINT_MARKER = StylesGetMarker("breakpoint")
function NewFile(event)
function NewFile(filename)
filename = filename or ide.config.default.fullname
local editor = CreateEditor()
SetupKeywords(editor, "lua")
local doc = AddEditor(editor, ide.config.default.fullname)
if doc then PackageEventHandle("onEditorNew", editor) end
if doc then SetEditorSelection(doc.index) end
SetupKeywords(editor, GetFileExt(filename))
local doc = AddEditor(editor, filename)
if doc then
PackageEventHandle("onEditorNew", editor)
SetEditorSelection(doc.index)
end
return editor
end
@@ -71,9 +74,10 @@ function LoadFile(filePath, editor, file_must_exist, skipselection)
editor:SetText(file_text or "")
-- check the editor as it can be empty if the file has malformed UTF8;
-- skip binary files as they may have any sequences; can't show them anyway.
-- skip binary files with unknown extensions as they may have any sequences;
-- can't show them anyway.
if file_text and #file_text > 0 and #(editor:GetText()) == 0
and not isBinary(file_text) then
and (editor.spec ~= ide.specs.none or not isBinary(file_text)) then
local replacement, invalid = "\022"
file_text, invalid = fixUTF8(file_text, replacement)
if #invalid > 0 then
@@ -189,6 +193,11 @@ function SaveFile(editor, filePath)
st = GetConfigIOFilter("output")(filePath,st)
end
local file = wx.wxFileName(filePath)
if not file:FileExists() then
file:Mkdir(tonumber(755,8), wx.wxPATH_MKDIR_FULL)
end
local ok, err = FileWrite(filePath, st)
if ok then
editor:SetSavePoint()
@@ -199,7 +208,7 @@ function SaveFile(editor, filePath)
SetDocumentModified(id, false)
SetAutoRecoveryMark()
PackageEventHandle("onEditorPostSave", editor)
PackageEventHandle("onEditorSave", editor)
return true
else
@@ -215,11 +224,9 @@ end
function SaveFileAs(editor)
local id = editor:GetId()
local saved = false
local filePath = openDocuments[id].filePath
if (not filePath) then
filePath = FileTreeGetDir()
filePath = (filePath or "")..ide.config.default.name
end
local filePath = (openDocuments[id].filePath
or ((FileTreeGetDir() or "")
..(openDocuments[id].fileName or ide.config.default.name)))
local fn = wx.wxFileName(filePath)
fn:Normalize() -- want absolute path for dialog
@@ -246,11 +253,27 @@ function SaveFileAs(editor)
FileTreeMarkSelected(filePath)
if ext ~= GetFileExt(filePath) then
-- new extension, so setup new keywords and re-apply indicators
editor:ClearDocumentStyle() -- remove styles from the document
SetupKeywords(editor, GetFileExt(filePath))
IndicateAll(editor)
MarkupStyle(editor)
end
saved = true
-- check if there is another tab with the same name and close it
local fileName = wx.wxFileName(filePath)
for _, document in pairs(ide.openDocuments) do
if document.filePath and fileName:SameAs(wx.wxFileName(document.filePath)) then
-- save the current selection as it may change after closing
local current = notebook:GetSelection()
ClosePage(document.index)
-- restore the selection if it changed
if current ~= notebook:GetSelection() then
notebook:SetSelection(current)
end
break
end
end
end
end
@@ -258,12 +281,13 @@ function SaveFileAs(editor)
return saved
end
function SaveAll()
function SaveAll(quiet)
for id, document in pairs(openDocuments) do
local editor = document.editor
local filePath = document.filePath
if document.isModified or not document.filePath then
if (document.isModified or not document.filePath) -- need to save
and (document.filePath or not quiet) then -- have path or can ask user
SaveFile(editor, filePath) -- will call SaveFileAs if necessary
end
end
@@ -696,11 +720,14 @@ function StoreRestoreProjectTabs(curdir, newdir)
local projdocs, closdocs = {}, {}
for _, document in ipairs(GetOpenFiles()) do
local dpath = win and string.lower(document.filename) or document.filename
if dpath:find(lowcurdir, 1, true) then
-- check if the filename is in the same folder
if dpath:find(lowcurdir, 1, true) == 1
and dpath:find("^[\\/]", #lowcurdir+1) then
table.insert(projdocs, document)
closing = closing + (document.id < current and 1 or 0)
-- only close if the file is not in new project as it would be reopened
if not dpath:find(lownewdir, 1, true) then
if not dpath:find(lownewdir, 1, true)
or not dpath:find("^[\\/]", #lownewdir+1) then
table.insert(closdocs, document)
end
elseif document.id == current then restore = true end
@@ -764,6 +791,8 @@ local function closeWindow(event)
ShowFullScreen(false)
PackageEventHandle("onAppClose")
SettingsSaveAll()
ide.settings:Flush()
@@ -792,6 +821,15 @@ frame:Connect(wx.wxEVT_CLOSE_WINDOW, closeWindow)
frame:Connect(wx.wxEVT_TIMER, saveAutoRecovery)
ide.editorApp:Connect(wx.wxEVT_ACTIVATE_APP,
function(event)
if not ide.exitingProgram then
local event = event:GetActive() and "onAppFocusSet" or "onAppFocusLost"
PackageEventHandle(event, ide.editorApp)
end
event:Skip()
end)
if ide.config.autorecoverinactivity then
ide.session.timer = wx.wxTimer(frame)
-- check at least 5s to be never more than 5s off

View File

@@ -17,11 +17,8 @@ debugger.watchCtrl = nil -- the watch ctrl that shows watch information
debugger.stackCtrl = nil -- the stack ctrl that shows stack information
debugger.toggleview = { stackpanel = false, watchpanel = false }
debugger.hostname = ide.config.debugger.hostname or (function()
local addr = wx.wxIPV4address() -- check what address is resolvable
for _, host in ipairs({wx.wxGetHostName(), wx.wxGetFullHostName()}) do
if host and #host > 0 and addr:Hostname(host) then return host end
end
return "localhost" -- last resort; no known good hostname
local hostname = socket.dns.gethostname()
return hostname and socket.dns.toip(hostname) and hostname or "localhost"
end)()
local notebook = ide.frame.notebook
@@ -220,21 +217,6 @@ local function killClient()
end
end
local function loadsafe(data)
local f, res = loadstring(data)
if not f then return f, res end
local count = 0
debug.sethook(function ()
count = count + 1
if count >= 3 then error("cannot call functions") end
end, "c")
local ok, res = pcall(f)
count = 0
debug.sethook()
return ok, res
end
local function activateDocument(file, line, activatehow)
if not file then return end
@@ -244,11 +226,17 @@ local function activateDocument(file, line, activatehow)
-- (for example: 'mobdebug.lua').
local content
if not wx.wxFileName(file):FileExists() and file:find('^"') then
local ok, res = loadsafe("return "..file)
local ok, res = LoadSafe("return "..file)
if ok then content = res end
end
if not content and not wx.wxIsAbsolutePath(file) and debugger.basedir then
-- in some cases filename can be returned quoted if the chunk is loaded with
-- loadstring(chunk, "filename") instead of loadstring(chunk, "@filename")
if content then
-- if the returned content can be matched with a file, it's a file name
local fname = GetFullPathIfExists(debugger.basedir, content) or content
if wx.wxFileName(fname):FileExists() then file, content = fname, nil end
elseif not wx.wxIsAbsolutePath(file) and debugger.basedir then
file = debugger.basedir .. file
end
@@ -323,7 +311,7 @@ local function activateDocument(file, line, activatehow)
end
if not (activated or indebugger or debugger.loop or activatehow == activate.CHECKONLY)
and (ide.config.editor.autoactivate or content) then
and (ide.config.editor.autoactivate or content and activatehow == activate.NOREPORT) then
-- found file, but can't activate yet (because this part may be executed
-- in a different coroutine), so schedule pending activation.
if content or wx.wxFileName(file):FileExists() then
@@ -440,7 +428,11 @@ debugger.listen = function()
end
copas.setErrorHandler(function(error)
DisplayOutputLn(TR("Can't start debugging session due to internal error '%s'."):format(error))
-- ignore errors that happen because debugging session is
-- terminated during handshake (server == nil in this case).
if debugger.server then
DisplayOutputLn(TR("Can't start debugging session due to internal error '%s'."):format(error))
end
debugger.terminate()
end)
@@ -484,11 +476,10 @@ debugger.listen = function()
reSetBreakpoints()
if options.redirect then
debugger.handle("output stdout " .. options.redirect, nil,
local redirect = ide.config.debugger.redirect or options.redirect
if redirect then
debugger.handle("output stdout " .. redirect, nil,
{ handler = function(m)
if not debugger.server then return end
-- if it's an error returned, then handle the error
if m and m:find("stack traceback:", 1, true) then
-- this is an error message sent remotely
@@ -554,8 +545,11 @@ debugger.listen = function()
end
-- if not found and the files doesn't exist, it may be
-- a remote call; try to map it to the project folder
if not activated and not wx.wxFileName(file):FileExists() then
-- a remote call; try to map it to the project folder.
-- also check for absolute path as it may need to be remapped
-- when autoactivation is disabled.
if not activated and (not wx.wxFileName(file):FileExists()
or wx.wxIsAbsolutePath(file)) then
-- file is /foo/bar/my.lua; basedir is d:\local\path\
-- check for d:\local\path\my.lua, d:\local\path\bar\my.lua, ...
-- wxwidgets on Windows handles \\ and / as separators, but on OSX

View File

@@ -109,11 +109,12 @@ local function isFileAlteredOnDisk(editor)
GetIDEString("editormessage"),
wx.wxOK + wx.wxCENTRE, ide.frame)
elseif not editor:GetReadOnly() and modTime:IsValid() and oldModTime:IsEarlierThan(modTime) then
local ret = wx.wxMessageBox(
TR("File '%s' has been modified on disk."):format(fileName)
.."\n"..TR("Do you want to reload it?"),
GetIDEString("editormessage"),
wx.wxYES_NO + wx.wxCENTRE, ide.frame)
local ret = (edcfg.autoreload and (not EditorIsModified(editor)) and wx.wxYES)
or wx.wxMessageBox(
TR("File '%s' has been modified on disk."):format(fileName)
.."\n"..TR("Do you want to reload it?"),
GetIDEString("editormessage"),
wx.wxYES_NO + wx.wxCENTRE, ide.frame)
if ret ~= wx.wxYES or LoadFile(filePath, editor, true) then
openDocuments[id].modTime = GetFileModTime(filePath)
@@ -151,8 +152,6 @@ function SetEditorSelection(selection)
editor:SetFocus()
editor:SetSTCFocus(true)
PackageEventHandle("onEditorActivated", editor)
local id = editor:GetId()
FileTreeMarkSelected(openDocuments[id] and openDocuments[id].filePath or '')
AddToFileHistory(openDocuments[id] and openDocuments[id].filePath)
@@ -222,12 +221,12 @@ function EditorAutoComplete(editor)
lt = lt:gsub("%b{}","")
lt = lt:gsub("%b[]",".0")
-- match from starting brace
lt = lt:match("[^%[%(%{%s]*$")
lt = lt:match("[^%[%(%{%s,]*$")
-- know now which string is to be completed
local userList = CreateAutoCompList(editor,lt)
-- don't show the list if the only option is what's already typed
if userList and #userList > 0 and userList ~= lt then
-- don't show the list if it only suggests what's already typed
if userList and #userList > 0 and not lt:find(userList.."$") then
editor:UserListShow(1, userList)
elseif editor:AutoCompActive() then
editor:AutoCompCancel()
@@ -239,12 +238,12 @@ local function getValAtPosition(editor, pos)
local line = editor:LineFromPosition(pos)
local linetx = editor:GetLine(line)
local linestart = editor:PositionFromLine(line)
local localpos = pos-linestart+1
local localpos = pos-linestart
local selected = editor:GetSelectionStart() ~= editor:GetSelectionEnd()
and pos >= editor:GetSelectionStart() and pos <= editor:GetSelectionEnd()
-- check if we have a selected text or an identifier
-- check if we have a selected text or an identifier.
-- for an identifier, check fragments on the left and on the right.
-- this is to match 'io' in 'i^o.print' and 'io.print' in 'io.pr^int'.
-- remove square brackets to make tbl[index].x show proper values.
@@ -265,16 +264,9 @@ local function getValAtPosition(editor, pos)
-- 2. foo.bar(..^. -- the cursor (pos) is on the parameter list
-- "var" has value for #1 and the following fragment checks for #2
local linetxtopos = linetx:sub(1,localpos)
funccall = (#funccall > 0) and var
or (linetxtopos..")"):match(ident .. "%s*%b()$")
or (linetxtopos.."}"):match(ident .. "%s*%b{}$")
or (linetxtopos.."'"):match(ident .. "%s*'[^']*'$")
or (linetxtopos..'"'):match(ident .. '%s*"[^"]*"$')
or nil
-- check if the style is the right one; this is to ignore
-- comments, strings, numbers (to avoid '1 = 1'), keywords, and such
local goodpos = true
if start and not selected then
local style = bit.band(editor:GetStyleAt(linestart+start),31)
if editor.spec.iscomment[style]
@@ -282,18 +274,29 @@ local function getValAtPosition(editor, pos)
or editor.spec.isstring[style]
or style == wxstc.wxSTC_LUA_NUMBER
or style == wxstc.wxSTC_LUA_WORD then
-- don't do anything for strings or comments or numbers
return nil, funccall
goodpos = false
end
end
local linetxtopos = linetx:sub(1,localpos)
funccall = (#funccall > 0) and goodpos and var
or (linetxtopos..")"):match(ident .. "%s*%b()$")
or (linetxtopos.."}"):match(ident .. "%s*%b{}$")
or (linetxtopos.."'"):match(ident .. "%s*'[^']*'$")
or (linetxtopos..'"'):match(ident .. '%s*"[^"]*"$')
or nil
-- don't do anything for strings or comments or numbers
if not goodpos then return nil, funccall end
return var, funccall
end
function EditorCallTip(editor, pos, x, y)
-- don't show anything if the calltip is active; this may happen after
-- typing function name, while the mouse is over a different function.
if editor:CallTipActive() then return end
-- don't show anything if the calltip/auto-complete is active;
-- this may happen after typing function name, while the mouse is over
-- a different function or when auto-complete is on for a parameter.
if editor:CallTipActive() or editor:AutoCompActive() then return end
-- don't activate if the window itself is not active (in the background)
if not ide.frame:IsActive() then return end
@@ -615,10 +618,12 @@ function CreateEditor()
editor:MarkerDefine(StylesGetMarker("currentline"))
editor:MarkerDefine(StylesGetMarker("breakpoint"))
editor:SetMarginWidth(2, 16) -- fold margin
editor:SetMarginType(2, wxstc.wxSTC_MARGIN_SYMBOL)
editor:SetMarginMask(2, wxstc.wxSTC_MASK_FOLDERS)
editor:SetMarginSensitive(2, true)
if ide.config.editor.fold then
editor:SetMarginWidth(2, 16) -- fold margin
editor:SetMarginType(2, wxstc.wxSTC_MARGIN_SYMBOL)
editor:SetMarginMask(2, wxstc.wxSTC_MASK_FOLDERS)
editor:SetMarginSensitive(2, true)
end
editor:SetFoldFlags(wxstc.wxSTC_FOLDFLAG_LINEBEFORE_CONTRACTED +
wxstc.wxSTC_FOLDFLAG_LINEAFTER_CONTRACTED)
@@ -719,8 +724,7 @@ function CreateEditor()
if ide.config.acandtip.nodynwords then return end
-- only required to track changes
if (bit.band(evtype,wxstc.wxSTC_MOD_BEFOREDELETE) ~= 0) then
local numlines = 0
event:GetText():gsub("(\r?\n)",function() numlines = numlines + 1 end)
local _, numlines = event:GetText():gsub("\r?\n","%1")
DynamicWordsRem("pre",editor,nil,editor:LineFromPosition(event:GetPosition()), numlines)
end
if (bit.band(evtype,wxstc.wxSTC_MOD_BEFOREINSERT) ~= 0) then
@@ -731,6 +735,7 @@ function CreateEditor()
editor:Connect(wxstc.wxEVT_STC_CHARADDED,
function (event)
-- auto-indent
local LF = string.byte("\n")
local ch = event:GetKey()
local eol = editor:GetEOLMode()
local pos = editor:GetCurrentPos()
@@ -742,7 +747,7 @@ function CreateEditor()
if PackageEventHandle("onEditorCharAdded", editor, event) == false then
-- this event has already been handled
elseif (ch == char_LF) then
elseif (ch == LF) then
if (line > 0) then
local indent = editor:GetLineIndentation(line - 1)
local linedone = editor:GetLine(line - 1)
@@ -830,18 +835,54 @@ function CreateEditor()
event:Skip()
end)
editor:Connect(wx.wxEVT_SET_FOCUS,
function (event)
PackageEventHandle("onEditorFocusSet", editor)
event:Skip()
end)
editor:Connect(wx.wxEVT_KILL_FOCUS,
function (event)
if editor:AutoCompActive() then editor:AutoCompCancel() end
PackageEventHandle("onEditorFocusLost", editor)
event:Skip()
end)
editor:Connect(wxstc.wxEVT_STC_USERLISTSELECTION,
function (event)
local pos = editor:GetCurrentPos()
local start_pos = editor:WordStartPosition(pos, true)
editor:SetSelection(start_pos, pos)
editor:ReplaceSelection(event:GetText())
if ide.wxver >= "2.9.5" and editor:GetSelections() > 1 then
local text = event:GetText()
-- capture all positions as the selection may change
local positions = {}
for s = 0, editor:GetSelections()-1 do
table.insert(positions, editor:GetSelectionNCaret(s))
end
-- process all selections from last to first
table.sort(positions)
local mainpos = editor:GetSelectionNCaret(editor:GetMainSelection())
editor:BeginUndoAction()
for s = #positions, 1, -1 do
local pos = positions[s]
local start_pos = editor:WordStartPosition(pos, true)
editor:SetSelection(start_pos, pos)
editor:ReplaceSelection(text)
-- if this is the main position, save new cursor position to restore
if pos == mainpos then mainpos = editor:GetCurrentPos()
elseif pos < mainpos then
-- adjust main position as earlier changes may affect it
mainpos = mainpos + #text - (pos - start_pos)
end
end
editor:EndUndoAction()
editor:GotoPos(mainpos)
else
local pos = editor:GetCurrentPos()
local start_pos = editor:WordStartPosition(pos, true)
editor:SetSelection(start_pos, pos)
editor:ReplaceSelection(event:GetText())
end
end)
editor:Connect(wxstc.wxEVT_STC_SAVEPOINTREACHED,
@@ -1108,7 +1149,7 @@ function AddEditor(editor, name)
local document = setmetatable({}, ide.proto.Document)
document.editor = editor
document.index = notebook:GetPageIndex(editor)
document.fileName = nil
document.fileName = name
document.filePath = nil
document.modTime = nil
document.isModified = false
@@ -1187,9 +1228,12 @@ function SetupKeywords(editor, ext, forcespec, styles, font, fontitalic)
-- need to set folding property after lexer is set, otherwise
-- the folds are not shown (wxwidgets 2.9.5)
editor:SetProperty("fold", "1")
editor:SetProperty("fold.compact", ide.config.editor.foldcompact and "1" or "0")
editor:SetProperty("fold.comment", "1")
if ide.config.editor.fold then
editor:SetProperty("fold", "1")
editor:SetProperty("fold.html", "1")
editor:SetProperty("fold.compact", ide.config.editor.foldcompact and "1" or "0")
editor:SetProperty("fold.comment", "1")
end
-- quickfix to prevent weird looks, otherwise need to update styling mechanism for cpp
-- cpp "greyed out" styles are styleid + 64

View File

@@ -8,10 +8,13 @@ local ide = ide
ide.filetree = {
projdir = "",
projdirlist = {},
projdirmap = {},
projdirpartmap = {},
}
local filetree = ide.filetree
local iscaseinsensitive = wx.wxFileName("A"):SameAs(wx.wxFileName("a"))
local pathsep = GetPathSeparator()
-- generic tree
-- ------------
@@ -42,7 +45,7 @@ local function treeAddDir(tree,parent_id,rootdir)
local curr
for _, file in ipairs(FileSysGetRecursive(rootdir)) do
local name, dir = file:match("([^"..string_Pathsep.."]+)("..string_Pathsep.."?)$")
local name, dir = file:match("([^"..pathsep.."]+)("..pathsep.."?)$")
local known = GetSpec(GetFileExt(name))
local icon = #dir>0 and IMG_DIRECTORY or known and IMG_FILE_KNOWN or IMG_FILE_OTHER
local item = items[name .. icon]
@@ -103,7 +106,7 @@ local function treeSetConnectorsAndIcons(tree)
item_id = tree:GetItemParent(item_id)
if not item_id:IsOk() then break end
cur = tree:GetItemText(item_id)
if cur and string.len(cur) > 0 then str = cur..string_Pathsep..str end
if cur and string.len(cur) > 0 then str = cur..pathsep..str end
end
-- as root may already include path separator, normalize the path
local fullPath = wx.wxFileName(str)
@@ -208,14 +211,14 @@ local inupdate = false
local function projcomboboxUpdate(event)
if inupdate then return end
local cur = projcombobox:GetValue()
local fn = wx.wxFileName(cur)
local fn = wx.wxFileName(filetree.projdirmap[cur] or cur)
fn:Normalize()
-- on Windows, wxwidgets (2.9.5+) generates two COMMAND_COMBOBOX_SELECTED
-- events when the selection is done with ENTER, which causes recursive
-- call of updateProjectDir. To prevent this the second call is ignored.
inupdate = true
filetree:updateProjectDir(fn:GetFullPath(), event:GetEventType() == wx.wxEVT_COMMAND_COMBOBOX_SELECTED)
filetree:updateProjectDir(fn:GetFullPath())
inupdate = false
end
@@ -227,7 +230,29 @@ treeSetConnectorsAndIcons(projtree)
-- proj functions
-- ---------------
function filetree:updateProjectDir(newdir, cboxsel)
local function q(s) return s:gsub('([%(%)%.%%%+%-%*%?%[%^%$%]])','%%%1') end
local function abbreviateProjList(projdirlist)
filetree.projdirmap = {}
local sep = "\t"
local dirs = table.concat(projdirlist, sep)..sep
local projlist = {}
for _, v in ipairs(projdirlist) do
-- using FileName because the path doesn't have trailing slash
local parts = wx.wxFileName(v..pathsep):GetDirs()
local name = table.remove(parts, #parts) or v
while #parts > 0
and select(2, dirs:gsub("%f[^".. pathsep .."]"..q(name)..sep, "")) > 1 do
name = table.remove(parts, #parts) .. pathsep .. name
end
local abbrev = ("%s (%s)"):format(name, v)
filetree.projdirmap[abbrev] = v
table.insert(projlist, abbrev)
end
return projlist
end
function filetree:updateProjectDir(newdir)
if (not newdir) or not wx.wxDirExists(newdir) then return end
local dirname = wx.wxFileName.DirName(newdir)
@@ -245,6 +270,7 @@ function filetree:updateProjectDir(newdir, cboxsel)
end
filetree.projdir = newdir
filetree.projdirpartmap = {}
PackageEventHandle("onProjectLoad", filetree.projdir)
@@ -254,12 +280,8 @@ function filetree:updateProjectDir(newdir, cboxsel)
ide.config.projecthistorylength,
function(s1, s2) return dirname:SameAs(wx.wxFileName.DirName(s2)) end)
projcombobox:Clear()
projcombobox:Append(filetree.projdirlist)
if (not cboxsel) then
projcombobox:SetValue(newdir)
else
projcombobox:Select(0)
end
projcombobox:Append(abbreviateProjList(filetree.projdirlist))
projcombobox:Select(0)
ProjectUpdateProjectDir(newdir,true)
treeSetRoot(projtree,newdir)
@@ -306,7 +328,7 @@ local function findItem(tree, match)
end
if not s or s ~= 1 then return end
for token in string.gmatch(string.sub(match,e+1), "[^%"..string_Pathsep.."]+") do
for token in string.gmatch(string.sub(match,e+1), "[^%"..pathsep.."]+") do
local data = tree:GetItemData(node)
local cache = data and data:GetData()
if cache and cache[iscaseinsensitive and token:lower() or token] then
@@ -359,3 +381,21 @@ function FileTreeMarkSelected(file)
projtree:Refresh() end
end
end
function FileTreeFindByPartialName(name)
-- check if it's already cached
if filetree.projdirpartmap[name] then return filetree.projdirpartmap[name] end
-- this function may get a partial name that starts with ... and has
-- an abbreviated path (as generated by stack traces);
-- remove starting "..." if any and escape
local pattern = q(name:gsub("^%.%.%.","")).."$"
for _, file in ipairs(FileSysGetRecursive(filetree.projdir, true)) do
if file:find(pattern) then
filetree.projdirpartmap[name] = file
return file
end
end
return
end

View File

@@ -13,7 +13,7 @@ ide.findReplace = {
fWrap = true, -- search wraps around
fDown = true, -- search downwards in doc
fSubDirs = false, -- search in subdirectories
fSubDirs = true, -- search in subdirectories
fMakeBak = true, -- make bak files for replace in files
findTextArray = {}, -- array of last entered find text
@@ -46,8 +46,8 @@ end
-------------------- Find replace dialog
local function setSearchFlags(editor)
local flags = 0
if findReplace.fWholeWord then flags = wxstc.wxSTC_FIND_WHOLEWORD end
local flags = wxstc.wxSTC_FIND_POSIX
if findReplace.fWholeWord then flags = flags + wxstc.wxSTC_FIND_WHOLEWORD end
if findReplace.fMatchCase then flags = flags + wxstc.wxSTC_FIND_MATCHCASE end
if findReplace.fRegularExpr then flags = flags + wxstc.wxSTC_FIND_REGEXP end
editor:SetSearchFlags(flags)
@@ -185,7 +185,6 @@ function findReplace:ReplaceString(fReplaceAll, inFileRegister)
local replaced = false
if findReplace:HasText() then
local replaceLen = string.len(findReplace.replaceText)
local editor = findReplace:GetEditor()
local endTarget = inFileRegister and setTargetAll(editor) or
setTarget(editor, findReplace.fDown, fReplaceAll, findReplace.fWrap)
@@ -200,8 +199,11 @@ function findReplace:ReplaceString(fReplaceAll, inFileRegister)
if (inFileRegister) then inFileRegister(posFind) end
local length = editor:GetLength()
editor:ReplaceTarget(findReplace.replaceText)
editor:SetTargetStart(posFind + replaceLen)
local replaced = findReplace.fRegularExpr
and editor:ReplaceTargetRE(findReplace.replaceText)
or editor:ReplaceTarget(findReplace.replaceText)
editor:SetTargetStart(posFind + replaced)
-- adjust the endTarget as the position could have changed;
-- can't simply subtract findText length as it could be a regexp
endTarget = endTarget + (editor:GetLength() - length)
@@ -216,10 +218,21 @@ function findReplace:ReplaceString(fReplaceAll, inFileRegister)
ide.frame:SetStatusText(("%s %s."):format(
TR("Replaced"), TR("%d instance", occurrences):format(occurrences)))
else
if findReplace.foundString then
-- check if there is anything selected as well as the user can
-- move the cursor after successful search
if findReplace.foundString
and editor:GetSelectionStart() ~= editor:GetSelectionEnd() then
local start = editor:GetSelectionStart()
editor:ReplaceSelection(findReplace.replaceText)
editor:SetSelection(start, start + replaceLen)
-- convert selection to target as we need TargetRE support
editor:TargetFromSelection()
local length = editor:GetLength()
local replaced = findReplace.fRegularExpr
and editor:ReplaceTargetRE(findReplace.replaceText)
or editor:ReplaceTarget(findReplace.replaceText)
editor:SetSelection(start, start + replaced)
findReplace.foundString = false
replaced = true
@@ -254,7 +267,7 @@ local function ProcInFiles(startdir,mask,subdirs,replace)
-- ignore .bak files when replacing and asked to store .bak files
-- and skip folders as these are included in the list as well
if not (replace and findReplace.fMakeBak and file:find('.bak$'))
and not file:match(string_Pathsep.."$") then
and not IsDirectory(file) then
local match = false
for _, mask in ipairs(masks) do match = match or file:find(mask) end
if match then
@@ -276,6 +289,10 @@ local function ProcInFiles(startdir,mask,subdirs,replace)
-- give time to the UI to refresh
if TimeGet() - start > 0.25 then wx.wxYield() end
if not findReplace.dialog:IsShown() then
DisplayOutputLn(TR("Cancelled by the user."))
break
end
end
end
end
@@ -289,6 +306,8 @@ function findReplace:RunInFiles(replace)
wx.wxDefaultPosition, wx.wxSize(1,1), wx.wxBORDER_STATIC)
findReplace.occurrences = 0
ActivateOutput()
local startdir = findReplace.filedirText
DisplayOutputLn(("%s '%s'."):format(
(replace and TR("Replacing") or TR("Searching for")),

View File

@@ -180,7 +180,12 @@ local function createNotebook(frame)
notebook:PopupMenu(menu)
end)
local function IfAtLeastOneTab(event) event:Enable(notebook:GetPageCount() > 0) end
local function IfAtLeastOneTab(event)
event:Enable(notebook:GetPageCount() > 0)
if ide.osname == 'Macintosh' and (event:GetId() == ID_CLOSEALL
or event:GetId() == ID_CLOSE and notebook:GetPageCount() <= 1)
then event:Enable(false) end
end
local function IfModified(event) event:Enable(EditorIsModified(GetEditor(selection))) end
notebook:Connect(ID_SAVE, wx.wxEVT_COMMAND_MENU_SELECTED, function ()

View File

@@ -78,6 +78,12 @@ ID_PROJECTDIRFROMFILE = NewID()
ID_PROJECTDIRCHOOSE = NewID()
-- Help menu
ID_ABOUT = wx.wxID_ABOUT
ID_HELPPROJECT = NewID()
ID_HELPDOCUMENTATION = NewID()
ID_HELPGETTINGSTARTED = NewID()
ID_HELPTUTORIALS = NewID()
ID_HELPFAQ = NewID()
ID_HELPCOMMUNITY = NewID()
-- Watch window menu items
ID_ADDWATCH = NewID()
ID_EDITWATCH = NewID()

View File

@@ -2,7 +2,7 @@
-- (C) 2012 Paul Kulchenko
local M, LA, LI, T = {}
local FAST = true
local FAST = false
local function init()
if LA then return end
@@ -44,7 +44,7 @@ function M.show_warnings(top_ast)
local function known(o) return not T.istype[o] end
local function index(f) -- build abc.def.xyz name recursively
return (f[1].tag == 'Id' and f[1][1] or index(f[1])) .. '.' .. f[2][1] end
local isseen, globseen = {}, {}
local isseen, globseen, fieldseen = {}, {}, {}
LA.walk(top_ast, function(ast)
local line = ast.lineinfo and ast.lineinfo.first[1] or 0
local path = ast.lineinfo and ast.lineinfo.first[4] or '?'
@@ -105,7 +105,14 @@ function M.show_warnings(top_ast)
-- added check for FAST as ast.seevalue relies on value evaluation,
-- which is very slow even on simple and short scripts
if not FAST and ast.isfield and not(known(ast.seevalue.value) and ast.seevalue.value ~= nil) then
warn("unknown field " .. name, ast.lineinfo.first[1], path)
if not fieldseen[name] then
fieldseen[name] = true
local parent = ast.parent
and (" in '"..index(ast.parent):gsub("%."..name.."$","").."'")
or ""
warn("first use of unknown field '" .. name .."'"..parent,
ast.lineinfo.first[1], path)
end
elseif ast.tag == 'Id' and not ast.localdefinition and not ast.definedglobal then
if not globseen[name] then
globseen[name] = true
@@ -136,7 +143,7 @@ function M.show_warnings(top_ast)
local note = vast.parent
and (vast.parent.tag == 'Call' or vast.parent.tag == 'Invoke')
and vast.parent.note
if note and not isseen[vast.parent] then
if note and not isseen[vast.parent] and type(name) == "string" then
isseen[vast.parent] = true
warn("function '" .. name .. "': " .. note, line, path)
end

View File

@@ -133,6 +133,9 @@ function MarkupStyle(editor, lines, linee)
local lines = lines or 0
if (lines < 0) then return end
-- if the current spec doesn't have any comments, nothing to style
if not next(editor.spec.iscomment) then return end
-- always style to the end as there may be comments that need re-styling
-- technically, this should be GetLineCount()-1, but we want to style
-- beyond the last line to make sure it is styled correctly

View File

@@ -25,6 +25,7 @@ local editMenu = wx.wxMenu{
{ },
{ ID_FOLD, TR("&Fold/Unfold All")..KSC(ID_FOLD), TR("Fold or unfold all code folds") },
{ ID_CLEARDYNAMICWORDS, TR("Clear &Dynamic Words")..KSC(ID_CLEARDYNAMICWORDS), TR("Resets the dynamic word list for autocompletion") },
{ ID_SORT, TR("&Sort")..KSC(ID_SORT), TR("Sort selected lines") },
{ },
}
@@ -53,10 +54,10 @@ function OnUpdateUIEditMenu(event)
local editor = getControlWithFocus()
if editor == nil then event:Enable(false); return end
local alwaysOn = { [ID_SELECTALL] = true, [ID_FOLD] = true,
local alwaysOn = { [ID_SELECTALL] = true, [ID_FOLD] = ide.config.editor.fold,
-- allow Cut and Copy commands as these work on a line if no selection
[ID_COPY] = true, [ID_CUT] = true,
[ID_COMMENT] = true, [ID_AUTOCOMPLETE] = true}
[ID_COMMENT] = true, [ID_AUTOCOMPLETE] = true, [ID_SORT] = true}
local menu_id = event:GetId()
local enable =
menu_id == ID_PASTE and editor:CanPaste() or
@@ -155,24 +156,82 @@ frame:Connect(ID_AUTOCOMPLETEENABLE, wx.wxEVT_COMMAND_MENU_SELECTED,
frame:Connect(ID_COMMENT, wx.wxEVT_COMMAND_MENU_SELECTED,
function (event)
local editor = GetEditor()
local buf = {}
if editor:GetSelectionStart() == editor:GetSelectionEnd() then
local lineNumber = editor:GetCurrentLine()
editor:SetSelection(editor:PositionFromLine(lineNumber), editor:GetLineEndPosition(lineNumber))
end
-- capture the current position in line to restore later
local curline = editor:GetCurrentLine()
local curlen = #editor:GetLine(curline)
local curpos = editor:GetCurrentPos()-editor:PositionFromLine(curline)
-- for multi-line selection, always start the first line at the beginning
local ssel, esel = editor:GetSelectionStart(), editor:GetSelectionEnd()
local sline = editor:LineFromPosition(ssel)
local eline = editor:LineFromPosition(esel)
local sel = ssel ~= esel
local rect = editor:SelectionIsRectangle()
local lc = editor.spec.linecomment
for line in string.gmatch(editor:GetSelectedText()..'\n', "(.-)\r?\n") do
if string.sub(line,1,#lc) == lc then
line = string.sub(line,#lc+1)
elseif #line > 0 then
line = lc..line
local qlc = lc:gsub(".", "%%%1")
-- figure out how to toggle comments; if there is at least one non-empty
-- line that doesn't start with a comment, need to comment
local comment = false
for line = sline, eline do
local pos = sel and (sline == eline or rect)
and ssel-editor:PositionFromLine(sline)+1 or 1
local text = editor:GetLine(line)
local _, cpos = text:find("^%s*"..qlc, pos)
if not cpos and text:find("%S")
-- ignore last line when the end of selection is at the first position
and (line == sline or line < eline or esel-editor:PositionFromLine(line) > 0) then
comment = true
break
end
table.insert(buf, line)
end
editor:ReplaceSelection(table.concat(buf,"\n"))
editor:BeginUndoAction()
-- go last to first as selection positions we captured may be affected
-- by text changes
for line = eline, sline, -1 do
local pos = sel and (sline == eline or rect)
and ssel-editor:PositionFromLine(sline)+1 or 1
local text = editor:GetLine(line)
local _, cpos = text:find("^%s*"..qlc, pos)
if not comment and cpos then
editor:DeleteRange(cpos-#lc+editor:PositionFromLine(line), #lc)
elseif comment and text:find("%S")
and (line == sline or line < eline or esel-editor:PositionFromLine(line) > 0) then
editor:InsertText(pos+editor:PositionFromLine(line)-1, lc)
end
end
editor:EndUndoAction()
-- fix position if it was after where the selection started
if editor:PositionFromLine(curline)+curpos > ssel then
-- position the cursor exactly where its position was, which
-- could have shifted depending on whether the text was added or removed.
editor:GotoPos(editor:PositionFromLine(curline)
+ math.max(0, curpos+#editor:GetLine(curline)-curlen))
end
end)
frame:Connect(ID_COMMENT, wx.wxEVT_UPDATE_UI, OnUpdateUIEditMenu)
frame:Connect(ID_SORT, wx.wxEVT_COMMAND_MENU_SELECTED,
function (event)
local editor = GetEditor()
local buf = {}
for line in string.gmatch(editor:GetSelectedText()..'\n', "(.-)\r?\n") do
table.insert(buf, line)
end
if #buf > 0 then
local newline
if #(buf[#buf]) == 0 then newline = table.remove(buf) end
table.sort(buf)
-- add new line at the end if it was there
if newline then table.insert(buf, newline) end
editor:ReplaceSelection(table.concat(buf,"\n"))
end
end)
frame:Connect(ID_SORT, wx.wxEVT_UPDATE_UI, OnUpdateUIEditMenu)
frame:Connect(ID_FOLD, wx.wxEVT_COMMAND_MENU_SELECTED,
function (event)
FoldSome()

View File

@@ -154,7 +154,7 @@ do -- recent file history
end
end
frame:Connect(ID_NEW, wx.wxEVT_COMMAND_MENU_SELECTED, NewFile)
frame:Connect(ID_NEW, wx.wxEVT_COMMAND_MENU_SELECTED, function() return NewFile() end)
frame:Connect(ID_OPEN, wx.wxEVT_COMMAND_MENU_SELECTED, OpenFile)
frame:Connect(ID_SAVE, wx.wxEVT_COMMAND_MENU_SELECTED,
function ()

View File

@@ -8,8 +8,24 @@ local frame = ide.frame
local menuBar = frame.menuBar
local mobdebug = require "mobdebug"
local url = "http://download.zerobrane.com/zerobranestudio-"
local urls = {
[ID_HELPPROJECT] = "main",
[ID_HELPDOCUMENTATION] = "documentation",
[ID_HELPGETTINGSTARTED] = "gettingstarted",
[ID_HELPTUTORIALS] = "tutorials",
[ID_HELPFAQ] = "faq",
[ID_HELPCOMMUNITY] = "community",
}
local helpMenu = wx.wxMenu{
{ ID_ABOUT, TR("&About")..KSC(ID_ABOUT), TR("About %s"):format(GetIDEString("editor")) },
{ ID_HELPPROJECT, TR("&Project Page")..KSC(ID_HELPPROJECT) },
{ ID_HELPDOCUMENTATION, TR("&Documentation")..KSC(ID_HELPDOCUMENTATION) },
{ ID_HELPGETTINGSTARTED, TR("&Getting Started Guide")..KSC(ID_HELPGETTINGSTARTED) },
{ ID_HELPTUTORIALS, TR("&Tutorials")..KSC(ID_HELPTUTORIALS) },
{ ID_HELPFAQ, TR("&Frequently Asked Questions")..KSC(ID_HELPFAQ) },
{ ID_HELPCOMMUNITY, TR("&Community")..KSC(ID_HELPCOMMUNITY) },
}
-- do not translate Help menu on Mac as it won't merge with "standard" menus
menuBar:Append(helpMenu, ide.osname == 'Macintosh' and "&Help" or TR("&Help"))
@@ -94,3 +110,7 @@ local function DisplayAbout(event)
end
frame:Connect(ID_ABOUT, wx.wxEVT_COMMAND_MENU_SELECTED, DisplayAbout)
for item, page in pairs(urls) do
frame:Connect(item, wx.wxEVT_COMMAND_MENU_SELECTED,
function() wx.wxLaunchDefaultBrowser(url..page, 0) end)
end

View File

@@ -11,30 +11,6 @@ local uimgr = frame.uimgr
------------------------
-- Interpreters and Menu
local targetMenu
local interpreters = {}
local lastinterpreter
do
local interpreternames = {}
local lkinterpreters = {}
for i,v in pairs(ide.interpreters) do
interpreters[ID ("debug.interpreter."..i)] = v
v.fname = i
lastinterpreter = i
table.insert(interpreternames,v.name)
lkinterpreters[v.name] = i
end
assert(lastinterpreter,"no interpreters defined")
table.sort(interpreternames)
local targetargs = {}
for _,v in ipairs(interpreternames) do
local id = ID("debug.interpreter."..lkinterpreters[v])
local inter = interpreters[id]
table.insert(targetargs,{id,inter.name,inter.description,wx.wxITEM_CHECK})
end
targetMenu = wx.wxMenu(targetargs)
end
local debugTab = {
{ ID_RUN, TR("&Run")..KSC(ID_RUN), TR("Execute the current project/file") },
@@ -59,6 +35,7 @@ local targetDirMenu = wx.wxMenu{
{ID_PROJECTDIRCHOOSE, TR("Choose ...")..KSC(ID_PROJECTDIRCHOOSE), TR("Choose a project directory")},
{ID_PROJECTDIRFROMFILE, TR("Set From Current File")..KSC(ID_PROJECTDIRFROMFILE), TR("Set project directory from current file")},
}
local targetMenu = wx.wxMenu({})
local debugMenu = wx.wxMenu(debugTab)
local debugMenuRun = {
start=TR("Start &Debugging")..KSC(ID_STARTDEBUG), continue=TR("Co&ntinue")..KSC(ID_STARTDEBUG)}
@@ -68,6 +45,75 @@ debugMenu:Append(ID_PROJECTDIR, TR("Project Directory"), targetDirMenu, TR("Set
debugMenu:Append(ID_INTERPRETER, TR("Lua &Interpreter"), targetMenu, TR("Set the interpreter to be used"))
menuBar:Append(debugMenu, TR("&Project"))
local interpreters
local function selectInterpreter(id)
for id in pairs(interpreters) do
menuBar:Check(id, false)
menuBar:Enable(id, true)
end
menuBar:Check(id, true)
menuBar:Enable(id, false)
if ide.interpreter and ide.interpreter ~= interpreters[id] then
PackageEventHandle("onInterpreterClose", ide.interpreter) end
ide.interpreter = interpreters[id]
PackageEventHandle("onInterpreterLoad", ide.interpreter)
DebuggerShutdown()
ide.frame.statusBar:SetStatusText(ide.interpreter.name or "", 5)
ReloadLuaAPI()
end
function ProjectSetInterpreter(name)
local id = IDget("debug.interpreter."..name)
if (not interpreters[id]) then return end
selectInterpreter(id)
end
local function evSelectInterpreter(event)
selectInterpreter(event:GetId())
end
function UpdateInterpreters()
assert(ide.interpreters, "no interpreters defined")
-- delete all existing items (if any)
local items = targetMenu:GetMenuItemCount()
for i = items, 1, -1 do
targetMenu:Delete(targetMenu:FindItemByPosition(i-1))
end
local names = {}
for file in pairs(ide.interpreters) do table.insert(names, file) end
table.sort(names)
interpreters = {}
for i, file in ipairs(names) do
local inter = ide.interpreters[file]
local id = ID("debug.interpreter."..file)
inter.fname = file
interpreters[id] = inter
targetMenu:Append(
wx.wxMenuItem(targetMenu, id, inter.name, inter.description, wx.wxITEM_CHECK))
frame:Connect(id, wx.wxEVT_COMMAND_MENU_SELECTED, evSelectInterpreter)
end
local id = (
-- interpreter is set and is (still) on the list of known interpreters
IDget("debug.interpreter."
..(ide.interpreter and ide.interpreters[ide.interpreter.fname]
and ide.interpreter.fname or ide.config.interpreter)) or
-- otherwise use default interpreter
ID("debug.interpreter."..ide.config.default.interpreter)
)
selectInterpreter(id)
end
UpdateInterpreters()
-----------------------------
-- Project directory handling
@@ -118,52 +164,8 @@ local function projFromFile(event)
end
frame:Connect(ID_PROJECTDIRFROMFILE, wx.wxEVT_COMMAND_MENU_SELECTED, projFromFile)
------------------------------------
-- Interpreter Selection and Running
local function selectInterpreter(id)
for id in pairs(interpreters) do
menuBar:Check(id, false)
menuBar:Enable(id, true)
end
menuBar:Check(id, true)
menuBar:Enable(id, false)
if ide.interpreter and ide.interpreter ~= interpreters[id] then
PackageEventHandle("onInterpreterClose", ide.interpreter) end
ide.interpreter = interpreters[id]
PackageEventHandle("onInterpreterLoad", ide.interpreter)
DebuggerShutdown()
ide.frame.statusBar:SetStatusText(ide.interpreter.name or "", 5)
ReloadLuaAPI()
end
function ProjectSetInterpreter(name)
local id = IDget("debug.interpreter."..name)
if (not interpreters[id]) then return end
selectInterpreter(id)
end
local function evSelectInterpreter(event)
selectInterpreter(event:GetId())
end
for id in pairs(interpreters) do
frame:Connect(id,wx.wxEVT_COMMAND_MENU_SELECTED,evSelectInterpreter)
end
do
local defaultid = (
IDget("debug.interpreter."..ide.config.interpreter) or
ID("debug.interpreter."..lastinterpreter)
)
ide.interpreter = interpreters[defaultid]
menuBar:Check(defaultid, true)
end
----------------------
-- Interpreter Running
local function getNameToRun(skipcheck)
local editor = GetEditor()
@@ -181,6 +183,7 @@ local function getNameToRun(skipcheck)
local id = editor:GetId()
if not openDocuments[id].filePath then SetDocumentModified(id, true) end
if not SaveIfModified(editor) then return end
if ide.config.editor.saveallonrun then SaveAll(true) end
return wx.wxFileName(openDocuments[id].filePath)
end
@@ -398,5 +401,6 @@ frame:Connect(wx.wxEVT_IDLE,
if (debugger.update) then debugger.update() end
if (debugger.scratchpad) then DebuggerRefreshScratchpad() end
if IndicateIfNeeded() then event:RequestMore(true) end
PackageEventHandleOnce("onIdleOnce", event)
event:Skip() -- let other EVT_IDLE handlers to work on the event
end)

View File

@@ -19,8 +19,7 @@ local findMenu = wx.wxMenu{
{ ID_REPLACEINFILES, TR("Re&place In Files")..KSC(ID_REPLACEINFILES), TR("Find and replace text in files") },
{ },
{ ID_GOTOLINE, TR("&Goto Line")..KSC(ID_GOTOLINE), TR("Go to a selected line") },
{ },
{ ID_SORT, TR("&Sort")..KSC(ID_SORT), TR("Sort selected lines") }}
}
menuBar:Append(findMenu, TR("&Search"))
function OnUpdateUISearchMenu(event) event:Enable(GetEditor() ~= nil) end
@@ -95,17 +94,3 @@ frame:Connect(ID_GOTOLINE, wx.wxEVT_COMMAND_MENU_SELECTED,
end
end)
frame:Connect(ID_GOTOLINE, wx.wxEVT_UPDATE_UI, OnUpdateUISearchMenu)
frame:Connect(ID_SORT, wx.wxEVT_COMMAND_MENU_SELECTED,
function (event)
local editor = GetEditor()
local buf = {}
for line in string.gmatch(editor:GetSelectedText()..'\n', "(.-)\r?\n") do
table.insert(buf, line)
end
if #buf > 0 then
table.sort(buf)
editor:ReplaceSelection(table.concat(buf,"\n"))
end
end)
frame:Connect(ID_SORT, wx.wxEVT_UPDATE_UI, OnUpdateUISearchMenu)

View File

@@ -19,7 +19,7 @@ errorlog:StyleSetFont(wxstc.wxSTC_STYLE_DEFAULT, ide.font.oNormal)
errorlog:SetBufferedDraw(not ide.config.hidpi and true or false)
errorlog:StyleClearAll()
errorlog:SetMarginWidth(1, 16) -- marker margin
errorlog:SetMarginType(1, wxstc.wxSTC_MARGIN_SYMBOL);
errorlog:SetMarginType(1, wxstc.wxSTC_MARGIN_SYMBOL)
errorlog:MarkerDefine(StylesGetMarker("message"))
errorlog:MarkerDefine(StylesGetMarker("prompt"))
errorlog:SetReadOnly(true)
@@ -68,18 +68,18 @@ function DetachChildProcess()
end
function CommandLineRunning(uid)
for pid,custom in pairs(customprocs) do
if (custom.uid == uid and custom.proc and custom.proc.Exists(tonumber(tostring(pid)))) then
return true
for pid, custom in pairs(customprocs) do
if (custom.uid == uid and custom.proc and custom.proc.Exists(tonumber(pid))) then
return pid, custom.proc
end
end
return false
return
end
function CommandLineToShell(uid,state)
for pid,custom in pairs(customprocs) do
if ((pid == uid or custom.uid == uid) and custom.proc and custom.proc.Exists(tonumber(tostring(pid))) )then
if (pid == uid or custom.uid == uid) and custom.proc and custom.proc.Exists(tonumber(pid)) then
if (streamins[pid]) then streamins[pid].toshell = state end
if (streamerrs[pid]) then streamerrs[pid].toshell = state end
return true
@@ -305,33 +305,41 @@ local jumptopatterns = {
}
errorlog:Connect(wxstc.wxEVT_STC_DOUBLECLICK,
function()
function(event)
local line = errorlog:GetCurrentLine()
local linetx = errorlog:GetLine(line)
-- try to detect a filename + line
-- in linetx
local fname
local jumpline
local jumplinepos
-- try to detect a filename and line in linetx
local fname, jumpline, jumplinepos
for _,pattern in ipairs(jumptopatterns) do
fname,jumpline,jumplinepos = linetx:match(pattern)
if (fname and jumpline) then
break
end
if (fname and jumpline) then break end
end
if (fname and jumpline) then
LoadFile(fname,nil,true)
local editor = GetEditor()
local name = GetFullPathIfExists(FileTreeGetDir(), fname)
or FileTreeFindByPartialName(fname)
-- fname may include name of executable, as in "path/to/lua: file.lua";
-- strip it and try to find match again if needed
local fixedname = fname:match(": (.+)")
if not name and fixedname then
name = GetFullPathIfExists(FileTreeGetDir(), fixedname)
or FileTreeFindByPartialName(fixedname)
end
local editor = LoadFile(name or fname,nil,true)
if (editor) then
jumpline = tonumber(jumpline)
jumplinepos = tonumber(jumplinepos)
--editor:ScrollToLine(jumpline)
editor:GotoPos(editor:PositionFromLine(math.max(0,jumpline-1)) + (jumplinepos and (math.max(0,jumplinepos-1)) or 0))
editor:GotoPos(editor:PositionFromLine(math.max(0,jumpline-1))
+ (jumplinepos and (math.max(0,jumplinepos-1)) or 0))
editor:SetFocus()
-- doubleclick can set selection, so reset it
errorlog:SetSelection(event:GetPosition(), event:GetPosition())
event:Skip()
end
end
end)

View File

@@ -17,6 +17,18 @@ function PackageEventHandle(event, ...)
return success
end
function PackageEventHandleOnce(event, ...)
local success = PackageEventHandle(event, ...)
-- remove all handlers as they need to be called only once
-- this allows them to be re-installed if needed
for _, package in pairs(ide.packages) do
if type(package[event]) == 'function' then
package[event] = nil
end
end
return success
end
local function PackageEventHandleOne(file, event, ...)
local package = ide.packages[file]
if package and type(package[event]) == 'function' then
@@ -47,9 +59,32 @@ function PackageRegister(file, ...)
return PackageEventHandleOne(file, "onRegister", ...)
end
function ide:GetEditor() return GetEditor() end
function ide:GetEditor(index) return GetEditor(index) end
function ide:GetMenuBar() return self.frame.menuBar end
function ide:GetMainFrame() return self.frame end
function ide:GetDocument(ed) return self.openDocuments[ed:GetId()] end
function ide:GetInterpreter() return self.interpreter end
function ide:GetConfig() return self.config end
function ide:GetOutput() return self.frame.bottomnotebook.errorlog end
function ide:GetEditorNotebook() return self.frame.notebook end
function ide:AddInterpreter(name, interpreter)
self.interpreters[name] = setmetatable(interpreter, ide.proto.Interpreter)
UpdateInterpreters()
end
function ide:RemoveInterpreter(name)
self.interpreters[name] = nil
UpdateInterpreters()
end
function ide:AddSpec(name, spec)
self.specs[name] = spec
UpdateSpecs()
end
function ide:RemoveSpec(name) self.specs[name] = nil end
function ide:AddAPI(type, name, api)
self.apis[type] = self.apis[type] or {}
self.apis[type][name] = api
end
function ide:RemoveAPI(type, name) self.apis[type][name] = nil end

View File

@@ -10,6 +10,9 @@ ide.proto.Document = {__index = {
ide.proto.Plugin = {__index = {
GetName = function(self) return self.name end,
GetFileName = function(self) return self.fname end,
GetConfig = function(self) return ide.config[self.fname] or {} end,
GetSettings = function(self) return SettingsRestorePackage(self.fname) end,
SetSettings = function(self, settings) SettingsSavePackage(self.fname, settings) end,
}}
ide.proto.Interpreter = {__index = {

View File

@@ -212,7 +212,7 @@ function SettingsSaveProjectSession(projdirs)
settings:Write(tostring(i), dir)
local opendocs, params = ProjectConfig(dir)
if opendocs and #opendocs > 0 then
if opendocs then
SettingsSaveFileSession(opendocs, params, listname .. "/" .. tostring(i))
end
end
@@ -220,6 +220,38 @@ function SettingsSaveProjectSession(projdirs)
settings:SetPath(path)
end
function SettingsRestorePackage(package)
local packagename = "/package/"..package
local path = settings:GetPath()
settings:SetPath(packagename)
local outtab = {}
local ismore, key, index = settings:GetFirstEntry("", 0)
while (ismore) do
local couldread, value = settings:Read(key, "")
if couldread then
local ok, res = LoadSafe("return "..value)
if ok then outtab[key] = res
else outtab[key] = nil end
end
ismore, key, index = settings:GetNextEntry(index)
end
settings:SetPath(path)
return outtab
end
function SettingsSavePackage(package, values)
local packagename = "/package/"..package
local path = settings:GetPath()
local mdb = require('mobdebug')
settings:DeleteGroup(packagename)
settings:SetPath(packagename)
for k,v in pairs(values or {}) do
settings:Write(k, mdb.line(v, {comment = false, nocode = true}))
end
settings:SetPath(path)
end
-----------------------------------
local function saveNotebook(nb)

View File

@@ -75,10 +75,11 @@ end
local function getInput(line)
local nextMarker = line
local count = out:GetLineCount()
repeat
repeat -- check until we find at least some marker
nextMarker = nextMarker+1
until out:MarkerGet(nextMarker) > 0 -- check until we find at least some marker
until out:MarkerGet(nextMarker) > 0 or nextMarker > count-1
return chomp(out:GetTextRange(out:PositionFromLine(line),
out:PositionFromLine(nextMarker)))
end
@@ -97,7 +98,6 @@ local function getNextHistoryLine(forward, promptText)
else
currentHistory = out:MarkerPrevious(currentHistory-1, PROMPT_MARKER_VALUE)
if currentHistory == -1 then
currentHistory = -1
return ""
end
end
@@ -110,6 +110,26 @@ local function getNextHistoryLine(forward, promptText)
return getInput(currentHistory)
end
local function getNextHistoryMatch(promptText)
local count = out:GetLineCount()
if currentHistory == nil then currentHistory = count end
local current = currentHistory
while true do
currentHistory = out:MarkerPrevious(currentHistory-1, PROMPT_MARKER_VALUE)
if currentHistory == -1 then -- restart search from the last item
currentHistory = count
elseif currentHistory ~= getPromptLine() then -- skip current prompt
local input = getInput(currentHistory)
if input:find(promptText, 1, true) == 1 then return input end
end
-- couldn't find anything and made a loop; get out
if currentHistory == current then return end
end
assert(false, "getNextHistoryMatch coudn't find a proper match")
end
local function shellPrint(marker, ...)
local cnt = select('#',...)
if cnt == 0 then return end -- return if nothing to print
@@ -380,6 +400,28 @@ out:Connect(wx.wxEVT_KEY_DOWN,
local promptText = getPromptText()
setPromptText(getNextHistoryLine(true, promptText))
return
elseif key == wx.WXK_TAB then
-- if we are above the prompt line, then don't move
local promptline = getPromptLine()
if out:GetCurrentLine() < promptline then return end
local promptText = getPromptText()
-- save the position in the prompt text to restore
local pos = out:GetCurrentPos()
local text = promptText:sub(1, positionInLine(promptline))
if #text == 0 then return end
-- find the next match and set the prompt text
local match = getNextHistoryMatch(text)
if match then
setPromptText(match)
-- restore the position to make it easier to find the next match
out:GotoPos(pos)
end
return
elseif key == wx.WXK_ESCAPE then
setPromptText("")
return
elseif key == wx.WXK_LEFT or key == wx.WXK_NUMPAD_LEFT then
if not caretOnPromptLine(true) then return end
elseif key == wx.WXK_BACK then

View File

@@ -8,6 +8,7 @@
-- ---------------------------
-- fg foreground - {r,g,b} 0-255
-- bg background - {r,g,b} 0-255
-- sel color of the selected block - {r,g,b} 0-255 (only applies to folds)
-- u underline - boolean
-- b bold - boolean
-- i italic - boolean
@@ -51,7 +52,7 @@ function StylesGetDefault()
sel = {bg = {192, 192, 192}},
caret = {fg = {0, 0, 0}},
caretlinebg = {bg = {240, 240, 230}},
fold = {fg = {90, 90, 80}, bg = {250, 250, 250}},
fold = {fg = {90, 90, 80}, bg = {250, 250, 250}, sel = {90+96, 90, 80}},
whitespace = nil,
-- deprecated; allowed for backward compatibility in case someone does
@@ -94,13 +95,10 @@ local markers = {
}
function StylesGetMarker(marker) return unpack(markers[marker] or {}) end
local function applymarker(editor,marker,clrfg,clrbg)
if (clrfg) then
editor:MarkerSetForeground(marker,clrfg)
end
if (clrbg) then
editor:MarkerSetBackground(marker,clrbg)
end
local function applymarker(editor,marker,clrfg,clrbg,clrsel)
if (clrfg) then editor:MarkerSetForeground(marker,clrfg) end
if (clrbg) then editor:MarkerSetBackground(marker,clrbg) end
if (ide.wxver >= "2.9.5" and clrsel) then editor:MarkerSetBackgroundSelected(marker,clrsel) end
end
local specialmapping = {
sel = function(editor,style)
@@ -152,21 +150,25 @@ local specialmapping = {
fold = function(editor,style)
local clrfg = style.fg and wx.wxColour(unpack(style.fg))
local clrbg = style.bg and wx.wxColour(unpack(style.bg))
local clrsel = style.sel and wx.wxColour(unpack(style.sel))
if (clrfg or clrbg) then
-- if selected background is set then enable support for it
if ide.wxver >= "2.9.5" and clrsel then editor:MarkerEnableHighlight(true) end
if (clrfg or clrbg or clrsel) then
-- foreground and background are defined as opposite to what I'd expect
-- for fold markers in Scintilla's terminilogy:
-- background is the color of fold lines/boxes and foreground is the color
-- of everything around fold lines or inside fold boxes.
-- in the following code fg and bg are simply reversed
local clrfg, clrbg = clrbg, clrfg
applymarker(editor,wxstc.wxSTC_MARKNUM_FOLDEROPEN, clrfg, clrbg)
applymarker(editor,wxstc.wxSTC_MARKNUM_FOLDER, clrfg, clrbg)
applymarker(editor,wxstc.wxSTC_MARKNUM_FOLDERSUB, clrfg, clrbg)
applymarker(editor,wxstc.wxSTC_MARKNUM_FOLDERTAIL, clrfg, clrbg)
applymarker(editor,wxstc.wxSTC_MARKNUM_FOLDEREND, clrfg, clrbg)
applymarker(editor,wxstc.wxSTC_MARKNUM_FOLDEROPENMID, clrfg, clrbg)
applymarker(editor,wxstc.wxSTC_MARKNUM_FOLDERMIDTAIL, clrfg, clrbg)
applymarker(editor,wxstc.wxSTC_MARKNUM_FOLDEROPEN, clrfg, clrbg, clrsel)
applymarker(editor,wxstc.wxSTC_MARKNUM_FOLDER, clrfg, clrbg, clrsel)
applymarker(editor,wxstc.wxSTC_MARKNUM_FOLDERSUB, clrfg, clrbg, clrsel)
applymarker(editor,wxstc.wxSTC_MARKNUM_FOLDERTAIL, clrfg, clrbg, clrsel)
applymarker(editor,wxstc.wxSTC_MARKNUM_FOLDEREND, clrfg, clrbg, clrsel)
applymarker(editor,wxstc.wxSTC_MARKNUM_FOLDEROPENMID, clrfg, clrbg, clrsel)
applymarker(editor,wxstc.wxSTC_MARKNUM_FOLDERMIDTAIL, clrfg, clrbg, clrsel)
end
if clrbg then
-- the earlier calls only color the actual markers, but not the

View File

@@ -45,10 +45,13 @@ ide = {
verbose = false,
hostname = nil,
port = nil,
runonstart = nil,
redirect = nil,
},
default = {
name = 'untitled',
fullname = 'untitled.lua',
interpreter = 'luadeb',
},
outputshell = {},
filetree = {},
@@ -60,7 +63,6 @@ ide = {
styles = nil,
stylesoutshell = nil,
interpreter = "_undefined_",
autocomplete = true,
autoanalizer = true,
@@ -85,7 +87,6 @@ ide = {
},
specs = {
none = {
linecomment = ">",
sep = "\1",
}
},
@@ -93,6 +94,7 @@ ide = {
iofilters = {},
interpreters = {},
packages = {},
apis = {},
proto = {}, -- prototypes for various classes
@@ -147,6 +149,24 @@ if not wx.wxMOD_SHIFT then wx.wxMOD_SHIFT = 0x04 end
-- wxDIR_NO_FOLLOW is missing in wxlua 2.8.12 as well
if not wx.wxDIR_NO_FOLLOW then wx.wxDIR_NO_FOLLOW = 0x10 end
if not setfenv then -- Lua 5.2
-- based on http://lua-users.org/lists/lua-l/2010-06/msg00314.html
-- this assumes f is a function
local function findenv(f)
local level = 1
repeat
local name, value = debug.getupvalue(f, level)
if name == '_ENV' then return level, value end
level = level + 1
until name == nil
return nil end
getfenv = function (f) return(select(2, findenv(f)) or _G) end
setfenv = function (f, t)
local level = findenv(f)
if level then debug.setupvalue(f, level, t) end
return f end
end
for _, file in ipairs({"ids", "style", "keymap", "proto"}) do
dofile("src/editor/"..file..".lua")
end
@@ -157,12 +177,12 @@ ide.config.stylesoutshell = StylesGetDefault()
local function setLuaPaths(mainpath, osname)
-- use LUA_DEV to setup paths for Lua for Windows modules if installed
local luadev = osname == "Windows" and os.getenv('LUA_DEV')
local luadev_path = (luadev
local luadev_path = (luadev and wx.wxDirExists(luadev)
and ('LUA_DEV/?.lua;LUA_DEV/?/init.lua;LUA_DEV/lua/?.lua;LUA_DEV/lua/?/init.lua')
:gsub('LUA_DEV', (luadev:gsub('[\\/]$','')))
or "")
local luadev_cpath = (luadev
and ('LUA_DEV/?.dll;LUA_DEV/clibs/?.dll')
local luadev_cpath = (luadev and wx.wxDirExists(luadev)
and ('LUA_DEV/?.dll;LUA_DEV/?51.dll;LUA_DEV/clibs/?.dll;LUA_DEV/clibs/?51.dll')
:gsub('LUA_DEV', (luadev:gsub('[\\/]$','')))
or "")
@@ -255,10 +275,7 @@ local function loadPackages(filter)
for fname, package in pairs(ide.packages) do package.fname = fname end
end
-- load specs
local function loadSpecs(filter)
loadToTab(filter or "specs", "spec", ide.specs, true)
function UpdateSpecs()
for _, spec in pairs(ide.specs) do
spec.sep = spec.sep or "\1" -- default separator doesn't match anything
spec.iscomment = {}
@@ -284,6 +301,12 @@ local function loadSpecs(filter)
end
end
-- load specs
local function loadSpecs(filter)
loadToTab(filter or "specs", "spec", ide.specs, true)
UpdateSpecs()
end
-- temporarily replace print() to capture reported error messages to show
-- them later in the Output window after everything is loaded.
local resumePrint do
@@ -360,7 +383,7 @@ loadSpecs()
loadTools()
do
local home = os.getenv("HOME")
local home = os.getenv("HOME") or (iswindows and (os.getenv('HOMEDRIVE')..os.getenv('HOMEPATH')))
ide.configs = {
system = MergeFullPath("cfg", "user.lua"),
user = home and MergeFullPath(home, ".zbstudio/user.lua"),
@@ -374,7 +397,7 @@ do
for _, v in ipairs(configs) do addConfig(v, true) end
configs = nil
local sep = string_Pathsep
local sep = GetPathSeparator()
if ide.config.language then
LoadLuaFileExt(ide.config.messages, "cfg"..sep.."i18n"..sep..ide.config.language..".lua")
end
@@ -438,6 +461,8 @@ end
resumePrint()
PackageEventHandle("onAppLoad")
ide.frame:Show(true)
wx.wxGetApp():MainLoop()

View File

@@ -28,13 +28,14 @@ function HasBit(value, num)
return true
end
-- ASCII values for common chars
char_CR = string.byte("\r")
char_LF = string.byte("\n")
char_Tab = string.byte("\t")
char_Sp = string.byte(" ")
function GetPathSeparator()
return string.char(wx.wxFileName.GetPathSeparator())
end
string_Pathsep = string.char(wx.wxFileName.GetPathSeparator())
do
local sep = GetPathSeparator()
function IsDirectory(dir) return dir:find(sep.."$") end
end
function StripCommentsC(tx)
local out = ""
@@ -121,9 +122,6 @@ function PrependStringToArray(t, s, maxstrings, issame)
if #t > (maxstrings or 15) then table.remove(t, #t) end -- keep reasonable length
end
-- ----------------------------------------------------------------------------
-- Get file modification time, returns a wxDateTime (check IsValid) or nil if
-- the file doesn't exist
function GetFileModTime(filePath)
if filePath and #filePath > 0 then
local fn = wx.wxFileName(filePath)
@@ -240,6 +238,9 @@ function FileWrite(file, content)
end
function FileRead(file)
-- on OSX "Open" dialog allows to open applications, which are folders
if wx.wxDirExists(file) then return nil, "Can't read directory as file." end
local log = wx.wxLogNull() -- disable error reporting; will report as needed
local file = wx.wxFile(file, wx.wxFile.read)
if not file:IsOpened() then return nil, wx.wxSysErrorMsg() end
@@ -298,6 +299,22 @@ function RequestAttention()
if ide.osname == "Macintosh" then
local cmd = [[osascript -e 'tell application "%s" to activate']]
wx.wxExecute(cmd:format(ide.editorApp:GetAppName()), wx.wxEXEC_ASYNC)
elseif ide.osname == "Windows" then
local winapi = require 'winapi'
if winapi then
local pid = winapi.get_current_pid()
local wins = winapi.find_all_windows(function(w)
return w:get_process():get_pid() == pid
and w:get_class_name() == 'wxWindowNR'
end)
if wins and #wins > 0 then
-- found the window, now need to activate it:
-- send Alt key to the current window and then
-- bring our window to foreground (doesn't work without Alt pressed)
winapi.send_to_window(307)
wins[1]:set_foreground()
end
end
end
end
end
@@ -341,11 +358,20 @@ function LoadLuaFileExt(tab, file, proto)
if not cfgfn then
print(("Error while loading file: '%s'."):format(err))
else
local name = file:match("([a-zA-Z_0-9]+)%.lua$")
local name = file:match("([a-zA-Z_0-9%-]+)%.lua$")
if not name then return end
-- check if os/arch matches to allow packages for different systems
local os, arch = name:match("-(%w+)-?(%w*)")
if os and os:lower() ~= ide.osname:lower()
or arch and #arch > 0 and arch:lower() ~= ide.osarch:lower()
then return end
if os then name = name:gsub("-.*","") end
local success, result = pcall(function()return cfgfn(assert(_G or _ENV))end)
if not success then
print(("Error while processing file: '%s'."):format(result))
elseif name then
else
if (tab[name]) then
local out = tab[name]
for i,v in pairs(result) do
@@ -357,3 +383,18 @@ function LoadLuaFileExt(tab, file, proto)
end
end
end
function LoadSafe(data)
local f, res = loadstring(data)
if not f then return f, res end
local count = 0
debug.sethook(function ()
count = count + 1
if count >= 3 then error("cannot call functions") end
end, "c")
local ok, res = pcall(f)
count = 0
debug.sethook()
return ok, res
end

View File

@@ -24,14 +24,23 @@ ok(limit(10000, function() CreateAutoCompList(editor, "smth:") end),
ok(pcall(CreateAutoCompList, editor, "%1000"),
"Auto-complete doesn't trigger 'invalid capture index' on '%...'.")
editor:SetText('') -- use Set/Add to position cursor after added text
editor:SetText('')
editor:AddText([[
result = result.list[1] --> "does the test" test
result.1
]])
ok(limit(10000, function() CreateAutoCompList(editor, "result.1") end),
"Auto-complete doesn't loop for table index reference.")
"Auto-complete doesn't loop for table index reference 1/2.")
editor:SetText('')
editor:AddText([[
self.popUpObjs = self.undoBuffer[0].sub
self.undoBuffer = self.undoBuffer[0]
self.popUpObjs[popUpNo].]])
ok(limit(10000, function() EditorAutoComplete(editor) end),
"Auto-complete doesn't loop for table index reference 2/2.")
local interpreter = ide:GetInterpreter():GetFileName()
ProjectSetInterpreter("gideros")
@@ -44,6 +53,17 @@ ok(c == 1,
ProjectSetInterpreter(interpreter)
editor:SetText('')
editor:AddText('print(1,io.')
local value
local ULS = editor.UserListShow
editor.UserListShow = function(editor, pos, list) value = list end
EditorAutoComplete(editor)
editor.UserListShow = ULS
ok(value and value:find("close"), "Auto-complete is shown after comma.")
-- cleanup
ide:GetDocument(editor).isModified = false
ClosePage()

18
t/3-tooltip.lua Normal file
View File

@@ -0,0 +1,18 @@
local editor = NewFile()
editor:SetText('print("select")')
-- this is to set proper styles, which are needed for EditorCallTip
editor:Colourise(0, -1)
local value
local CTS = editor.CallTipShow
editor.CallTipShow = function(editor, pos, tip) value = tip end
EditorCallTip(editor, 10)
editor.CallTipShow = CTS
ok(value:find("print") and not value:find("select"),
"Tooltip ignores values in strings.")
-- cleanup
ide:GetDocument(editor).isModified = false
ClosePage()

54
t/4-comment.lua Normal file
View File

@@ -0,0 +1,54 @@
local editor = NewFile()
local line = "246"
local comment = "%-%-"
editor:AddText(([[
1
%s
3]]):format(line))
local findReplace = ide.findReplace
findReplace.findText = line
findReplace:FindString()
ide.frame:ProcessEvent(wx.wxCommandEvent(
wx.wxEVT_COMMAND_MENU_SELECTED, ID_COMMENT))
local text = editor:GetText()
ok(text:find(comment..line) and not text:find(comment.."3"),
"One-line selection is commented.")
findReplace.findText = "--"..line
findReplace:FindString()
editor:SetCurrentPos(editor:GetLength())
ide.frame:ProcessEvent(wx.wxCommandEvent(
wx.wxEVT_COMMAND_MENU_SELECTED, ID_COMMENT))
text = editor:GetText()
ok(text:find(comment.." "..comment..line) and text:find(comment.."3"),
"Commented and uncommented lines are commented.")
findReplace:FindString()
editor:SetCurrentPos(editor:GetLength())
ide.frame:ProcessEvent(wx.wxCommandEvent(
wx.wxEVT_COMMAND_MENU_SELECTED, ID_COMMENT))
text = editor:GetText()
ok(not text:find(comment.." "..comment..line) and not text:find(comment.."3"),
"Multi-line commented text is uncommented.")
editor:SetAnchor(0)
editor:SetCurrentPos(editor:PositionFromLine(2))
ide.frame:ProcessEvent(wx.wxCommandEvent(
wx.wxEVT_COMMAND_MENU_SELECTED, ID_COMMENT))
text = editor:GetText()
ok(text:find(comment.." "..comment..line) and text:find(comment.."1") and not text:find(comment.."3"),
"Selection that ends at the beginning of the line doesn't comment line.")
-- cleanup
ide:GetDocument(editor).isModified = false
ClosePage()

Binary file not shown.

View File

@@ -13,7 +13,7 @@
<key>CFBundleIconFile</key>
<string>zbstudio.icns</string>
<key>CFBundleIdentifier</key>
<string></string>
<string>com.ZeroBrane.ZeroBraneStudio</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleLongVersionString</key>

View File

@@ -6,6 +6,7 @@ editor.tabwidth = 2
editor.usewrap = true
editor.calltipdelay = 500
editor.smartindent = true
editor.fold = true
local G = ... -- this now points to the global environment
if G.ide.osname == 'Macintosh' then

View File

@@ -1,2 +1,2 @@
icon ICON "zbstudio.ico"
1 RT_MANIFEST zbstudio.manifest
1 24 zbstudio.manifest