Core Library0.xAPI reference

Choose documentation 1

pr-173

Current version

pr-173
English

Early release libtmux is released, and its APIs may still change between releases. This site's structure and URLs may change too.

MoreLess about this notice

function libtmux-elixir

Selection.where/2

Filters validated data while retaining order and captured graph context.

Source and package
Qualified name
LibTmux.Selection.where/2
Module
LibTmux
Declared in
Selection
Package
libtmux
Source
lib/libtmux/selection.ex
Type parameters
Parameters

Examples

One pane must satisfy both conditions inside some. Window @0 has an active shell and an inactive editor; only @1 has an active editor. See filtering for the complete semantics.

iex> alias LibTmux.{Selection, Snapshot}
iex> rows = %{window: [%{id: "@0"}, %{id: "@1"}], pane: [
...> %{id: "%0", window_id: "@0", active: true, current_command: "bash"},
...> %{id: "%1", window_id: "@0", active: false, current_command: "nvim"},
...> %{id: "%2", window_id: "@1", active: true, current_command: "nvim"}]}
iex> {:ok, snapshot} = Snapshot.new(rows,
...> server_instance: "example", captured_from: 0, captured_until: 0,
...> complete: [:pane], fields: %{pane: [:window_id, :active, :current_command]})
iex> snapshot |> Snapshot.windows()
...> |> Selection.where(panes: [some: [active: true, current_command: "nvim"]])
...> |> Enum.map(& &1.id)
["@1"]

Recorded calls

source calls
No call edges in the Elixir model.

The Elixir reference records declarations, not calls, so this page shows no callers or callees. That is a limit of the extracted data, not a statement that nothing calls LibTmux.Selection.where/2.

Guides

task material

Pages that discuss where/2.

Esc
Search in

Type to search.

Reference previewOpen reference