# `MingaEditor.HoverPopup`
[🔗](https://github.com/jsmestad/minga/blob/main/lib/minga_editor/hover_popup.ex#L1)

State and rendering for LSP hover tooltips.

Parses LSP hover markdown content into styled display list draws and
renders them in a cursor-anchored floating window. Supports scrolling
for long content (j/k when focused) and the LazyVim pattern of
pressing K once to show, K again to focus into the hover for scrolling.

## Lifecycle

1. LSP hover response arrives with markdown content
2. `new/3` creates the popup state with parsed content
3. The render pipeline renders it as an overlay via `render/3`
4. Any keypress (except K/j/k when focused) dismisses the popup

# `t`

```elixir
@type t() :: %MingaEditor.HoverPopup{
  anchor_col: non_neg_integer(),
  anchor_row: non_neg_integer(),
  content_lines: [MingaAgent.Markdown.parsed_line()],
  focused: boolean(),
  scroll_offset: non_neg_integer()
}
```

A hover popup state.

# `focus`

```elixir
@spec focus(t()) :: t()
```

Focus into the hover popup for scrolling.

# `new`

```elixir
@spec new(String.t(), non_neg_integer(), non_neg_integer()) :: t()
```

Creates a new hover popup from LSP hover content.

Parses the markdown content and anchors the popup at the given
cursor position.

# `render`

```elixir
@spec render(t(), {pos_integer(), pos_integer()}, map()) :: [
  MingaEditor.DisplayList.draw()
]
```

Renders the hover popup as a list of display list draws.

Returns an empty list if the content is empty. The draws are
absolute screen coordinates ready for an Overlay.

# `scroll_down`

```elixir
@spec scroll_down(t()) :: t()
```

Scroll content down (later lines visible).

# `scroll_up`

```elixir
@spec scroll_up(t()) :: t()
```

Scroll content up.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
