Function surround inconsistencies
Opened this issue · 1 comments
Hello,
I'm experiencing some inconsistencies with the "change/surround with function" commands in Evil mode and need help understanding if they’re bugs or intended behavior.
async function updatePartnerProduct(req: Request, res: Response): Promise<void> {
const error = validationResult(req);
if (!error.isEmpty()) {
// todo
}
}
If my cursor is within the parentheses of validationResult function and I use csff
, it deletes validationResult and prompts me to enter a new function name. working as expected.
However, if my cursor is below the const error line and I use csff
again, it only deletes the "t" in validationResult rather than modifying updatePartnerProduct.
Is this inconsistency a bug or a design choice?
Another issue I encountered:
When my cursor is on an text object , and I call yssf
, it correctly prompts me for a new function name and surrounds the text object with that function.
But when I attempt to surround an argument with a new function by placing the cursor on req within validationResult(req) and calling yssf, it gives me:
newSurroundingFunction(const error = validationResult(req);)
when i expected this:
const error = validationResult(newSurroundingFunction(req));