charm-and-friends / freeze.nvim

A wrapper for charm's freeze cli tool for usage in neovim
MIT License
65 stars 1 forks source link

[Feat]: passing arguments for specific changes #13

Open AlejandroSuero opened 2 months ago

AlejandroSuero commented 2 months ago

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.

https://github.com/charm-and-friends/freeze.nvim/blob/6f0b2526d2240930fa3d0babbe0cd181c5907556/lua/freeze/init.lua#L194-L200

[!note] If added the option nargs = "*".

If implemented it it will look like this:

checkhealth 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.

image

isabelroses commented 2 months ago

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

AlejandroSuero commented 2 months ago

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