Vim: yaf
in typescript is not the same as vafy
for arrow functions
#24264
Labels
yaf
in typescript is not the same as vafy
for arrow functions
#24264
Summary
Using
yaf
(ordaf
) inside an arrow function doesn't include the function declaration (const x =
). However,vafy
/vafd
does.Steps to trigger the problem:
yaf
Actual Behavior:
yaf
only yanks from the last set of arguments. Both examples above yield the following when yanked from inside the braces:Expected Behavior:
Similarly to
vaf
, the entire function (including the definition etc) is used. In other words, I'd expect them to yieldand
respectively.
Maybe related,
vaf
also has a problem when called from the name/declaration of the function.Using the same function
f
, typingvaf
with the cursor somewhere inconst f =
yields a selection that only includesconst f = (x: unknown) => {
. I'd expect it to be the entire function, not just the first line.Screenies:
vaf
from the body:vaf
from the declarationZed Version and System Specs
Zed: v0.171.6 (Zed)
OS: macOS 14.6.1
Memory: 16 GiB
Architecture: aarch64
The text was updated successfully, but these errors were encountered: