Skip to content
DocsContext keys

PluginsEarly

Context keys

What the context passed to a handler says about the app's state, and the values it can take.

From the plugin interface of gr 0.2.16 (API 0.1, 0.2, 0.3). gr plugin api context prints it on your machine.

Handlers of events "with context" get it as their second argument, and $.editor.context() returns the latest. A key in plugin.toml can carry a when clause over these keys, so it applies only while the clause holds.

KeyTypeWhat it says
surfacestringwhat the focused pane showsmaparchitectureagentsagentterminalcodenodechangepluginsettingsslopempty
modestringthe keys' modenormalinsertvisualvisual_linevisual_blockpromptcommand
layerstringthe id of the key layer on, none while no layer is
pane.kindstringwhere the focused pane stands: the centre, or the dock at a sidecentreleftrightbottom
panesnumberhow many panes the tab page shows
file.languagestringthe language of the file a focused code view shows, as its highlighter names it (rust, go, typescript)
file.pathstringthe path, from the workspace's root and slash-separated, of the file a focused code view shows
file.dirtyboolwhether that file has changes not saved
diffboolwhether the focused pane shows a change: a diff or a change's story
viewstringthe plugin view the focused pane shows, by its id (todos.list)
panelstringthe plugin panel that has the focus, by its id: a view shown docked
dock.leftstringthe part the left dock shows, none while it is hidden
dock.rightstringthe part the right dock shows, none while it is hidden
dock.bottomstringthe part the bottom dock shows, none while it is hidden
agent.statestringthe state of the agent the focused pane shows, in Agent.state's wordsstartingrunningworkingwaitingcouldnt_startopen_elsewherearchivedasleepstopped
map.selectionnumberhow many nodes are selected on the map
window.widthnumberthe window's width, in logical pixels
window.heightnumberthe window's height, in logical pixels
chromestringthe person's chrome settingfullminimal
editingstringhow the person's keys behavevimmodeless
language_serverboolwhether a language server serves the focused file (Phase 3; none until then)

These docs describe Graphide 0.2.16, the latest release. Something wrong or missing? Tell us onDiscord or at hello@graphide.com.