Commit 5c5e6c2
authored
fix: support file paths with spaces in block headers (#1504)
The block header pattern used %S+ (non-whitespace characters) to match
file paths, which failed when paths contained spaces. This prevented
code blocks from being parsed and made diff acceptance (<C-y>)
non-functional for files in directories with spaces.
Changes:
- Add new pattern with lazy match (.-) to support paths with spaces
- Keep original pattern as fallback for compatibility
- Pattern now correctly parses headers like:
python path=/path/with spaces/file.py start_line=1 end_line=10
Fixes the issue where blocks count remained 0 even when Treesitter
correctly identified block_header and block_content nodes.
Tested with paths containing spaces and verified that:
- Blocks are now correctly parsed and added to message.section.blocks
- Diff acceptance mappings (accept_diff, show_diff, etc.) now work
- Backward compatibility maintained for paths without spaces1 parent 6933b82 commit 5c5e6c2
1 file changed
Lines changed: 1 addition & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
39 | 39 | | |
40 | 40 | | |
41 | 41 | | |
| 42 | + | |
42 | 43 | | |
43 | 44 | | |
44 | 45 | | |
| |||
0 commit comments