Author Topic: Jens' Script Editor - An on-calc lua editor  (Read 144140 times)

0 Members and 2 Guests are viewing this topic.

Offline mdr1

  • LV6 Super Member (Next: 500)
  • ******
  • Posts: 303
  • Rating: +21/-2
    • View Profile
Re: Jens' Script Editor - An on-calc lua editor
« Reply #195 on: July 22, 2014, 09:30:15 am »
It would be really great to avoid the confusion so that special characters can come back.

The 'fixed' file when launched has the following error: "40: attempt to call global 'getTableAsStrings' (a nil value)".



Offline Jens_K

  • LV4 Regular (Next: 200)
  • ****
  • Posts: 187
  • Rating: +52/-0
    • View Profile
Re: Jens' Script Editor - An on-calc lua editor
« Reply #196 on: July 22, 2014, 09:38:01 am »
The 'fixed' file when launched has the following error: "40: attempt to call global 'getTableAsStrings' (a nil value)".


Ok, fixed. NOW it should work...  ::)
Sorry for nonsense.

Projects:



Offline mdr1

  • LV6 Super Member (Next: 500)
  • ******
  • Posts: 303
  • Rating: +21/-2
    • View Profile
Re: Jens' Script Editor - An on-calc lua editor
« Reply #197 on: July 22, 2014, 10:42:35 am »
Bug report: It is possible to go to the next item on the auto-completion menu with the return key but the arrow keys throw an "attempt to call a boolean value".

EDIT: And [Shift] + [down key] at any time throws the same error.
« Last Edit: July 22, 2014, 10:47:48 am by mdr1 »



Offline Jens_K

  • LV4 Regular (Next: 200)
  • ****
  • Posts: 187
  • Rating: +52/-0
    • View Profile
Re: Jens' Script Editor - An on-calc lua editor
« Reply #198 on: August 24, 2014, 07:22:39 am »

After vacation, gamescom and eye surgery I finally have time to work again! So here's the 5th alpha release of v2.0!

New:
- settings menu
  - adjustable amount of spaces per indent
  - activatable unicode mode (replaces some string functions by their unicode representive)
  - activatable autoregistered menu (OS>3.1) on user script page which offers to:
    - stop and restart current script
    - pause and resume current script
    - show/hide ipad keyboard
- shift++/shift+- now lets you scroll pagewise through your script
- insert saved files (menu=>"File"=>"Insert") (to insert saved headers and other stuff) *lazy solution :P *

Improvements:
- rewrote some safety functions
  - You can do everything with the "on"-table now; the user script page wont crash, even on OS 3.1!
  - eventhandling with on's metatable is now possible with nearly no restrictions and crashes
  - still "on" is only for eventhandling. For table library functions, it acts like an empty table!
  - don't write on=yourTable, do setmetatable(on,{_index=yourTable}) instead!
- improved dialogues (default cursor, customizable color, click outside = escape key)
- the editor now registeres an error handler on OS>3.1 so that it shouldn't crash
- the editor now searches for saved files instead of remembering them => less lost files

Fixes:
- print function now handles nil values correctly
- recalling saved settings now works
- added table and coroutine libraries to autocompletion list
- fixed that some scriptnames (e.g. starting with letter "e") were not possible


Here's also my current todo-list:
Spoiler For todo:
fix undo bugs
more error details
better unicode mode (ufind function needed)
customizable "insert"/autocomplete function
customizable syntax highlighting
unlimited code length (It's currently limited by the maximum length of saveable strings (65528 chars))
advanced lua&api guide
empty tns/script loader (in search of better name :P )
autosave (on.save,on.destroy,run)

As always, please report any bugs you find! ;)
« Last Edit: August 24, 2014, 07:26:38 am by Jens_K »
Sorry for nonsense.

Projects:



Offline Vsod99

  • LV3 Member (Next: 100)
  • ***
  • Posts: 70
  • Rating: +1/-1
    • View Profile
Re: Jens' Script Editor - An on-calc lua editor
« Reply #199 on: August 26, 2014, 07:27:06 pm »
Sweet! I'm currently in the process of learning more advanced lua and the ability to do this on the go is great, glad you're still working on this project.

Offline Jens_K

  • LV4 Regular (Next: 200)
  • ****
  • Posts: 187
  • Rating: +52/-0
    • View Profile
Re: Jens' Script Editor - An on-calc lua editor
« Reply #200 on: October 07, 2014, 12:59:10 pm »

Hi!
Sorry for the late update, I didn't have much time lately; but finally here is the 1st beta release of JSE v2.0!


Improvemetns:
- Custom syntax coloration!
  - you can now add new word groups and lua patterns and set their display color
  - I added some example entries which you can of course modify and remove
- Scripts are now split into (max. 26) parts with maximum saveble length (65528 chars)
  ==> Scripts can now have up to 1.7 million characters!
  (this feature took very long, because many features like saving, loading, deleting, renaming and transferring have to be able to process parts now)
  - "Export via Clipboard"-dialogue added to easier export long scripts via the limited clipboard storage
- Fully functional unicode support
  - everything (syntax coloring, find function, etc.) now works correctly in unicode mode (it's just a bit slower)
  - Added dialogue, asking for unicode mode when entering a non-ascii-character
  - UTF-8-sequence-bytes in not-unicode-mode are now represented by "□"
- Autosave function ("File"=>"Settings"): Saves current code in some events
- Textboxes now have a movable cursor and support paste
- If the on-table gets overwritten during initialization, the programm throws an error
- Added "Tipps & Tricks"-dialogue which shows some useful keycombinations, newcomers might not know


Fixes:
- Fixed (hopefully) all undo & redo bugs
- Modules (like "physics") are now usable more than 1 time :P


Other changes & improvements:
- "Insert"-menu now only offers to insert statements (use the autocomplete menu for eveything else)
- You can now reset the console via menu=>Delete=>Delete all
- Increased undo history depth from 10 to 20 states
- Pressing a letter button on listboxes makes it select the first item starting with this letter
- Rearranged main menu a bit to make it more handy


Now that all major bugs are fixed and most main features of v2.0 are implemented, I declare the beta stage, so feel free to report all bugs and strange behaviours of JSE! I will of course continue to work on it until I have finished all things on my todo-list ;)
Sorry for nonsense.

Projects:



Offline Adriweb

  • Editor
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1708
  • Rating: +229/-17
    • View Profile
    • TI-Planet.org
Re: Jens' Script Editor - An on-calc lua editor
« Reply #201 on: October 07, 2014, 01:54:14 pm »
Nice !

Updated on TI-Planet too.
(however I was too lazy to translate the changelog so I just spoiler'ed a copy/paste :P)
My calculator programs
TI-Planet.org co-admin.
TI-Nspire Lua programming : Tutorials  |  API Documentation

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55943
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: Jens' Script Editor - An on-calc lua editor
« Reply #202 on: October 07, 2014, 01:54:51 pm »
Looks very neat! :D

Offline pierrotdu18

  • LV2 Member (Next: 40)
  • **
  • Posts: 23
  • Rating: +1/-0
    • View Profile
Re: Jens' Script Editor - An on-calc lua editor
« Reply #203 on: October 08, 2014, 01:28:45 pm »
It looks awesome !  :D


But... How can I do if I want for example to color only the content of the brackets after a function declaration ?
Like in sublime text : "function foo(a, b)", to put "a, b" in orange  ;D


Thanks a lot !


EDIT : In fact you should add a pritority for each pattern, cause as Lua patterns are not Regex...
For example, "function [%a%d%.]+%([%a%d%, ]*%)" colors me all the line even if I also have the pattern "function [%a%d%.]+" colored in an other color...
« Last Edit: October 08, 2014, 01:43:14 pm by pierrotdu18 »

Offline Jens_K

  • LV4 Regular (Next: 200)
  • ****
  • Posts: 187
  • Rating: +52/-0
    • View Profile
Re: Jens' Script Editor - An on-calc lua editor
« Reply #204 on: October 08, 2014, 03:55:37 pm »
Thanks for the feedback!


@pierrotdu18: Yes, I thought about this option too. In fact, there is already a rudimentary option like this implemented (add ",overwrite=true" to an entry in the variable in jse.patterns), but it overwrites other coloration in any case, even inside strings. I will improve the custom syntax feature in future releases and add stuff like stuff like priority and hierarchies!  ;)  Btw: I saw your new sublime version on ti-planet; nice job! :)
Sorry for nonsense.

Projects:



Offline pierrotdu18

  • LV2 Member (Next: 40)
  • **
  • Posts: 23
  • Rating: +1/-0
    • View Profile
Re: Jens' Script Editor - An on-calc lua editor
« Reply #205 on: October 08, 2014, 05:02:07 pm »
Thanks :)


Ok that's cool, thanks too :D
And... do you think it woud be possible to input Regex Code and to treat inside the program the conversion to Lua patterns ?... Maybe it is impossible I don't know :p


Anyway, great job !  :thumbsup:

Offline Jens_K

  • LV4 Regular (Next: 200)
  • ****
  • Posts: 187
  • Rating: +52/-0
    • View Profile
Re: Jens' Script Editor - An on-calc lua editor
« Reply #206 on: October 26, 2014, 04:06:47 pm »
Hello! We're getting close to the final release; here's the 2nd beta release of JSE v2.0 :D ! This time I also attached the current (unfinished) state of the advanced Lua and physics api guide ;)

New:
- Autocompletion Settings (menu=>"File"=>"Settings"=>"Autocompletion Settings"):
  - You can now add own entries to the autocompletion list
  - If not disabled, after running your script, all global variable names are added to the autocomplete menu (Thanks CinusMinus for the idea!)
- Custom pattern are now colored in the set order
  - patterns are movable in the hierarchy list with + and -
- Advanced Lua Guide Loader on page 1.4
- User Script page now can print the value of an entered global value after a runtime error and after stopping the script
- Double click on a alphanumeric word to select it
  - Triple click on a sequence of non-space-characters to select it
- New Dialogue added, which asks for the calculator layout and then shows all character shortcut buttons

Improvements:
- Setting the apilevel in a script had caused bugs; it's now protected
- Vastly improved unicode-mode speed
- Improved method to reset global environment (some strange behaviours may be fixed now)
- console app now also uses the custom color-set of the editor
- Monitored variables will now be unmoitored after stopping the script
- Disabled rendering code as background for some dialogues to improve performance (only on handheld)
- Rewritten character-centering algorithm => unicode characters are now correctly monospaced

Other changes:
- User Script Page auto-registered menu is now enbled by default
- User Script Page now warns you if your script is ready but it's not focused
- Various fixes and performance improvements

About the advanced Lua Guide:
- It includes basic functions and libraries, directly parsed from http://www.lua.org/manual/5.1/manual.html
- It also includes the Phsysics part of the TI-Nspire Lua Scripting API Reference Guide (work in progress!)
- The file can view its content by itself and its content can be viewed with the Advanced Lua Guide Loader on page 1.4 of JSE
- To install it, place it in the MyLib-folder (don't rename it) and then refresh libraries (doc=>6)


I didn't have much time to debug this time, so it may includes some bugs; so as always: please report bugs and other oddities ;)
Sorry for nonsense.

Projects:



Offline The_King

  • LV5 Advanced (Next: 300)
  • *****
  • Posts: 247
  • Rating: +6/-2
  • Ⓣⓗⓔ Ⓖⓐⓜⓔ ⓍⒹ
    • View Profile
Re: Jens' Script Editor - An on-calc lua editor
« Reply #207 on: October 26, 2014, 04:08:32 pm »
Finally some news Good luck jens :D

Offline Adriweb

  • Editor
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1708
  • Rating: +229/-17
    • View Profile
    • TI-Planet.org
Re: Jens' Script Editor - An on-calc lua editor
« Reply #208 on: October 27, 2014, 01:02:02 pm »
Congrats - reposted on tiplanet and a bit translated in French : https://tiplanet.org/forum/viewtopic.php?p=171634#p171634
My calculator programs
TI-Planet.org co-admin.
TI-Nspire Lua programming : Tutorials  |  API Documentation

Offline LDStudios

  • Coder Of Tomorrow
  • LV6 Super Member (Next: 500)
  • ******
  • Posts: 388
  • Rating: +41/-1
    • View Profile
    • LD Studios
Re: Jens' Script Editor - An on-calc lua editor
« Reply #209 on: October 27, 2014, 05:08:09 pm »
This coming out really good! I like the standard advanced lua guide, but I don't like having to put it in myLib. It's kind of annoying to not have everything in one file in one place. Couldn't you just put it in the document, and if someone didn't want it they could delete the page? (I'm assuming you put it separate just to save  the 17Kb..)