Skip to content

Add clp support#1427

Open
jpe90 wants to merge 2 commits intojunegunn:masterfrom
jpe90:master
Open

Add clp support#1427
jpe90 wants to merge 2 commits intojunegunn:masterfrom
jpe90:master

Conversation

@jpe90
Copy link
Copy Markdown

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

Comment thread bin/preview.sh Outdated
Copy link
Copy Markdown
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.

Co-authored-by: Junegunn Choi <junegunn.c@gmail.com>
@jpe90
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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.

2 participants