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
Copy file name to clipboardExpand all lines: LEARNINGS.md
+8-1Lines changed: 8 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -31,4 +31,11 @@ pitfall, log it here. Check this file before starting any task.
31
31
- 2026-07-02: http/block-index — inter-block separator lines (after last content line of a block, before next `###`) must NOT be associated with any block. `find_request_block_bounds` returns nil for cursor on these lines. Fix: track `last_content_line` per block during scan, set `block.end_line = last_content_line`, exclude trailing empties/comments from block range. See `lua/poste/http/cache.lua:150-165`.
32
32
- 2026-07-02: http/block-index — `detect_script_context` via line_type fails on buffers without `###` blocks because file-level area only classifies lines as `var` or `file`. Completion tests call `detect_script_context` on bare buffers (no `###`). Fix: add pre/post-script detection to file-level area in cache scanner. See `lua/poste/http/cache.lua:101-128`.
33
33
- 2026-07-02: http/build_pending_request — `build_pending_request` used `buf_content:find("\n###", ...)` to find block end, which picks up inter-block comments and wrong content after var injection. Fix: pass `block_end` through callback chain from `execute_request` → `start_curl_job` → `build_pending_request`; replace `\n###` scan with block_line extraction using numeric line bounds. See `lua/poste/http/run.lua:166-242`.
34
-
- 2026-07-04: http/file-include — `< file` expansion in `process_form_data` embeds raw file content into buffer content before Rust parser splits blocks on `###`. File content containing `###` at line start creates false block boundaries, truncating the request body. Fix: move `< file` expansion out of Lua `process_form_data` (now only does magic vars), into Rust `run.rs:resolve_file_includes` after `parse_at_line` so Rust parser never sees file content `###`. See `lua/poste/http/request_vars.lua:37-88` and `crates/poste-cli/src/run.rs:104-106`.
34
+
- 2026-07-04: http/file-include — `< file` expansion in `process_form_data` embeds raw file content into buffer content before Rust parser splits blocks on `###`. File content containing `###` at line start creates false block boundaries, truncating the request body. Fix: move `< file` expansion out of Lua `process_form_data` (now only does magic vars), into Rust `run.rs:resolve_file_includes` after `parse_at_line` so Rust parser never sees file content `###`. See `lua/poste/http/request_vars.lua:37-88` and `crates/poste-cli/src/run.rs:104-106`.
35
+
- 2026-07-04: http/image-preview — Kitty graphics protocol (`\033_Ga=T,f=100,m=0;BASE64\033\\`) doesn't work through Neovim's Lua `io.write()`. ESC (0x1b) bytes are stripped or mangled by Neovim's output pipeline (libvterm's stdout processing), causing raw base64 to appear as literal terminal text. `os.execute('printf ... > /dev/tty')` would bypass the pipeline, but it blocks the UI. `jobstart({stdout = 1})` inherit doesn't exist — Neovim always captures child stdout through a pipe. Fix: use system viewer (`open`/`xdg-open` via `jobstart`) which works everywhere. Kitty inline kept as best-effort commented attempt. See `lua/poste/http/format.lua:156-195`.
36
+
- 2026-07-04: http/image-preview — terminal preview buffers created with fake/test buffers can break if code writes `vim.bo[buf]` directly after `nvim_open_term()`. Fix: use `nvim_set_option_value(..., { buf = buf })` for preview buffer options so the path works with both real buffers and mocked test buffers. See `lua/poste/http/format.lua:208-240`.
37
+
- 2026-07-04: http/image-preview — `nvim_open_term()` is still an internal libvterm terminal, so kitty graphics output renders blank inside Neovim even in Kitty/WezTerm. Fix: render image previews as a small colored-cell buffer using ImageMagick sampling + extmark background highlights instead of trying to pass graphics escape codes through Neovim. See `lua/poste/http/format.lua:184-340`.
38
+
- 2026-07-04: http/image-preview — colored-cell fallback is not a usable image preview. Fix: remove the built-in preview path, prefer `image.nvim` when installed, and otherwise fall back to opening the file externally. See `lua/poste/http/format.lua:232-305` and `lua/poste/http/buffer.lua:267-275`.
39
+
- 2026-07-04: http/binary-upload — `< file.png` inline expanded via `String::from_utf8_lossy` corrupts binary data, and null bytes in `--data-binary <inline>` arg fail with "nul byte found in provided data" (OS rejects NUL in argv). Fix: `Request.body` changed from `String` to `Vec<u8>`, `resolve_file_includes` preserves raw bytes, executor writes body to tempfile and uses `--data-binary @path`. See `crates/poste-cli/src/run.rs:203-239`, `crates/poste-exec/src/executor.rs:117-122`.
40
+
- 2026-07-04: http/image-preview — `image.nvim` can render against the existing response buffer/window; a separate preview popup is unnecessary. Fix: body view now auto-renders inline when `image.nvim` is installed, and `K` only falls back to external open when inline render is unavailable. See `lua/poste/http/format.lua:195-300` and `lua/poste/http/view.lua:94-151`.
41
+
- 2026-07-04: http/image-preview — `image.nvim` inline render follows the current cursor/anchor, so rendering at line 1 overlays metadata text. Fix: reserve real blank lines after the binary metadata block and move the cursor to the first blank line before calling `image.from_file(...):render()`. See `lua/poste/http/format.lua:155-236` and `lua/poste/http/view.lua:159-170`.
0 commit comments