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

csv_align and csv_shrink to take ranges ? #51

Open
carywreams opened this issue Jun 4, 2024 · 4 comments
Open

csv_align and csv_shrink to take ranges ? #51

carywreams opened this issue Jun 4, 2024 · 4 comments

Comments

@carywreams
Copy link

Cant the plugin be modified to operate on ranges? I'd like to give it a go unless there's an inherent reason that won't work.

My specific use case is for my tables in markdown files.

e.g.

:.,+10RainbowAlignRange

or

:7,39RainbowShrinkRange

carywreams added a commit to carywreams/rainbow_csv that referenced this issue Jun 4, 2024
@mechatroner
Copy link
Owner

Thank you for your interest in this project!
I don't think there are any fundamental reasons why this wouldn't work, so it would be great if you could implement this. Please send a PR when it is ready.
If it is not that hard could you also make it work for visual line mode selection? But if it seems complicated feel free to ignore, even line range support is fine, maybe I will add it myself at some point. It is just that I don't personally use ranges much so I might have a biased perspective on this.

And I would greatly appreciate it if you could add a unit test for this feature otherwise there is a chance that it could break at some point later - I don't typically do a lot of manual testing after refactorings because it is very time-consuming.

@carywreams
Copy link
Author

First attempt will be to just convert align and shrink to accept a range of lines. I've roughed-in the first parts for align this afternoon. Tomorrow, I take on shrink.

Can you point me to any existing unit tests for the align and shrink functions? maybe I can modify those for this purpose.

Is there any adjacent functionality I should be considering ?

Thanks

@mechatroner
Copy link
Owner

@carywreams Oh no. There are no existing unit tests for align and shrink. I was sure I had them, this is probably because I have such tests for VSCode version of the extension. Ignore my test request please, I will need to start by adding regular align shrink tests. Sorry for the confusion!

@mechatroner
Copy link
Owner

Regarding the adjacent functionality - nothing particular comes to mind, the remaining features should be orthogonal to the alignment because there are no assumptions about how input CSV files are aligned originally i.e. the extension should be robust to any leading/trailing whitespaces

carywreams added a commit to carywreams/rainbow_csv that referenced this issue Jun 5, 2024
…csv_align to use either address or visual range
carywreams added a commit to carywreams/rainbow_csv that referenced this issue Jun 5, 2024
…tance as well as requirements for ranges when using align and shrink functions in those filetypes
carywreams added a commit to carywreams/rainbow_csv that referenced this issue Jun 6, 2024
carywreams added a commit to carywreams/rainbow_csv that referenced this issue Jun 6, 2024
carywreams added a commit to carywreams/rainbow_csv that referenced this issue Jun 6, 2024
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