Commit Graph

2942 Commits

Author SHA1 Message Date
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.
2022-09-10 17:59:33 +02:00
John Higgins
2af54dbacd
Fixed else statement with cargo fmt 2022-09-09 22:26:53 -07:00
John Higgins
a272d3df16
Added -S flag for truncating long lines 2022-09-09 17:04:09 -07:00
David Peter
6680f65e4b Add new 'unreleased' section, post v0.22 2022-09-06 23:11:06 +02:00
David Peter
1f9519d8b9 Update binary assets 2022-09-06 22:54:20 +02:00
David Peter
3c33b28507 Bump version to v0.22 2022-09-06 22:54:20 +02:00
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>
2022-09-06 19:08:38 +02:00
David Peter
0e03dce130
Merge pull request #1920 from rhysd/issue-1919
Add `bat::PrettyPrinter::clear_highlights`
2022-09-06 09:32:29 +02:00
David Peter
6a0ab0095a Add CHANGELOG entry 2022-09-06 09:32:06 +02:00
oidro
b213949aeb Correct doc comment for list_syntaxes_and_themes example 2022-09-05 21:57:11 +02:00
rhysd
3d7817d662 Clear highlighted_lines when calling PrettyPrinter::print 2022-09-05 21:17:08 +09:00
rhysd
abd69f2deb Add bat::PrettyPrinter::clear_highlights (fixes #1919) 2022-09-05 17:35:32 +09:00
David Peter
113276a62b
Merge pull request #2237 from kidonng/yaml
Map `fish_history` to YAML
2022-09-04 22:46:08 +02:00
Kid
1e1fa7cde5 CHANGELOG 2022-09-04 22:23:09 +02:00
Kid
d6d8b61131 Fix highlight test 2022-09-04 22:22:18 +02:00
Kid
839e62cff8 Map fish_history to YAML 2022-09-04 22:22:18 +02:00
David Peter
ca9843fa83
Merge pull request #2236 from kidonng/patch-1
Add `.mts` and `.cts` to TypeScript file extensions
2022-09-04 22:20:02 +02:00
David Peter
546dcf6a55
Merge pull request #1888 from patrickpichler/feature/668/add-systemwide-config
Add systemwide config file support
2022-09-04 22:11:17 +02:00
Kid
d7b6519422 Add .mts and .cts to TypeScript file extensions
See also:

https://github.com/github/linguist/pull/5905
2022-09-04 22:06:54 +02:00
Martin Nordholts
799bb1639c Try to fix all warnings 2022-09-04 21:30:14 +02:00
Martin Nordholts
bc2dc0796b Move up the entry to the unreleased section in CHANGELOG.md 2022-09-04 21:03:27 +02:00
Martin Nordholts
2dd2994b2f Merge remote-tracking branch 'origin/master' into feature/668/add-systemwide-config 2022-09-04 20:44:23 +02:00
David Peter
48541b8507 Fix clippy suggestions
Leads to a performance improvement for `bat -A`:

    | Command | Mean [ms] | Min [ms] | Max [ms] | Relative |
    |:---|---:|---:|---:|---:|
    | `./bat-master --no-config -A ./bat-master` | 259.8 ± 1.1 | 258.4 | 261.7 | 1.15 ± 0.01 |
    | `./bat-2301 --no-config -A ./bat-master` | 225.6 ± 1.8 | 224.0 | 229.5 | 1.00 |
2022-09-04 14:28:44 +02:00
Jon Eskin
eab1c9eb46 update alternatives.md 2022-09-04 14:28:06 +02:00
Keith Hall
c6775cc41e Syntax: [Log] scope whole line based on log level
to allow color schemes to color entire lines differently based on log level
2022-09-04 14:11:09 +02:00
David Peter
45d6b1af3b Bump MSRV to 1.60
see https://github.com/rust-lang/git2-rs/issues/838
2022-09-04 06:04:35 +02:00
dependabot[bot]
b295850cb3 Bump git2 from 0.14.2 to 0.15.0
Bumps [git2](https://github.com/rust-lang/git2-rs) from 0.14.2 to 0.15.0.
- [Release notes](https://github.com/rust-lang/git2-rs/releases)
- [Commits](https://github.com/rust-lang/git2-rs/compare/0.14.2...git2-curl-0.15.0)

---
updated-dependencies:
- dependency-name: git2
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-09-04 06:04:35 +02:00
Ed Page
08c91a116c refactor: Parse, don't validate 2022-09-03 14:01:56 +02:00
Ed Page
3d398b35c3 refactor: Switch from is_present to actions
Because "diff" is conditionally present, we need to check for it to
avoid some of clap's stricter checks meant to prevent bugs.
2022-09-03 14:01:56 +02:00
Ed Page
6099f2c146 refactor: Move off of value_of 2022-09-03 14:01:56 +02:00
Ed Page
50bb924ee3 refactor: Replace multiple_occurrences 2022-09-03 14:01:56 +02:00
Ed Page
e8e1c1d6c9 refactor: Replace allow_invalid_utf8 with PathBuf 2022-09-03 14:01:56 +02:00
Ed Page
542b3d2317 refactor: Resolve basic clap deprecations 2022-09-03 14:01:56 +02:00
Ed Page
2323804f7e refactor: Port to clap3
Ths does remove the specialization of version's description.  The way
this is done (internally through `mut_arg`) doesn't play well with
subcommands.  Clap tries to force this version of `version` into the
subcommand despite not being needed.  Clap v4 dramatically changes how
version customization works.

clap also does more error checks now to prevent programmer mistake, so
we can't have a conflict with an argument that is conditionally there,
so I swapped the condition.
2022-09-03 14:01:56 +02:00
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.
2022-09-03 12:33:38 +02:00
Martin Nordholts
8b8ff96c32 CHANGELOG: Mention minor LiveScript update 2022-09-03 07:58:22 +02:00
dependabot[bot]
3d35469414
Bump assets/syntaxes/02_Extra/LiveScript from 2575013 to d82aeb7 (#2291)
Bumps [assets/syntaxes/02_Extra/LiveScript](https://github.com/paulmillr/LiveScript.tmbundle) from `2575013` to `d82aeb7`.
- [Release notes](https://github.com/paulmillr/LiveScript.tmbundle/releases)
- [Commits](2575013851...d82aeb737d)

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

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

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-09-03 07:43:07 +02:00
dependabot[bot]
3480b61eae
Bump wild from 2.0.4 to 2.1.0 (#2296)
Bumps [wild](https://gitlab.com/kornelski/wild) from 2.0.4 to 2.1.0.
- [Release notes](https://gitlab.com/kornelski/wild/tags)
- [Commits](https://gitlab.com/kornelski/wild/commits/v2.1.0)

---
updated-dependencies:
- dependency-name: wild
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

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

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-09-02 19:49:35 +02:00
dependabot[bot]
0167ba55dd
Bump thiserror from 1.0.31 to 1.0.33 (#2295)
Bumps [thiserror](https://github.com/dtolnay/thiserror) from 1.0.31 to 1.0.33.
- [Release notes](https://github.com/dtolnay/thiserror/releases)
- [Commits](https://github.com/dtolnay/thiserror/compare/1.0.31...1.0.33)

---
updated-dependencies:
- dependency-name: thiserror
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

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

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-09-02 19:36:49 +02:00
dependabot[bot]
06dcead2d5
Bump serde from 1.0.143 to 1.0.144 (#2297)
Bumps [serde](https://github.com/serde-rs/serde) from 1.0.143 to 1.0.144.
- [Release notes](https://github.com/serde-rs/serde/releases)
- [Commits](https://github.com/serde-rs/serde/compare/v1.0.143...v1.0.144)

---
updated-dependencies:
- dependency-name: serde
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

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

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-09-02 19:36:35 +02:00
dependabot[bot]
cc7df1e92b
Bump once_cell from 1.13.0 to 1.13.1 (#2298)
Bumps [once_cell](https://github.com/matklad/once_cell) from 1.13.0 to 1.13.1.
- [Release notes](https://github.com/matklad/once_cell/releases)
- [Changelog](https://github.com/matklad/once_cell/blob/master/CHANGELOG.md)
- [Commits](https://github.com/matklad/once_cell/compare/v1.13.0...v1.13.1)

---
updated-dependencies:
- dependency-name: once_cell
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

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

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-09-02 19:36:21 +02:00
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.
2022-08-29 18:49:29 +02:00
Z. Grace Moreau
a6297b282c update CHANGELOG 2022-08-27 16:37:34 +02:00
Z. Grace Moreau
33ba136fa3 fix --pager opts display and add some examples 2022-08-27 16:37:34 +02:00
Z. Grace Moreau
f36df73ac1 add a vim modeline
This will cause vim (and other properly-extended editors) to read this
as a fish script file, despite its .fish.in extension.
2022-08-27 16:37:34 +02:00
Z. Grace Moreau
d14e0fe292 improve fish completions 2022-08-27 16:37:34 +02:00
Martin Nordholts
621ab6078f CI: Check MSRV without git feature enabled
git2-rs MSRV policy is to only support latest stable rust (see
https://github.com/rust-lang/git2-rs#rust-version-requirements), so it
does not make sense to run our MSRV tests with git enabled.
2022-08-25 19:27:55 +02:00
Martin Nordholts
020492f7e6 tests/tester: Do not build as tests
mod tester does not contains any tests, so do not build the module as
containing tests. Instead use the mod.rs approach described in
https://doc.rust-lang.org/book/ch11-03-test-organization.html#submodules-in-integration-tests.
2022-08-25 19:27:55 +02:00
Christopher Acosta
9a924b445b
Make --map-syntax and --ignored-suffix work together (#2260)
* Make --map-syntax and --ignored-suffix work together

* Minor refactor
2022-08-16 22:42:15 +02:00
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>
2022-08-14 21:10:05 +02:00