![]() |
|
New Editor - Printable Version +- Team Spartan Cookies & Milk Forums (https://teamscm.co.uk) +-- Forum: Garry's Mod (https://teamscm.co.uk/forum-4.html) +--- Forum: Starfall (https://teamscm.co.uk/forum-7.html) +--- Thread: New Editor (/thread-260.html) |
New Editor - Person8880 - 12-03-2014 Something I've been working on the past few days. It's now on the server. Light theme: Dark theme: This new editor is using the Ace code editor loading directly from the server. I find Ace is a much better editor than the E2 editor from wiremod (which is what SF is using currently). It also has plenty of themes so you can have it syntax highlight with the colours you want. Another advantage is I have added Starfall specific highlighting for object methods/library functions. You can also share files to a server hosted folder for collaboration/releases. Hopefully this will make developing SF a much better experience and allow people to share code much quicker. Known bugs:
Console commands
Keyboard shortcuts The editor is heavily reliant on keyboard shortcuts. There's no right click menu like the old E2 editor.
For a full list of the editor's shortcuts, see here: https://github.com/ajaxorg/ace/wiki/Default-Keyboard-Shortcuts RE: New Editor - Blackhawk - 14-03-2014 I like the new code editor. It looks much cleaner than the e2 editor, especially the white theme. But the "Click to check for syntax error" button could be a bit smaller so there is more space for code (or you could make the size customizable). Edit: An undo/redo button would be very nice, because the right-click function of the e2 editor is horrible. RE: New Editor - Person8880 - 14-03-2014 (14-03-2014, 04:55 PM)_BL4CKH4WK Wrote: I like the new code editor. It looks much cleaner than the e2 editor, especially the white theme. But the "Click to check for syntax error" button could be a bit smaller so there is more space for code (or you could make the size customizable).Undo/redo is Ctrl + Z for undo and Ctrl + Y for redo, as with basically every text editor. This text editor is very keyboard heavy, there's little in the way of mouse menus/buttons. As for the syntax check button, that was inspired by the old editor. I kind of like how it's a nice big easy to press button to check the code. However, I can make it a bit less tall, or if you have a good suggestion of how else to implement it instead of how it is at the moment, feel free to suggest. Also, file sharing is essentially done. I just need to finish skinning a few parts of the UI (the buttons and list), deal with a few missing keyboard shortcuts and then I can upload it to the server and see how it fares "in the real world". Oh, also, the editor highlights every single (currently implemented) SF library function. I'm going to work on adding the object methods too at some point. RE: New Editor - Blackhawk - 14-03-2014 You are right, a big button is much easier to press and you don't have to change it, i won't cry because of a few millimetre ![]() Ctrl+Z/Y is as good as buttons, I'm just glad that I don't have to use this weird right-click menu. ![]() But what about an "update files" button that the e2 editor has, or does it have an update interval? Anyway good job! I'm looking forward to seeing it on the server.
RE: New Editor - Person8880 - 14-03-2014 (14-03-2014, 10:35 PM)_BL4CKH4WK Wrote: You are right, a big button is much easier to press and you don't have to change it, i won't cry because of a few millimetreYou can right click folders and click "Refresh". Otherwise it will auto-refresh when you save/delete/rename a file. RE: New Editor - Veegi - 15-03-2014 Is it just me or is the yellow line a bit hard to see in the github theme? Oh, and could you add something like the E2Helper, so we don't have to check the wiki for the functions? RE: New Editor - Person8880 - 15-03-2014 (15-03-2014, 11:02 AM)Veegi Wrote: Is it just me or is the yellow line a bit hard to see in the github theme?The yellow line is probably just the JPG compression ruining the image. In game it's very easy to see. As for an E2Helper, that's a very, very difficult thing to do for a dynamically typed language. E2 helper works because E2 is just a bunch of fixed typed functions that output a fixed type back. SF functions can take multiple input types and potentially return multiple outputs. The docs are the only feasible way to store what all the available functions are and do I'm afraid. I think I will add a "docs" button somewhere in the editor so you can get to it while you code. Sort of related to that, I think I have every single library function and entity method now highlighting in the editor, which ought to help too. RE: New Editor - Person8880 - 15-03-2014 Well, the editor is now uploaded onto the server. The next time it starts it'll be there to test. I hope there's no major bugs. In singleplayer at least, it's working flawlessly. I'd call it "beta" for now. RE: New Editor - Cobra - 19-03-2014 Looks nice! Gives me a new reason to pick up starfall again ![]() But it still misses some really important shortcuts for a programming editor in my opinion: - Ctrl + Left Arrow: Moves the caret one word to the left - Ctrl + Right Arrow: Moves the caret one word to the right - Ctrl + Backspace: Deletes the word that is behind the carret position - Ctrl + Delete: Deletes the word that follows the carret These features all work in this forum text editor I am writing this post in. You can try them here (tested in chrome). Other nice to have shortcuts would be: - Ctrl + E + C (not necessarily this exact shortcut): Comments the current line - Ctrl + E + U (not necessarily this exact shortcut): Uncomments the current line RE: New Editor - Person8880 - 19-03-2014 (19-03-2014, 09:00 AM)Cobra Wrote: Looks nice! Gives me a new reason to pick up starfall againIf you look at the link at the very bottom of the original post, you'll find those shortcuts already exist (and many more not listed in the post). Also, commenting I listed too, it's Ctrl + / to toggle commenting of a line or multiple lines. |