Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Function surround inconsistencies #214

Open
mmaazahmed opened this issue Nov 7, 2024 · 1 comment
Open

Function surround inconsistencies #214

mmaazahmed opened this issue Nov 7, 2024 · 1 comment

Comments

@mmaazahmed
Copy link

mmaazahmed commented Nov 7, 2024

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?

@mmaazahmed
Copy link
Author

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));

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant