Skip to main content
1 of 3

How to know my buffer's visible/focused status

I'm writing an extension that talks with an outside process, so it is kind of no-brainer to lower the amount of 'hey whats up'- requests when my buffer isn't focused.

What is the best way to recognize that:

  1. my buffer is visible and focused
  2. my buffer is visible but not focused
  3. my buffer is neither visible nor focused