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

[Feat]: passing arguments for specific changes #13

Open
AlejandroSuero opened this issue Sep 6, 2024 · 2 comments
Open

[Feat]: passing arguments for specific changes #13

AlejandroSuero opened this issue Sep 6, 2024 · 2 comments

Comments

@AlejandroSuero
Copy link
Contributor

Let's say for example I want to make a screenshot of the :checkhealth or a git diff inside fugitive or there is a filetype that freeze currently doesn't support (at least at full like multilanguages). It will error like this:

Screenshot 2024-09-06 at 00 02 37

Screenshot 2024-09-06 at 11 22 18


As you can see in both, the --language flag is not working because it can't recognise it, but in the first photo I have logged out what comes from the args value on the user command.

vim.api.nvim_create_user_command("Freeze", function(args)
M.start(args, options)
end, {
desc = "convert range to code image representation",
force = false,
range = true,
})

Note

If added the option nargs = "*".

If implemented it it will look like this:

  • checkhealth as txt

checkhealth as txt

  • fugitive as txt:

fugitive as txt

Note

@isabelroses I have an implementation of this alongside with the open command discussed on the other issue.

In case of going forward with either of those, I can create a separate PR for each.

This change can also work for other options in case that for example you want a global theme in the options, but you want to change it for another screenshot like :Freeze theme = catppuccin-mocha instead of rose-pine-moon if defaulted as option.

  • :Freeze language=lua theme=catppuccin-mocha in stylua.toml with rose-pine-moon in config options:

image

@isabelroses
Copy link
Member

If your happy too, I would love to see these 2 PRs, the open option and the args.

AlejandroSuero added a commit to AlejandroSuero/freeze.nvim that referenced this issue Sep 6, 2024
@AlejandroSuero
Copy link
Contributor Author

@isabelroses I made the PR for the complete behaviour in the one above, I included a quick video demo of how it works.

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

2 participants