Jump to content




edit+ - enhanced editor (non-qwerty-ready)


59 replies to this topic

#1 GopherAtl

  • Members
  • 888 posts

Posted 05 March 2015 - 01:23 AM

Minor v1.1.1: by popular request, a basic auto-indent system has been added to the release build.
Latest: v1.1 Adds advanced menu options, configurable menu hiding, keyboard/cursor-based block selection, and more; removes numerous bugs from 1.0

I've been frustrated with the offerings for enhanced in-game editors in CC for a long time. There have been many that look great, but none of them have been exactly the editor I want, so I've set out to create my own ideal editor!


first off, pictures: (pics are of current v1.1, menus are different in v1.2)
Posted ImagePosted ImagePosted ImagePosted Image

Features:
  • all the features you've come to expect from the built-in editor, with two minor exceptions.1
  • easy and intuitive basic menus, with a toggleable efficient advanced alternative
  • run program from the editor; if it errors, it takes you to the line number where the error was generated.
  • basic or advanced computer support
  • Complex block selection, with keyboard controls on any computer, or by simply dragging the mouse on advanced computers.
  • increase/decrease selected block indentation
  • "--update" shell argument to update to the latest version automatically
  • special handling to prevent menus from interfering with typing alt-gr characters on non-english keyboards, unlike built-in edit
  • works on tablets
  • somewhat intelligent auto-indent features - "enter" after beginning a for, while, or repeat loop, or after an else or elseif clause, will be indented one step; lines with end, elseif, or until will be de-indented, if they have not already been.
Current beta version differences:
Spoiler
Current advanced menu shortcuts:
Spoiler


More features are planned, just wanted to get this first stable release out there.
Planned features:
Spoiler
Installing:
Just type the following into any computer with http enabled:
pastebin run sR9t4iRZ
And it should download the last stable release from github!
To install the current beta release (which may have bugs, but also moar features!), just add "beta", like so...
pastebin run sR9t4iRZ beta

If you find any issues, however minor, please report them in the thread and I'll fix them ASAP, and tell me if they were in the stable or beta version. Suggestions for additional features are encouraged as well, though I make no promise to implement them unless I like them!

Oh, and I'm also open to suggestions for a better name than "edit+", not least because I'm fairly sure best practices discourage the "+" sign in file names.

Thanks already go to those who've reported bugs:
alekso56, Lyqyd, HPWebcamAble, nitrogenfingers, Kaikaku, Timia2109, wieselkatze

1 there's not yet any auto-indenting functionality; this is planned for a future version. Also, there's no print feature. I have no plans to implement one, either, but if a lot of people really want it, I may change relent.

Edited by GopherAtl, 11 March 2015 - 07:27 PM.


#2 HPWebcamAble

  • Members
  • 933 posts
  • LocationWeb Development

Posted 05 March 2015 - 01:51 AM

Looks pretty cool

A slightly better version of LuaIDE I suppose

A few things:
Tab doesn't work!
I know it just inserts 2 spaces, but I use it a TON

And it crashed when trying to cut text
(edit+:186: attempt to index nil)

You need a GoTo line and a Find function

Other than that its awesome

Side note how do you change the cursor color

Edited by HPWebcamAble, 05 March 2015 - 01:58 AM.


#3 nitrogenfingers

    Lua Professor

  • Members
  • 551 posts
  • LocationAustralia

Posted 05 March 2015 - 01:53 AM

I share your sentiments with editors and it's cool to see one with some new features. The multi-line comments do look good :)

Per your request I have bugs to report:
- Attempting to select text dragging down works very well but when I try to select going left or up from my cursor either nothing happens or it reprints the string from the point of the cursor.
- edit+ only works from the root, which may be by design but it'd be nice if it could be kept in a folder
- I'm not quite certain how pasting works. When I copy a multiline with different start and end points, it will paste whole lines, but sometimes miss one or two.
- After pasting when I select again parts of the document change, again not sure what's happening here.

This is really fantastic though, it's natural enough that I find myself shift-clicking and trying to use ctrl-cursor before realizing I can't in CC. It would be good to have some more features like advanced moving/copying/pasting of code, particularly between files and maybe stuff like regex or doc navigation (where is our CC vim?) Will follow for updates. Cheers!

#4 GopherAtl

  • Members
  • 888 posts

Posted 05 March 2015 - 02:07 AM

 HPWebcamAble, on 05 March 2015 - 01:51 AM, said:

A few things:
Tab doesn't work!
I know it just inserts 2 spaces, but I use it a TON
:facepalm: total oversight, I almost never hit tab myself XD will fix shortly.

 HPWebcamAble, on 05 March 2015 - 01:51 AM, said:

And it crashed when trying to cut text
(edit+:186: attempt to index nil)
O_o can you give me more details of what you were doing? I've tested copy and cut as many ways as I can think of, and not gotten a crash on line 186. I'll look at that line and see what path from cut could lead to an error there in the mean time. managed to reproduce. Thank you for reporting!

 HPWebcamAble, on 05 March 2015 - 01:51 AM, said:

You need a GoTo line and a Find function
Agreed on both counts. Find and Replace, too. Gimme a few versions. :)

 HPWebcamAble, on 05 March 2015 - 01:51 AM, said:

Side note how do you change the cursor color
it's the color of whatever your last call to term.setTextColor was. I need to fix it in this, actually, and make it always white, right now it's.. kindof unpredictable what color it will be


@nitrogenfingers

 nitrogenfingers, on 05 March 2015 - 01:53 AM, said:

I share your sentiments with editors and it's cool to see one with some new features. The multi-line comments do look good :)
thanks. :D

 nitrogenfingers, on 05 March 2015 - 01:53 AM, said:


Per your request I have bugs to report:
- Attempting to select text dragging down works very well but when I try to select going left or up from my cursor either nothing happens or it reprints the string from the point of the cursor.
Took me a minute and some comments from Lyqyd on irc to reproduce the drag-selection backwards not drawing properly thing, but it also just straight-up doesn't act on selections made this way correctly even when they draw correctly. Will be addressing this asap.

 nitrogenfingers, on 05 March 2015 - 01:53 AM, said:

- edit+ only works from the root, which may be by design but it'd be nice if it could be kept in a folder
not.. sure what you mean, but will try running it from another folder and perhaps it will become clear. Can't imagine what I've done that would only work from root, though...

 nitrogenfingers, on 05 March 2015 - 01:53 AM, said:

- I'm not quite certain how pasting works. When I copy a multiline with different start and end points, it will paste whole lines, but sometimes miss one or two.
- After pasting when I select again parts of the document change, again not sure what's happening here.
hrm. I suspect these are related, and possibly related to the first issue as well. Will stress-test the copy/paste code, it had seemed to be working but, I realise now, I'd tested it mainly on one file (hilight) and almost entirely on the first page of the file. Clearly there's more work there. When it's working as intended, pasting should work exactly like you would expect, the complete copied/cut text, however many lines, inserted at the cursor position, splitting the current line in the process.

 nitrogenfingers, on 05 March 2015 - 01:53 AM, said:

This is really fantastic though, it's natural enough that I find myself shift-clicking and trying to use ctrl-cursor before realizing I can't in CC. It would be good to have some more features like advanced moving/copying/pasting of code, particularly between files and maybe stuff like regex or doc navigation (where is our CC vim?) Will follow for updates. Cheers!

I really wish I could cleanly implement ctrl+left and ctrl+right to move the cursor a token at a time... also, shift+arrows to block select... I might play with timer-based approaches to these at some point, but unless I can make it feel completely natural and free from jarring quirks, I won't be including them. Having them just plain not work is actually better than having them sortof-work and then suddenly not work because you paused a bit too long still holding shift before hitting an arrow again, y'know?

having multiple open files is something I'm considering, but I'm thinking for the immediate future I'll settle for a Load File command, along with a recent files list so you can switch between a few active-not-open files quickly and conveniently. When that's implemented, naturally the clipboard will not reset when you switch files. Not sure what you mean with "advanced" moving/copying/pasting, possibly because I've stuck with textpad instead of some of these fancy latest-gen code editors that have all sorts of magic installed under the hood, but regexp (well, lua patterns, actually) for find and also for replace are something I definitely have in mind for the future!

anyway, enough responding, going to go work on the issues you guys have reported. Thanks to all!

Edited by GopherAtl, 05 March 2015 - 02:27 AM.


#5 GopherAtl

  • Members
  • 888 posts

Posted 05 March 2015 - 03:18 AM

okie, new post for update. I think all reported issues have been fixed, just pushed a version that has the following fixes/additions
  • multiple issues with copy/paste and block selection fixed, seems to work now in all the cases I could think to try
  • tab key support added
  • fixed issue with finding api when installed outside of root
  • cursor should stay white now instead of changing colors in unpredictable ways

:edit: a feature addition... small but awesome
  • tab and ctrl,tab can be used to increase or decrease the indentation level of a selected block of code.

Edited by GopherAtl, 05 March 2015 - 04:01 AM.


#6 Kaikaku

  • Members
  • 46 posts

Posted 05 March 2015 - 09:15 PM

Oh, this looks really useful and I like the copy and paste! :)

One wish for for users of a qwertz keyboard: The ~ is only availably for me by pressing Alt-Gr, this means I cannot get it in the in game editor :(
I would give you all my ÖÖÜÜÄÄß in exchange for a ~

#7 timia2109

  • Members
  • 71 posts

Posted 05 March 2015 - 09:33 PM

 Kaikaku, on 05 March 2015 - 09:15 PM, said:

Oh, this looks really useful and I like the copy and paste! :)

One wish for for users of a qwertz keyboard: The ~ is only availably for me by pressing Alt-Gr, this means I cannot get it in the in game editor :(
I would give you all my ÖÖÜÜÄÄß in exchange for a ~
Yeah that would be cool if you edit it. Maybe move CTRL to an other button. Also { and } needs AltGr (CTRL+ALT).

Thank you!

#8 s0r00t

  • Members
  • 61 posts

Posted 05 March 2015 - 10:05 PM

New name : Edit++? :P
Not only a reference to NP++, but also to C++

#9 Lyqyd

    Lua Liquidator

  • Moderators
  • 8,465 posts

Posted 05 March 2015 - 10:22 PM

You can likely type those characters the same way you do in the built-in edit program--by opening the menu first and then typing the key combination to produce the character you want.

#10 Lemmmy

  • Members
  • 218 posts

Posted 05 March 2015 - 10:28 PM

A pretty neat editor, I can see myself using it! I can foresee a lot of naming suggestions for edit++, but I think that's a bit unoriginal and, like you said, you want to avoid +'s in the filename. How about something like xEdit, or edit with another prefix that stands for a synonym of 'enhanced'?

#11 GopherAtl

  • Members
  • 888 posts

Posted 05 March 2015 - 10:41 PM

Ninja'd by Lyqyd on the work-around; I'll have to see if I can find something to emulate a non-qwerty keyboard, or see if I can find someone on irc later to help me test. Given that the whole pre-tap ctrl to open menu thing works, I assume the char events do normally come, so I might be able to to special-case those so they can pass through; a config option to change the menu key might be an option as well, assuming there even is a key on these fancy foreign keyboards that isn't used in a combination to type some common character.... don't have time to fiddle with it at the moment, only passing by my computer and wanted to go ahead and acknowledge.

Oh, and I have it on good authority that apparently key_up events are gonna be a thing in the next version of CC. That means it should finally be possible to consistently and properly detect and handle shift+key, ctrl+key, alt+key, and all other permutations thereof, whenever the next version comes out. So there's that to look forward to!

The next version will have some accommodation of this issue, if not tonight then some time tomorrow (GMT-5). Along with completely overhauled menus, which I've started on, that will have two modes, "basic" and "advanced", basic being more conventional grouped popup menus, advanced being more vim-like - not in the sense of using actual vim key mappings, but in the sense of not really having menus at all, so much as expecting you to just know all the shortcuts. Though I plan on making the shortcuts configurable later, so settings compatible with your favorite editor of choice aren't out of the question, though it won't happen in this next version.

@lemonlake xEdit is a fine suggestion, except that there's already an xEdit, a few threads down on the first page, that someone made last fall. I'm vaguely leaning towards "codex," despite the similarity to the very dissimilar xcode.

#12 Wojbie

  • Members
  • 631 posts
  • LocationKinda lost

Posted 05 March 2015 - 10:49 PM

For the name for about Tide - edit Backwards.

#13 GopherAtl

  • Members
  • 888 posts

Posted 05 March 2015 - 10:50 PM

 wojbie, on 05 March 2015 - 10:49 PM, said:

For the name for about Tide - edit Backwards.

Hmm. tide. I like that; it's going on the short list. :D

#14 TheOddByte

    Lazy Coder

  • Members
  • 1,607 posts
  • LocationSweden

Posted 06 March 2015 - 06:19 PM

Just tried it, and I gotta say that I like this a lot! You've really done a good job on this one! :D
I've got some suggestions for you if you are interested
  • Auto-saving - This would be changable in settings, it would be useful for servers that suddenly restarts
  • Settings - This would be needed for the suggestion above, it's pretty self-explainatory :P
  • Backup - If the program would crash for some unexpected reason, the program would save the work you've done, and create a backup of it.


#15 GopherAtl

  • Members
  • 888 posts

Posted 06 March 2015 - 06:38 PM

 TheOddByte, on 06 March 2015 - 06:19 PM, said:

Just tried it, and I gotta say that I like this a lot! You've really done a good job on this one! :D
I've got some suggestions for you if you are interested
  • Auto-saving - This would be changable in settings, it would be useful for servers that suddenly restarts
  • Settings - This would be needed for the suggestion above, it's pretty self-explainatory :P
  • Backup - If the program would crash for some unexpected reason, the program would save the work you've done, and create a backup of it.

Thanks, glad you're liking it. It's only gonna get better from here, especially whenever this version of CC that dan200 has just added key_up and mouse_up events to is released... :drool:

I'm thinking of keeping a temp scratch file updated between manual saves, so that it can recover the files if it crashes or reboots - which seems immensely preferable to me to a naive autosave implementation, since those can cause you to accidentally save stuff you don't want to safe. That should cover your desires for both autosaving and backup, I expect.

Settings, in the dev build I've alrady got them saving and loading (they are saved in /etc if such a dir exists, otherwise, in whatever dir the program is in). I didn't intend to make a config option specifically for the saving, since it's supposed to be pretty unobtrusive the way I plan on implementing it, but it wouldn't be too difficult to add one if there's still demand.

The first practical setting options will be related to the menu - next release will, by default, be showing a menu bar at the bottom, click to expand submenus for file, edit, etc. Will have options under view to switch to advanced mode (no actual menus, just shortcuts) and to enable hiding the menu when not open (so you'll have to hit ctrl to open, as now).

#16 TheOddByte

    Lazy Coder

  • Members
  • 1,607 posts
  • LocationSweden

Posted 06 March 2015 - 06:46 PM

 GopherAtl, on 06 March 2015 - 06:38 PM, said:

...
Well that's a good solution, keeping the files as a temp file sounds like a good solution, but as you said it would be a problem if there was something you didn't want to save. And glad to hear settings are coming.

Now about the key_up and mouse_up events.. Where did you hear that? I just can't wait for them, it's going to be so awesome! :D

Edit: Just looked in general and found your source :P

Edited by TheOddByte, 06 March 2015 - 06:48 PM.


#17 GopherAtl

  • Members
  • 888 posts

Posted 06 March 2015 - 06:49 PM

 TheOddByte, on 06 March 2015 - 06:46 PM, said:

 GopherAtl, on 06 March 2015 - 06:38 PM, said:

...
Well that's a good solution, keeping the files as a temp file sounds like a good solution, but as you said it would be a problem if there was something you didn't want to save. And glad to hear settings are coming.

Now about the key_up and mouse_up events.. Where did you hear that? I just can't wait for them, it's going to be so awesome! :D

Dan200 replied in the mouse_drop suggestion thread yesterday that he was implementing it right then; he later tweeted he was adding mouse_up and key_up events. So, for non-qwerty keyboard users, menus shouldn't interfere with your typing once I've got my hands on those events and updated accordingly, and for everyone, things like shift-tab to de-indent blocks, shift-arrows to select text, etc. will all be possible. Which will let me take edit+ from "a fine option for editing on a server" to "a viable alternative to an external editor full stop"

#18 wieselkatze

  • Members
  • 221 posts
  • LocationGermany

Posted 06 March 2015 - 06:52 PM

Oh, those key_up eventy definitely sound nifty. Yeah, that xEdit thingy was actually mine :D
I gotta say - I have the feeling that since I brought up that idea with multiline editing and marking text many others do also like to implement that in their editors. May just be a feeling, hehe.

I'd have to implement multiline syntax highlighting in my editor as well - I haven't it implemented, because I thought checking all the comments when pasting multiline would take up a fair bit of computing time - e.g. in a 1300 line file. Probably nonsense, but I'd like to keep my programs as efficient as possible. I might already have got an idea on how to improve the rendering with my new GUI API...
Also I gotta clean that code up a bit - that advanced event thing is definitely pushing my motivation on improving the overall user interaction with the program.

#19 TheOddByte

    Lazy Coder

  • Members
  • 1,607 posts
  • LocationSweden

Posted 06 March 2015 - 06:52 PM

 GopherAtl, on 06 March 2015 - 06:49 PM, said:

...
Ahh, thought you looked on twitter first, well I won't go any more offtopic now. I'm just going to sit here and wait for another update.

#20 GopherAtl

  • Members
  • 888 posts

Posted 06 March 2015 - 06:58 PM

 wieselkatze, on 06 March 2015 - 06:52 PM, said:

I'd have to implement multiline syntax highlighting in my editor as well - I haven't it implemented, because I thought checking all the comments when pasting multiline would take up a fair bit of computing time - e.g. in a 1300 line file. Probably nonsense, but I'd like to keep my programs as efficient as possible.

I was prepared for it to be an issue as well, and had plans in place to propagate the syntax changes incrementally, but first I just had it update the whole file and it really doesn't seem to be an issue. I can always go back and add the incremental solution later if it proves necessary, but I've sat with a 1000+ line file with no existing block comments and just put "--[=[" on the first line, commenting the whole file, then deleting the [, uncommenting everything, and back and forth, [, backspace, [, backspace, and it doesn't seem to have any noticeable impact in the current, naive implementation. Your syntax hilighting code may be a different story, I couldn't say, haven't compared them.

Edited by GopherAtl, 06 March 2015 - 06:59 PM.






1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users