-
-
Notifications
You must be signed in to change notification settings - Fork 143
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add atom.textEditors.add
to TE constructor
#1190
base: master
Are you sure you want to change the base?
Add atom.textEditors.add
to TE constructor
#1190
Conversation
It works as desired. I can get access to all text-editors via All tests failed, but I do not know what is going on 🙁 |
atom.textEditors.add
to TE constructoratom.textEditors.add
to TE constructor
Package tests failed because of a CI issue with the new Ubuntu images on GitHub Actions. Not your fault. I think this isn't something that should happen automatically; it would instantly change the meaning of I'd be open to supporting this use case a bit more officially if other users were clamoring for this, but I think you're the first one. :) If you want better ways to detect when a mini text editor is an active text editor, I'd suggest doing something like document.addEventListener('focusin', () => {
if (document.activeElement.matches(`atom-text-editor[mini]`) {
// do something
}
}); You could also try a |
There was a similar disscousing at discord. You have be a member of thread and said "my instinct is that it's probably fine for getActiveTextEditor() to return whatever text editor has focus, even if it isn't a “full” editor in a pane". I want to notice, that As I mentioned - six of my packages would benefit from this improvement. Other users could also benefit. There are currently not many new packages appearing, which may be why you do not see requests for this topic. Another solution would be to create a separate registry, but this seems unnecessary since |
A command |
So I see this comment in // If you want packages to be able to add functionality to your non-pane text
// editors (such as a search field in a custom user interface element), register
// them for observation via `atom.textEditors.add`. This requires that a package opt into this behavior when adding their That said: you, as a Pulsar user, have the right to ignore the author's intent and write a package that forces all I'll think about this some more and maybe do some experiments to see how the editing experience varies before and after you add an editor to the registry. |
I will provide few example how new API can be utilized:
My goal is introduce an API which allow you to get and to observe all text editors inside Pulsar. It doesn't necessarily have to be the solution I wrote, but I think it's a good thing because finally an experimental feature will have some use. Another way could be to expose your function in the official API with disposable in return, but it will require a bit of additional code to achive |
This method does not solve a task when I need to patch all text editors (inc. mini) after it was created. It's a case of |
|
It's like a |
@asiloisad! I have given you methods to
which should suffice for any strategy you have to force all In addition, Until I better understand the difference in behavior that goes with adding something to In the meantime, you have what you need in order to write a package that puts all |
Problem
Hi, I want make a package that works with mini text-editors of find-and-replace package (and others mini text-editors). The problem is that mini text-editors are not a part of workspace, so atom.workspace.getActiveTextEditor() doesn't work. A package doesn't register it to
atom.textEditors
too. A mini text-editors can be added toatom.textEditors
by hand , but no one use it, built-in packages included. Six of my community packages can be improve by this change.Alternatives
I'm using a little hacky method to do it by now, but It has many cons, e.g. I cannot detect mini text-editor before user send event to it, cannot observe it etc.