Multiline mini-editor?


#1

I’m using new EditorView mini: true to get user input, because when I use a normal <input>, inherited keybindings block the user from entering text.

The mini-editor view is only one line long, though. Is there an Atom-approved way to get 3-5 lines of input?

I guess can spin up a full editor, but it seems like overkill – I want something very fast and lightweight, like the mini-editor.


#2

Isn’t EditorView in mini mode the same class as EditorView not in mini mode? So how do you know that one is any heavier or lighter than the other?


#3

@leedohm, I guess I don’t know for certain – but opening a new editor pane takes a second for me, and opening a mini-editor is instant. I suppose that maybe that’s due to the size of the contents of the editor, and nothing to do with the view.

Many of the commands that work in a full editor don’t seem to work in a mini-editor, though.

And mini-editors don’t seem to cause callbacks from atom.workspace.eachEditor.

With that evidence, I made the assumption that mini: true amputated much of the class – but given your reply, it sounds like I’m wrong?


#4

I don’t have any access to the internals, I was just curious. As to the commands not working in a mini-editor, you’ll see a lot of things like this in keymaps:

So it would appear to me that the mechanism for mini-editor not having a lot of functionality is less amputation and more just not getting it attached. This may end up amounting to the same thing, but I would suggest giving EditorView a shot before writing it off :smile:


#5

I’ve added keymaps for normal-editor commands, but targeting .editor, and I get no love from them in the mini-editor – so it’s more than just keybindings, but I hear you :smile:


#6

Can anyone share how to get this working with a full editor? I get a new tab opening when I instantiate a new editor, when really all I want is a 5-10 line box in a tool panel.


#7

was the answer ever found for this one?


#8

@celebvidy I was able to make a mini-editor multiline by adjusting its size, then adding both functions and bindings for things like enter and down-arrow – but it’s not a satisfying solution.

I was not able to create a full editor that did not take up a full pane.


#9

This is still not fixed, I would also really like to see a proper multi-line editor.