You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Resolved conflict in event_manager.lua by combining:
- Upstream's normalized_events processing
- Our nil-checking for event.type to prevent errors
All other files merged automatically.
-**Error Handling:** Use `vim.notify` for user-facing errors. Return early on error.
29
-
-**Comments:** Avoid obvious comments that merely restate what the code does. Only add comments when necessary to explain *why* something is done, not *what* is being done. Prefer self-explanatory code.
30
-
-**Functions:** Prefer local functions. Use `M.func` for module exports.
11
+
-**Comments:** Avoid obvious comments that merely restate what the code does. Only add comments when necessary to explain _why_ something is done, not _what_ is being done. Prefer self-explanatory code.
31
12
-**Config:** Centralize in `config.lua`. Use deep merge for user overrides.
32
-
-**Tests:** Place in `tests/minimal/`, `tests/unit/`, or `tests/replay/`. Manual/visual tests in `tests/manual/`.
33
-
34
-
_Agentic coding agents must follow these conventions strictly for consistency and reliability._
35
-
36
-
## File Reference Detection
37
-
38
-
The plugin automatically detects file references in LLM responses and makes them navigable via the reference picker (`<leader>or` or `:Opencode references`).
39
-
40
-
### Supported Formats
41
-
42
-
The reference picker recognizes these file reference patterns:
43
-
44
-
1.**Backtick-wrapped** (recommended by LLMs naturally):
45
-
-`` `path/to/file.lua` ``
46
-
-`` `path/to/file.lua:42` ``
47
-
-`` `path/to/file.lua:42:10` `` (with column)
48
-
-`` `path/to/file.lua:42-50` `` (line range)
49
-
50
-
2.**file:// URIs** (backward compatibility):
51
-
-`file://path/to/file.lua`
52
-
-`file://path/to/file.lua:42`
53
-
-`file://path/to/file.lua:42-50`
54
-
55
-
3.**Plain paths** (natural format):
56
-
-`path/to/file.lua`
57
-
-`path/to/file.lua:42`
58
-
-`./relative/path.lua:42`
59
-
-`/absolute/path.lua:42`
60
-
61
-
All formats support both relative and absolute paths. Files must exist to be recognized (validation prevents false positives).
62
-
63
-
**No system prompt configuration is required** - the parser works with all LLM providers, including those without system prompt support.
13
+
-**Types:** Use Lua annotations (`---@class`, `---@field`, etc.) for public APIs/config.
overrides= {}, -- Optional per-key overrides, see section below
@@ -456,6 +458,19 @@ Available icon keys (see implementation at lua/opencode/ui/icons.lua lines 7-29)
456
458
- status_on, status_off
457
459
- border, bullet
458
460
461
+
### Window Persistence Behavior
462
+
463
+
`ui.persist_state` controls how `toggle` behaves:
464
+
465
+
-`persist_state = true` (default): `toggle()` hides/restores the UI and keeps buffers/session view in memory for fast restore.
466
+
-`persist_state = false`: `toggle()` fully tears down UI buffers and recreates them on next open.
467
+
468
+
Related APIs:
469
+
470
+
-`require('opencode.api').toggle()` follows the `persist_state` behavior above.
471
+
-`require('opencode.api').close()` always fully closes and clears hidden snapshot state.
472
+
-`require('opencode.api').hide()` preserves buffers only when `persist_state = true`; otherwise it behaves like close.
473
+
459
474
### Picker Layout
460
475
461
476
You can customize the layout of the picker used for history, session, references, and timeline
@@ -637,6 +652,7 @@ The plugin provides the following actions that can be triggered via keymaps, com
637
652
-`open_input` (boolean, default: `true`): Whether to open the input window after adding the selection. Set to `false` to add selection silently without changing focus.
0 commit comments