refactor: remove file token feature

Problem: The file metadata token (file:<path>:<line>) was implemented
but is no longer wanted.

Solution: Remove all traces — parse.lua token parsing, diff.lua
reconciliation, views.lua LineMeta field, buffer.lua virtual text and
PendingFile highlight, complete.lua omnifunc trigger, init.lua
goto_file/add_here functions and -file edit token, plugin keymaps
<Plug>(pending-goto-file) and <Plug>(pending-add-here), config.lua
goto_file keymap field, vimdoc FILE TOKEN section, and
spec/file_spec.lua.
This commit is contained in:
Barrett Ruth 2026-02-26 22:38:35 -05:00
parent 0e0568769d
commit 904be4e910
10 changed files with 6 additions and 597 deletions

View file

@ -30,7 +30,7 @@ concealed tokens and are never visible during editing.
Features: ~
- Oil-style buffer editing: standard Vim motions for all task operations
- Inline metadata syntax: `due:`, `cat:`, `rec:`, and `file:` tokens parsed on `:w`
- Inline metadata syntax: `due:`, `cat:`, and `rec:` tokens parsed on `:w`
- Relative date input: `today`, `tomorrow`, `+Nd`, `+Nw`, `+Nm`, weekday
names, month names, ordinals, and more
- Recurring tasks with automatic next-date spawning on completion
@ -101,7 +101,6 @@ Supported tokens: ~
`due:<name>` Resolve a named date (see |pending-dates| below).
`cat:Name` Move the task to the named category on save.
`rec:<pattern>` Set a recurrence rule (see |pending-recurrence|).
`file:<path>:<n>` Attach a file reference (see |pending-file-token|).
The token name for due dates defaults to `due` and is configurable via
`date_syntax` in |pending-config|. The token name for recurrence defaults to
@ -119,45 +118,12 @@ placed under the `Errands` category header.
Parsing stops at the first token that is not a recognised metadata token.
Repeated tokens of the same type also stop parsing — only one `due:`, one
`cat:`, one `rec:`, and one `file:` per task line are consumed.
`cat:`, and one `rec:` per task line are consumed.
Omnifunc completion is available for `due:`, `cat:`, and `rec:` token types.
In insert mode, type the token prefix and press `<C-x><C-o>` to see
suggestions.
==============================================================================
FILE TOKEN *pending-file-token*
The `file:` inline token attaches a source file reference to a task. The
syntax is: >
file:<relative-path>:<line-number>
<
The path is stored relative to the directory containing the data file. The
token is rendered as virtual text at the end of the task line, showing only
the basename and line number (e.g. `auth.lua:42`) using the |PendingFile|
highlight group.
Example: >
Fix null pointer file:src/auth.lua:42
Update tests file:spec/parse_spec.lua:100
<
`gf` in normal mode in the task buffer follows the file reference, opening
the file and jumping to the specified line. The default key is `gf` and can
be changed via the `goto_file` keymap in |pending-config|. Set it to `false`
to disable.
To attach the current file and cursor position to an existing task, invoke
|<Plug>(pending-add-here)| from any source file. A `vim.ui.select()` picker
lists all active tasks; selecting one records the current file and line.
To clear a file reference with `:Pending edit`: >vim
:Pending edit 5 -file
<
==============================================================================
DATE INPUT *pending-dates*
@ -334,7 +300,6 @@ COMMANDS *pending-commands*
:Pending edit 5 due:tomorrow cat:Work +!
:Pending edit 5 -due -cat -rec
:Pending edit 5 rec:!weekly due:fri
:Pending edit 5 -file
<
Operations: ~
`due:<date>` Set due date (accepts all |pending-dates| vocabulary).
@ -345,7 +310,6 @@ COMMANDS *pending-commands*
`-due` Clear due date.
`-cat` Clear category.
`-rec` Clear recurrence.
`-file` Clear the attached file reference (see |pending-file-token|).
Tab completion is available for IDs, field names, date values, categories,
and recurrence patterns.
@ -388,7 +352,6 @@ Default buffer-local keys: ~
`U` Undo the last `:w` save (`undo`)
`o` Insert a new task line below (`open_line`)
`O` Insert a new task line above (`open_line_above`)
`gf` Open the file attached to the task under the cursor (`goto_file`)
`zc` Fold the current category section (category view only)
`zo` Unfold the current category section (category view only)
@ -490,21 +453,6 @@ All motions support count: `3]]` jumps three headers forward. `]]` and
<Plug>(pending-prev-task)
Jump to the previous task line, skipping headers and blanks.
*<Plug>(pending-goto-file)*
<Plug>(pending-goto-file)
Open the file attached to the task under the cursor. If the cursor is not
on a task line, or the task has no file reference, a warning is shown. If
the referenced file cannot be read, an error is shown.
See |pending-file-token|.
*<Plug>(pending-add-here)*
<Plug>(pending-add-here)
Attach the current file and cursor line to an existing task. Invoke from
any source file (not the pending buffer itself) to open a picker listing
all active tasks. The selected task receives a `file:` reference pointing
to the current buffer's file and the cursor's line number.
See |pending-file-token|.
<Plug>(pending-tab) *<Plug>(pending-tab)*
Open the task buffer in a new tab. See |:PendingTab|.
@ -605,7 +553,6 @@ loads: >lua
prev_header = '[[',
next_task = ']t',
prev_task = '[t',
goto_file = 'gf',
},
sync = {
gcal = {
@ -668,11 +615,6 @@ Fields: ~
See |pending-mappings| for the full list of actions
and their default keys.
{goto_file} (string|false, default: 'gf')
Open the file attached to the task under the
cursor. Set to `false` to disable. See
|pending-file-token|.
{debug} (boolean, default: false)
Enable diagnostic logging. When `true`, textobj
motions, mapping registration, and cursor jumps
@ -1042,12 +984,6 @@ PendingFilter Applied to the `FILTER:` header line shown at the top of
the buffer when a filter is active.
Default: links to `DiagnosticWarn`.
*PendingFile*
PendingFile Applied to the file reference virtual text shown for tasks
that have a `file:` token attached (see |pending-file-token|).
Displays the basename and line number (e.g. `auth.lua:42`).
Default: links to `Directory`.
To override a group in your colorscheme or config: >lua
vim.api.nvim_set_hl(0, 'PendingDue', { fg = '#aaaaaa', italic = true })
<
@ -1059,16 +995,6 @@ Run |:checkhealth| pending to verify your setup: >vim
:checkhealth pending
<
Checks performed: ~
- Config loads without error
- Reports active configuration values (data path, default view, default
category, date format, date syntax)
- Whether the data directory exists (warning if not yet created)
- Whether the data file exists and can be parsed; reports total task count
- Validates recurrence specs on stored tasks
- Discovers sync backends under `lua/pending/sync/` and runs each backend's
`health()` function if it exists (e.g. gcal checks for `curl` and `openssl`)
==============================================================================
STORE RESOLUTION *pending-store-resolution*