nengo-gui icon indicating copy to clipboard operation
nengo-gui copied to clipboard

Code editor quality of life

Open drasmuss opened this issue 9 years ago • 10 comments

It'd be nice if the code editor would auto-indent nicely on line breaks e.g.

func(a,
     b)

It'd be nice if the code editor used spaces instead of tabs on indent

It'd be nice if ctrl-s saved the file when the editor has the focus

It'd be nice if the code editor wrapped text to the width of the editor pane

I'm not even sure if these things are under our control or not, just writing down my list of minor desires.

drasmuss avatar Jun 15 '15 21:06 drasmuss

Lots of these are possible: the ace editor is ridiculously extensible. http://ace.c9.io/

tcstewar avatar Jun 15 '15 21:06 tcstewar

It'd be nice if the code editor wrapped text to the width of the editor pane

I would prefer to have this as a setting.

jgosmann avatar Jun 16 '15 02:06 jgosmann

It'd be nice if the code editor wrapped text to the width of the editor pane

I would prefer to have this as a setting.

I agree, I'd rather have this as a setting. Most of the time I'd prefer the text to not be wrapped.

Another things to add would be tab completion

bjkomer avatar Jun 16 '15 02:06 bjkomer

Yeah actually thinking about it more I don't think I'd really want text wrapping, especially if we had nice auto-indenting on line breaks.

drasmuss avatar Jun 16 '15 15:06 drasmuss

Also, ctrl-z undoing the last action while focusing on the editor would be awesome. Then again, I guess the e-macs and vim folks would be frustrated by this? So is the solution just to use your own editor and collapse the system editor? I guess I'm just wondering if putting these features is worth the investment of time and effort.

Seanny123 avatar Jun 17 '15 14:06 Seanny123

I would like to keep an undo shortcut in the editor. I think, on OS X ctrl+z does exactly what you want and cmd+z is mapped to the editor undo (when the editor has the focus).

jgosmann avatar Jun 17 '15 14:06 jgosmann

I would like to keep an undo shortcut in the editor

The ace editor does support doing custom stuff with the undo stack, so it should actually be possible to integrate both the editor actions and the netgraph actions into the same undo system....

tcstewar avatar Jun 17 '15 14:06 tcstewar

I'm not sure whether I want them in the same system ...

jgosmann avatar Jun 17 '15 14:06 jgosmann

I'm not sure whether I want them in the same system ...

I think they should be, because they interact closely. typing in the editor can create an object that you then move via the mouse. If I now hit undo twice, I'd expect the first undo to move the object back, and the second undo to remove the typing (which would remove the object).

tcstewar avatar Jun 17 '15 15:06 tcstewar

I'm not sure whether I want them in the same system ...

I think I agree with you, but I'm slowly swaying more towards the fence. One of the difficulties of linking them is if someone is using their own editor, we will have no way of undoing their typing. (unless we do something weird like overwriting their file, but if they still have it open in their editor, that could cause issues, and probably not what they want happening) On the otherhand, so many weird cases can crop up when they are not linked, although I have a feeling many of them will not happen in common use.

bjkomer avatar Jun 17 '15 15:06 bjkomer