Commit Graph

351 Commits (master)

Author SHA1 Message Date
cyqsimon cfd622d6e1
Migrate `SyntaxMapping` impl to new system
Most existing builtins are removed but not yet ported, so the test
`user_can_override_builtin_mappings` should fail. It should pass once the old
rules have been ported.
6 months ago
cyqsimon 4815b6155e
Write changelog 6 months ago
Lena 28990bc451
fix: display color when NO_COLOR is an empty string (#2767) 6 months ago
Broono Lu bfa0b5241f
Update Arch Linux package URL in README files (#2779) 6 months ago
cyqsimon 51203ff750
Use GitHub API to get correct PR submitter (#2791) 6 months ago
Oliver Kiddle b43d31b75a Improvements and fixes to zsh completion
* Use correct return status so that approximate completion isn't broken
* Follow zsh conventions on description forms
* Some options can be used multiple times, e.g. -H, -r, --file-name
* Set completion context correctly for the cache subcommand
* Better completion for --map-syntax argument
* Add --nonprintable-notation option
* Correct some of the mutual exclusion lists for options
6 months ago
cyqsimon 491ae70aa9 Write changelog 7 months ago
cyqsimon bcc2de86b4
CI: add changelog check (#2766)
* Added changelog item check

Fetch the base branch and diff correctly

- See: https://github.com/actions/checkout/issues/160

Improve organisation

Add some echo for easier debugging

Fix bad variable syntax

Clarify the double-print in the success case

* Write to changelog

* Don't block dependabot PRs
7 months ago
cyqsimon 1296aea836 Write changelog for #2756
- I always forget to write changelog.
7 months ago
cyqsimon 4b33093f9e
Bump edition to 2021 (#2748) 7 months ago
Martin Nordholts c6cae09f99 CHANGELOG.md: Add new unreleased section 8 months ago
Martin Nordholts fc9546854f Bump version to v0.24.0
We need to bump 0.x.0 because the library API changed in incompatible
ways:

    $ cargo public-api diff
    Resolved `diff` to `diff 0.23.0`
    Removed items from the public API
    =================================
    (none)

    Changed items in the public API
    ===============================
    -pub fn bat::controller::Controller<'b>::run(&self, inputs: alloc::vec::Vec<bat::input::Input<'_>>) -> bat::error::Result<bool>
    +pub fn bat::controller::Controller<'b>::run(&self, inputs: alloc::vec::Vec<bat::input::Input<'_>>, output_buffer: core::option::Option<&mut dyn core::fmt::Write>) -> bat::error::Result<bool>
    -pub fn bat::controller::Controller<'b>::run_with_error_handler(&self, inputs: alloc::vec::Vec<bat::input::Input<'_>>, handle_error: impl core::ops::function::Fn(&bat::error::Error, &mut dyn std::io::Write)) -> bat::error::Result<bool>
    +pub fn bat::controller::Controller<'b>::run_with_error_handler(&self, inputs: alloc::vec::Vec<bat::input::Input<'_>>, output_buffer: core::option::Option<&mut dyn core::fmt::Write>, handle_error: impl core::ops::function::Fn(&bat::error::Error, &mut dyn std::io::Write)) -> bat::error::Result<bool>

    Added items to the public API
    =============================
    [...]
8 months ago
Martin Nordholts 32da58e723 Update CHANGELOG.md for v0.24.0 8 months ago
skoriop 4382be5e7c docs: update `CHANGELOG.md` 8 months ago
Raghav-Bell 8e35a56712 Updated version of `serde_yaml` to 0.9 8 months ago
Linda_pp 9f795dd947
Associate `*.sarif` files with `json` syntax (#2695)
* Associate `*.sarif` files with `json` syntax

* Update changelog for #2695
8 months ago
rhysd d376a4b631 Add support for WGSL 8 months ago
Nicolas AMBRY 5a240f36b9
Case insensitive `--map-syntax` (#2650)
Co-authored-by: Nicolas AMBRY <nicolas.ambry@atos.net>
9 months ago
Anomalocaridid 150c04acb6 update CHANGELOG.md 9 months ago
Anomalocaridid e32ad0b048
Add `$LESSOPEN` and `$LESSCLOSE` support (#2444) 9 months ago
einfachIrgendwer0815 26111950b3 Add environment variable `BAT_PAGING` 9 months ago
Orion Yeung f21d3502e1 Add `*.ron` syntax mapping
Add a mapping to use `Rust` for rusty object notation, identified by `.ron` extension. See [#2427](https://github.com/sharkdp/bat/issues/2427).
9 months ago
mataha 82664e3c82 Bump MSRV to 1.70.0
The intention is to take advantage of `std::io::IsTerminal` that landed
in 1.70.0, both in `bat` and its dependencies (`clap`, `grep-cli`).

This will fix #2570 as well - `grep-cli` 0.1.9 has a patch for that.

Signed-off-by: mataha <mataha@users.noreply.github.com>
9 months ago
John Higgins 7826e506f8
Merge branch 'master' into doc_fix 10 months ago
John Higgins b720af8a06
fix for issue #2095 10 months ago
John Higgins b1fbcc8a6e
fix for issue #2633 10 months ago
einfachIrgendwer0815 8b187e6997
Update CHANGELOG 11 months ago
cyqsimon 8e866babfc
Write changelog 1 year ago
Marcin Puc 3ca8c43a67 Update CHANGELOG.md 1 year ago
David Peter d27aaffead New empty CHANGELOG section 1 year ago
David Peter 58dbbd1cd4 Bump version to 0.23 1 year ago
Collin Styles ad3586f58a Update CHANGELOG.md 1 year ago
Keith Hall b65a02681a Add crontab syntax 1 year ago
einfachIrgendwer0815 8f99a78cf1
Print non-printable characters using caret notation (#2443)
When the new flag is set, non-printable characters are printed using caret notation.
1 year ago
Martin Nordholts ec6e9c29ac
Bump MSRV to 1.62 (#2496)
* Bump MSRV to 1.62

Mainly to be able to derive default enum variants.

* CHANGELOG.md: Update
1 year ago
Keith Hall 52ef1bc0d6 Scope environment variable and commands sections in Manpages 1 year ago
BlackHoleFox 1004018941 Directly read preferences instead of using the defaults CLI 1 year ago
cyqsimon b6b9d3a629
Disable completion of `cache` subcommand (#2399)
* Disable completion of `cache` subcommand

* Fully removed completion code for `cache`

* Add to changelog
2 years ago
Víctor González Prieto 3ffa7edbd5 Bump cmd-help syntax to latest
This update includes an overhaul of scope names to better support the
set of themes included with bat.

You can find a visual diff for every theme in this PR:
https://github.com/victor-gp/cmd-help-sublime-syntax/pull/17

This commit updates the cmd-help syntax test because the scopes (-> colors)
have changed.
2 years ago
Martin Nordholts 906de11975
Update CHANGELOG.md 2 years ago
dependabot[bot] d5b397f66a Bump assets/syntaxes/02_Extra/TOML from `ed38438` to `fd0bf3e` (#2410)
* Bump assets/syntaxes/02_Extra/TOML from `ed38438` to `fd0bf3e`

Bumps [assets/syntaxes/02_Extra/TOML](https://github.com/jasonwilliams/sublime_toml_highlighting) from `ed38438` to `fd0bf3e`.
- [Release notes](https://github.com/jasonwilliams/sublime_toml_highlighting/releases)
- [Commits](ed38438900...fd0bf3e5d6)

---
updated-dependencies:
- dependency-name: assets/syntaxes/02_Extra/TOML
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>

* Update CHANGELOG.md

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Martin Nordholts <enselic@gmail.com>
2 years ago
Miles Liu e39178b101
Fix `bat cache --clear` not clearing the `--target` dir if specified 2 years ago
David Peter 7c847d84b0 Update CHANGELOG 2 years ago
Aaron Kollasch 017e830bf2
Move CHANGELOG.md entry to Features 2 years ago
Aaron Kollasch d084cdc72b
Update CHANGELOG.md
Co-authored-by: David Peter <sharkdp@users.noreply.github.com>
2 years ago
Aaron Kollasch 36ccc6a31e
Allow env vars to override config but not args 2 years ago
David Peter 5652038f01 Update CHANGELOG 2 years ago
David Peter a7b0449967 Update CHANGELOG 2 years ago
David Peter 3668464f3d Update CHANGELOG 2 years ago
David Peter 3c9c960612
Merge pull request #2309 from johnmatthiggins/master
Added -S flag for truncating long lines
2 years ago
wzy f215d07366
Improve Manpage.sublime-syntax, Fix #2353 (#2364)
* Improve Manpage.sublime-syntax, Fix #2353

* Add highlight tests for fzf-0.33.0
2 years ago
John Higgins 20f272168a
Fixed typo in CHANGELOG.md for PR #2309 2 years ago
John Higgins 236a2c5794
Fixed inverted logic on -S and --chop-long-lines 2 years ago
Martin Nordholts 8bd5a88f07 Prepare a new "unreleased" section at the top of CHANGELOG.md 2 years ago
Martin Nordholts e5d9579614 Bump version to v0.22.1 2 years ago
Martin Nordholts 352309b056 Revert "Remove code that tries to handle ANSI escape inputs"
This reverts commit 8174e02279. Turns out
it is needed for a common use case, see
https://github.com/sharkdp/bat/issues/2307.

It is not a clean revert, because I adjust CHANGELOG.md and also add a
comment to the test. I also had to resolve a small `use` conflict.
2 years ago
David Peter 6680f65e4b Add new 'unreleased' section, post v0.22 2 years ago
David Peter 3c33b28507 Bump version to v0.22 2 years ago
dag-h 08386daa3a
Strip BOM from output in interactive mode (#1938)
* Strip BOM from output in interactive mode

* Strip BOM when not loop_through, add regression tests

* Update CHANGELOG.md

* Only strip BOM from beginning of first line

* Fix integration test on macOS that relied on color scheme

* Fix integration test on Windows that relied on detected terminal width

* Fix syntax test that was failing due to a previously wrong (now fixed) highlighting

Co-authored-by: David Peter <mail@david-peter.de>
Co-authored-by: Martin Nordholts <enselic@gmail.com>
2 years ago
David Peter 6a0ab0095a Add CHANGELOG entry 2 years ago
Kid 1e1fa7cde5 CHANGELOG 2 years ago
David Peter ca9843fa83
Merge pull request #2236 from kidonng/patch-1
Add `.mts` and `.cts` to TypeScript file extensions
2 years ago
Kid d7b6519422 Add `.mts` and `.cts` to TypeScript file extensions
See also:

https://github.com/github/linguist/pull/5905
2 years ago
Martin Nordholts bc2dc0796b Move up the entry to the unreleased section in CHANGELOG.md 2 years ago
Martin Nordholts 2dd2994b2f Merge remote-tracking branch 'origin/master' into feature/668/add-systemwide-config 2 years ago
Martin Nordholts 49875d6ce7
Make `bat::PrettyPrinter::syntaxes()` iterate over new `bat::Syntax` struct (#2222)
We can't keep `syntect::parsing::SyntaxReference` as part of the public
API, because that might prevent us from bumping to syntect 6.0.0 without
also bumping bat to v2.0.0, once we reach v1.0.0.

So introduce a new stripped down struct `Syntax` and return that
instead. Let it be fully owned to make the API simple. It is not going
to be in a hot code path anyway.

I have looked at all code of our 27 dependents but I can't find a single
instance of this method being used, so this change should be safe for
v1.0.0.
2 years ago
Martin Nordholts 8b8ff96c32 CHANGELOG: Mention minor LiveScript update 2 years ago
Martin Nordholts 899fdbb347
Remove code that tries to handle ANSI escape inputs (#2189)
Syntax highlighting is broken when input contains ANSI escape characters
anyway, so there is not much point in trying to handle ANSI escapes in
input.
2 years ago
Z. Grace Moreau a6297b282c update CHANGELOG 2 years ago
Christopher Acosta 9a924b445b
Make --map-syntax and --ignored-suffix work together (#2260)
* Make --map-syntax and --ignored-suffix work together

* Minor refactor
2 years ago
dependabot[bot] c14ce4f7ca
Bump assets/syntaxes/02_Extra/Julia from `1e55f32` to `4fde0fd` (#2230)
* Bump assets/syntaxes/02_Extra/Julia from `1e55f32` to `4fde0fd`

Bumps [assets/syntaxes/02_Extra/Julia](https://github.com/JuliaEditorSupport/Julia-sublime) from `1e55f32` to `4fde0fd`.
- [Release notes](https://github.com/JuliaEditorSupport/Julia-sublime/releases)
- [Commits](1e55f3211b...4fde0fdedd)

---
updated-dependencies:
- dependency-name: assets/syntaxes/02_Extra/Julia
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>

* Update CHANGELOG.md

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Martin Nordholts <enselic@gmail.com>
2 years ago
Marie Katrine Ekeberg 9c7ca33929
Make `--no-paging`/`-P` override `--paging=...` if passed as a later arg (#2201)
* Make the no-paging option override earlier paging options

* Update CHANGELOG.md

Co-authored-by: Martin Nordholts <enselic@gmail.com>
2 years ago
dependabot[bot] 3a93798e8b
Bump assets/syntaxes/02_Extra/cmd-help from `1e513f5` to `aa47747` (#2255)
* Bump assets/syntaxes/02_Extra/cmd-help from `1e513f5` to `aa47747`

Bumps [assets/syntaxes/02_Extra/cmd-help](https://github.com/victor-gp/cmd-help-sublime-syntax) from `1e513f5` to `aa47747`.
- [Release notes](https://github.com/victor-gp/cmd-help-sublime-syntax/releases)
- [Commits](1e513f5f19...aa477471c8)

---
updated-dependencies:
- dependency-name: assets/syntaxes/02_Extra/cmd-help
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>

* Update CHANGELOG.md

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Martin Nordholts <enselic@gmail.com>
2 years ago
John Higgins 7b2e0ece55
Prevent fork nightmare with PAGER=batcat (#2235)
* Added rsamuelklatchko's changes

* Added some comments and deleted redundant code

* Ran cargo fmt

* Update src/pager.rs

Co-authored-by: Martin Nordholts <enselic@gmail.com>

* Added bugfix to changelog

* src/pager.rs nitpick: arg0 -> s

I forgot to comment on this name so I figured I'd just push a commit to
take care of it.

Co-authored-by: Martin Nordholts <enselic@gmail.com>
2 years ago
yuvalmo c4d9d7561b Color `fstab` dump and pass fields correctly (#2246)
Was missing the number 2 as a valid option in those fields.
2 years ago
Cre3per ed4997c77c
Add syntax mapping from NSE to Lua (#2214) 2 years ago
Martin Nordholts 3339eee2dc
Make the default macOS theme depend on Dark Mode (#2197)
* Make the default macOS theme depend on Dark Mode

We frequently get complaints from macOS users that bat does not work on
their default macOS terminal background, which is white.

Pay the price of slightly increased startup time to get a better default
on macOS. To avoid the slightly increased startup time, simply specify a
theme explicitly via `--theme`, `BAT_THEME`, or `~/.config/bat`.

Note that if there is an error when we check if Dark Mode is enabled, we
behave the same as on Windows and Linux; assume that the terminal
background is dark. This harmonizes behavior across platforms, and makes
bat behave the same as before, when Dark Mode was always assumed to be
enabled.

* src/assets.rs: Fix typo

* Update CHANGELOG.md
2 years ago
David Peter 892b186ba5 Add CHANGELOG entry 2 years ago
Martin Nordholts 5f139e5ec2 CHANGELOG.md: Remove empty Themes section for v0.21.0 2 years ago
Martin Nordholts 8b50ef87fd Post-release: Prepare an "unreleased" section at the top of CHANGELOG.md
As per `doc/release-checklist.md`.
2 years ago
Martin Nordholts 8d4f8ba1b2 CHANGELOG.md: unreleased -> v0.21.0 2 years ago
Martin Nordholts 5fe9b3e1b3 Make `INI` syntax register as handler of `.inf` files
We need to type `inf` and `INF` as strings in `INI.sublime-syntax`,
otherwise `yaml-rust` interprets them as real numbers ("infinity") and
they do not get registered as file extensions:

    /Users/martin/src/yaml-rust # https://github.com/chyh1990/yaml-rust
    % cargo run --example dump_yaml ~/src/bat/assets/syntaxes/02_Extra/INI.sublime-syntax
    ---
    String("name"):
        String("INI")
    String("file_extensions"):
            String("ini")
            String("INI")
            Real("inf")
            Real("INF")
    ...

Also add a regression test.
2 years ago
Martin Nordholts ea5aaa03a2 CHANGELOG.md: Clean up and tweak 2 years ago
Martin Nordholts 7334ab4542
Bump to syntect 5.0.0 to e.g. start lazy-loading syntaxes (#2181)
* Bump to syntect 5.0.0 to e.g. start lazy-loading themes

Closes #915
Closes #951
Closes #1846
Closes #1854

* Typo fix formated -> formatted

* Update CHANGELOG.md
2 years ago
dependabot[bot] ef3e398b2b
Bump assets/syntaxes/02_Extra/Zig from `87ecbca` to `1a4a384` (#2136)
* Bump assets/syntaxes/02_Extra/Zig from `87ecbca` to `1a4a384`

Bumps [assets/syntaxes/02_Extra/Zig](https://github.com/ziglang/sublime-zig-language) from `87ecbca` to `1a4a384`.
- [Release notes](https://github.com/ziglang/sublime-zig-language/releases)
- [Commits](87ecbcae6f...1a4a38445f)

---
updated-dependencies:
- dependency-name: assets/syntaxes/02_Extra/Zig
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>

* Update tests/syntax-tests/highlighted/Zig/example.zig and CHANGELOG.md

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Martin Nordholts <enselic@gmail.com>
2 years ago
Isaac Horvath adea895026
Add a --style=default option (#2119)
* Add a --style=default option

* Added --style=default test and CHANGELOG entry

* Format CHANGELOG.md options with quotes

Co-authored-by: Martin Nordholts <enselic@gmail.com>

* Update help text for '--style'

* Make --style=default the default option

* Update style descriptions: "basic" -> "recommended"

* Add integration test for --style=default as default

* Update clap long help for --style
2 years ago
Keith Hall b5294f1cb2
Skip syntax highlighting for long lines (#2165)
* Skip highlighting for long lines

* Run cargo fmt, update changelog
2 years ago
Nathan Fisher 5114c0189d
Add support for BusyBox less as pager (#2162)
* Add support for BusyBox less as pager

* Run tests/syntax-tests/update.sh to update tests

* Address reviewer's concerns with pull request
* Revert all changes in `test` directory
* Minimize overall diff size
* Detect busybox from separate helper function
* Pass equivalent options to BusyBox from same code by changing from long to
  short options

* Remove redundant `if` statement from previous commit
Add test for invalid utf-8
Add `parse_less_version_busybox` to test for invalid program
Add commenting around short options
2 years ago
cyqsimon 3ae05333b0
Add mapping for Unix mail spool (#2156) 2 years ago
Víctor González Prieto b0898900ce
Syntax: add cmd-help (#2148)
* Add cmd-help syntax

To highlight command --help messages.

* README.md: mention help message highlighting

* README.md: edit help message highlighting
2 years ago
Martin Nordholts 520081a92c Print info about custom assets in --diagnostics 2 years ago
Martin Nordholts 47e0dc22d2 Lock regex crate at min 1.5.5 for CVE-2022-24713
Cargo.lock already specifies 1.5.5, but we should also do it in
Cargo.toml.
2 years ago
acheronfail 33a984992b Update CHANGELOG.md
Co-authored-by: Martin Nordholts <enselic@gmail.com>
2 years ago
acheronfail b1e67e215c Allow configuring show_nonprintable from PrettyPrinter 2 years ago
Keith Hall c0ec03e08a Syntax: [Log] highlight escape characters in double quoted strings 2 years ago
Patrick Pichler 5ed64444e3 Add systemwide config file support
There is now support for a systemwide config file. The location of the
system wide config file is `$(BAT_SYSTEM_CONFIG_PREFIX)/bat/config`.
`$(BAT_SYSTEM_CONFIG_PREFIX)` has to be provided at compile time as an
environment variable. If the environment variable is not set, a default
is used. This default is `C:\ProgramData` for windows and `/etc` for
every other os.
2 years ago
Martin Nordholts 9ab378b5dc Include contents of custom assets `metadata.yaml` in `--diagnostics` 2 years ago
David Peter 282b70291f Add CHANGELOG entry 2 years ago
TruncatedDinosour cde239e809
Syntax: add clang-format (#2076)
Highlight .clang-format files as YAML

Co-authored-by: Ari Archer <truncateddinosour@gmail.com>
Co-authored-by: David Peter <mail@david-peter.de>
2 years ago
Martin Nordholts 448bfaf748 Prepare a "unreleased" section at the top of `CHANGELOG.md` 2 years ago