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

[#954] parser.rs: enable multiline descriptions #962

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

gabriel-vanzandycke
Copy link

@gabriel-vanzandycke gabriel-vanzandycke commented Mar 20, 2025

This PR adds the possibility to split description into multiple lines.
#954

The following cheat sheet:

% test
# Single line description
echo "hello world"
# Multilines
# description 1
```
echo -n hello
echo    world
```
# Multilines
# description 2
echo "hello world"
# Single line description
```
echo -n hello
echo    world
```

Yields the following result:
image

Copy link

welcome bot commented Mar 20, 2025

Thanks for opening this pull request!

@gabriel-vanzandycke
Copy link
Author

I'm working on the multi-line code-block and multi-line description. Here is how I would like it to render
image

I'm almost there. The tag, description and snippet column are correctly rendered, but I struggle with the next columns (in terminal.rs). Can someone help me understand the purpose of the DELIMITER and what is expected by fzf?

@kit494way
Copy link
Contributor

I'm not sure I understand your question correctly, but I will comment on what I understand about DELIMITER.
DELIMITER is a field separator that separates tags, descriptions, commands, and other fields.
DELIMITER is passed to fzf's --delimiter option.

navi/src/finder/mod.rs

Lines 113 to 114 in 6f1bbcf

"--delimiter",
deser::terminal::DELIMITER.to_string().as_str(),

In manual of fzf:

-d, --delimiter=STR
Field delimiter regex for --nth, --with-nth, and field index expressions (default: AWK-style)

DELIMITER is used when we change the order of columns by passing --with-nth option to fzf.
For example, without --with-nth:
スクリーンショット 2025-03-21 083608

With --with-nth:
スクリーンショット 2025-03-21 083711

Does this help?

…locks with multiple lines (only fzf supported)
@gabriel-vanzandycke
Copy link
Author

It did. Thanks!! I hadn't realized that the delimiter could be used for multiple columns within fzf. I'm updating this PR description to integrate latest changes.

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

Successfully merging this pull request may close these issues.

2 participants