[#954] parser.rs: enable multiline descriptions#962
Conversation
|
Thanks for opening this pull request! |
bd9876f to
4ce58fd
Compare
|
I'm not sure I understand your question correctly, but I will comment on what I understand about Lines 113 to 114 in 6f1bbcf In manual of fzf:
Does this help? |
|
It did. Thanks!! I hadn't realized that the delimiter could be used for multiple columns within |
3d8cb7b to
57c7c90
Compare
|
It looks good @gabriel-vanzandycke , thanks! Could you link this PR to your issue ? |
|
Caveats of this PR: |
|
Personally, I don't think it's going to be a big issue, it would be a breaking change for sure to people mainly using this feature but it might make sense if we're moving forward to allow converting other cheatsheet types into navi cheatsheets (see #891) and introducing a syntax parser for cheatsheets (see #948). To me, we can take two roads from here regarding the columns, both are breaking changes with the current implementation:
The second option would be viable IF modifying the order of the columns is not something a lot of users do. |
|
Implementing the first option doesn't necessarily need to be done in this PR as it implies a breaking change anyway... |
kit494way
left a comment
There was a problem hiding this comment.
I think the change in the parsing multiline descriptions is compatible, but the change in the display part is a breaking change.
I think it is better to avoid this breaking change.
How about adding an option to display descriptions and snippets on multiple lines.
To add a note about the --with-nth option, it can be used not only for reordering columns but also for selecting which columns to display.
|
Thanks @kit494way for your review !
An option specific for multilines rendering is anyway mutually exclusive with column selection option I believe giving users the ability to select columns another way is the best option in term of code maintenance, but it's a breaking change. |
I agree but it would be best to decide how we're going to change this for users before breaking the current behavior. |
2e0c169 to
643e74a
Compare
|
Can someone assist me for setting up tests ? |
|
I won't be able to help you on that but maybe those references can help: |
Can't run |
|
If needed, I can trigger the tests on GitHub, just let me know. |
| // tag | ||
| else if line.starts_with('%') { | ||
| should_break = self.write_cmd(&item).is_err(); | ||
| item.snippet = String::from(""); |
There was a problem hiding this comment.
Can someone enlighten me on why the item is reset rather than creating a new item object when we move to the next item ? (It makes me wonder each time I'm in this file)
|
Thanks. |
If you successfully installed act, you just need to be in the directory of navi (where act pushIt should trigger both CI/Lints and CI/Tests. |
|
Thanks. I ran |
|
Great @gabriel-vanzandycke ! I am waiting for the approval of @kit494way and @denisidoro on this PR and since it contains breaking changes I don't know if we wait to merge it in a later major release or we upgrade the next release from a minor to a major release. I would like to at least merge it after #955 . EDIT: When I say a major release I mean a release with breaking changes. |
|
Please make displaying multiple lines optional. |
src/finder/mod.rs
Outdated
|
|
||
| if !opts.show_all_columns { | ||
| command.args(["--with-nth", "1,2,3"]); | ||
| command.args(["--read0", "--print0", "--with-nth", "1"]); |
There was a problem hiding this comment.
It is better to rename show_all_columns or introduce another option for --read0 and --print0 because --read0 and --print0 do not control the number of columns to display.
|
I agree with @kit494way. Let's make this opt-in. Otherwise, people may import cheatsheets using this syntax and be surprised by the behavior. I'll approve the PR once this is addressed. |
|
Awesome! (^-^) I'll take a look at it during the day and launch the workflow. |
…g on item.comment
…locks with multiple lines (only fzf supported)
…nal behavior where fzf argument could be used to reorder the columns
2c2b5a8 to
2030a5c
Compare
|
I can't reproduce the failing test, but encounter another error: I don't understand how to get the correct tldr version, it seems I have the latest. |
|
Hmm... Right now, I don't know, I launched the CI again to see the latest result after your commits. |
|
Hi, I have an idea of what could be going wrong with this test and it doesn't seem to affect much of the application so I think I'll merge your PR and tackle this issue down afterwards since I also need to stabilise experimental before merging for the next pre-release. So now, I'm just waiting @kit494way review before merging. (Maybe even @denisidoro if he wishes to.) |
|
Comments are not displayed correctly when a snippet follows a variable. I tested it with this snippet. navi/tests/no_prompt_cheats/cases.cheat Lines 64 to 82 in b01291e |
|
@gabriel-vanzandycke Have you got any time to check on @kit494way feedback? If not, no worries. ^-^ |
|
Hi @gabriel-vanzandycke , Of course, you'll be put as a reviewer when the PR will be put to merge the feature onto the main branch. |
|
Oh, thank you for the follow-up ! Yes, be my guest ! I'm pretty busy on other projects right now but I can definitively review the MR! |
ac8fce1
into
denisidoro:feat/multiline-parsing
|
Congrats on merging your first pull request! |





This PR adds the possibility to split description into multiple lines.
Resolves #954
The following cheat sheet:
Yields the following result:
