minad / corfu

:desert_island: corfu.el - COmpletion in Region FUnction
GNU General Public License v3.0
1.06k stars 42 forks source link

Error in post-command-hook (corfu--post-command): (wrong-type-argument number-or-marker-p nil) #469

Closed aaronjensen closed 5 days ago

aaronjensen commented 5 days ago

I'm seeing an error when I hit tab when I'm at the end of the word return in a JavaScript file.

I haven't narrowed down a reproduction yet, but I did find the line that is causing the error: https://github.com/minad/corfu/blob/cdc3e13ad312f5f12b3f78f842fff0b398eb4473/corfu.el#L686

For some reason, beg is nil

My completation-at-point-functions is set to '(aj-capf-lsp), which is defined as:

(defalias 'aj-capf-lsp (cape-capf-super #'lsp-completion-at-point #'ripgrep-capf))

(It's acutally defined slightly differently, but these two are the ones that are necessary to reproduce it.

ripgrep-capf is mine: https://github.com/aaronjensen/ripgrep-capf and it's certainly possible I'm doing something wrong there (or lsp-completion-at-point is).

Any tips on diagnosing further? Thank you!