Detect .mini editors


#1

Trying to detect editors with .mini on them. Ultimately I am trying to use this to fix:

So when I’m in jump mode, any of these new overlays will have a new input focus so I want jumpy to cancel out to let the user continue as desired.

Can I observe for new .mini editors?

Also, I notice they have attirbues of mini that’d be fine too.

Where are the mini editors in the docs? If you search using the search tool you get 2 insignificant results…

Thanks.


#2

bump

Still haven’t found a clever (maybe obvious) way.


#3

It sounds like you want the jump mode to cancel itself if the editor view loses focus? I think that covers all the scenarios I can think of where this might be desirable:

  1. Switch to a different tab
  2. Switch to a different pane
  3. Open the fuzzy finder
  4. Open the Find panel

Or am I overgeneralizing it?


#4

YES. YES. YES.

I originally tried that I think. Maybe I got some false results. I can’t think of the exact methods but I’ll try that this weekend. Focusing on the focus that is :smile:

Thanks! Great point.


#5

Just to let you know, I made the fix with:

        editorView.onblur = =>
          @clearJumpMode()

Heh. 2 lines. Seems to work like a charm.

Thanks!


#6

Setting the onX methods on elements can be unsafe. If two packages do that, one of them gets overwritten, because both are just setting the same property on the same object. To be safe, you should use addEventListener instead:

editorView.addEventListener 'blur', =>

#7

Oh god, yes. Total fail. I’ll fix that. I just got excited with the whole blur approach.


#8

Haha, excitement’s a bitch :wink: