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

Add clp support #1427

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

Add clp support #1427

wants to merge 2 commits into from

Conversation

jpe90
Copy link

@jpe90 jpe90 commented Sep 21, 2022

This PR adds support for clp as an alternative to bat for file previewing.

In this implementation, clp is always used for file previewing if it's found. It assumes if the program is installed, the user would want to use it for file previewing, since that's its only function.

Alternatively a configuration option could be used to let users opt-in to clp more explicitly. Let me know if you would prefer doing it that way, or taking some other approach.

bin/preview.sh Outdated Show resolved Hide resolved
Copy link
Owner

@junegunn junegunn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can clap show line numbers a la bat --style=numbers? I'd like to provide a consistent experience to the users regardless of the highlighter backend. We could use clp with nl, but then the numbers aren't highlighted.

@jpe90
Copy link
Author

jpe90 commented Sep 22, 2022

@junegunn not currently, but that sounds like a good idea to me. I'll work on it.

@jpe90
Copy link
Author

jpe90 commented Sep 22, 2022

@junegunn I noticed that bat line numbers don't seem to have background highlighting when they're on a highlighted line.

Just to clarify, were you referring to the grey coloring of the number line text?

Screen Shot 2022-09-22 at 2 21 43 PM

@junegunn
Copy link
Owner

Just to clarify, were you referring to the grey coloring of the number line text?

Yes. With clp SOME_FILE | nl, we don't get highlighted line numbers.

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.

None yet

2 participants