Mini editor help needed


#21

I think tomorrow I should change a different computer to test.Thanks for your answer.


#22

Maybe it’s your theme? Try selecting a different theme.

I think Atom Dark is the default theme, so perhaps your chances are highest there. (Actually I’m not sure if it’s because of the syntax theme or because of the UI theme – maybe change both.)


#23

I just have changed my theme,but it can’t work.

I have change a different computer, and his OS is OS X 10.9.2, use the version of Atom is 0.187.0, also have the same problem.

But if I use the version of Atom is 0.157.0(use my computer or use others),it works OK, as below:

Now I have no idea about it!


#24

I have experienced the same issue as @comeontom with the mini editor in the mobile-preview package, as has at least one other person who opened an issue about it. I’ve tried with the Atom Dark and Atom Light themes. I can confirm that the TextEditorView is, in fact, functional (responding to keyboard input), but there is no cursor and no visible input text.

I am using Atom v0.190.0 on MacOS 10.10.2.


#25

I’m experiencing the same problem with a few different plugins. Vim-mode / search won’t show text and the cdn-js plugin won’t show what i type in the mini editor. I’m having the same problem with my own plugin as well. I disabled all the non-essential plugins except the one I’m working on and still had the same problem.

As a test, i swapped the usage of the atom version of SelectListView with the space-pen-views version and the text does show up, but it’s not controlled as part of Atom in the same way, meaning it stays open forever. I’d need to write additional code to toggle it, but still. Strange!

Atom v0.191.0 on MacOS 10.10.3


#26

Are you sure it isn’t a theme issue?


#27

I set both themes back to defaults, so I don’t think that’s it. I also double checked my own styles and there’s nothing referencing the mini-editor.


#28

I am also having this exact issue, except with the run-command package. atom --version 0.194.0, OSX 10.10.3.

I’ve tried both default themes and it doesn’t seem to work.

The cursor doesn’t seem to be visible and I can not select text.


#29

I got it working again! Previously, it was possible to instantiate a mini editor using the function constructor EditorView, imported via require 'atom'. With the API changes heading towards v1.0, however, it seems that those view classes have been deprecated. Now, the proper way to create a mini editor is to require TextEditorView from atom-space-pen-views, which usually looks like:

{$, TextEditorView, View} = require 'atom-space-pen-views'

Using atom-space-pen-views requires one other change, which is to add the module to your package.json file’s dependencies (run apm install in your package directory to make the module usable). You can see a diff of the exact changes required in this pull request.


#30

I believe the preferred way to create a mini text editor is to simply use its custom element:

miniEditor = document.createElement('atom-text-editor')
miniEditor.setAttribute('mini', true)

And that’s it, you get a TextEditorElement instance, and if you need to access the TextEditor just use miniEditor.getModel().