Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master' into improved-ansi-perfo…
Browse files Browse the repository at this point in the history
…rmance
  • Loading branch information
Enselic committed Dec 8, 2021
2 parents d4e8bb8 + e250da8 commit 4c044f5
Show file tree
Hide file tree
Showing 113 changed files with 13,835 additions and 1,645 deletions.
31 changes: 24 additions & 7 deletions .github/workflows/CICD.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: CICD

env:
MIN_SUPPORTED_RUST_VERSION: "1.45.0"
MIN_SUPPORTED_RUST_VERSION: "1.46.0"
CICD_INTERMEDIATES_DIR: "_cicd-intermediates"

on:
Expand All @@ -14,6 +14,28 @@ on:
- '*'

jobs:
ensure_cargo_fmt:
name: Ensure 'cargo fmt' has been run
runs-on: ubuntu-20.04
steps:
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
default: true
profile: minimal
components: rustfmt
- uses: actions/checkout@v2
- run: cargo fmt -- --check

license_checks:
name: License checks
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
with:
submodules: true # we especially want to perform license checks on submodules
- run: tests/scripts/license-checks.sh

min_version:
name: Minimum supported rust version
runs-on: ubuntu-20.04
Expand All @@ -27,12 +49,7 @@ jobs:
toolchain: ${{ env.MIN_SUPPORTED_RUST_VERSION }}
default: true
profile: minimal # minimal component installation (ie, no documentation)
components: clippy, rustfmt
- name: Ensure `cargo fmt` has been run
uses: actions-rs/cargo@v1
with:
command: fmt
args: -- --check
components: clippy
- name: Run clippy (on minimum supported rust version to prevent warnings we can't fix)
uses: actions-rs/cargo@v1
with:
Expand Down
18 changes: 12 additions & 6 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,6 @@
[submodule "assets/syntaxes/JavaScript (Babel)"]
path = assets/syntaxes/02_Extra/JavaScript (Babel)
url = https://github.com/babel/babel-sublime
[submodule "assets/syntaxes/Dart"]
path = assets/syntaxes/02_Extra/Dart
url = https://github.com/guillermooo/dart-sublime-bundle
[submodule "assets/syntaxes/FSharp"]
path = assets/syntaxes/02_Extra/FSharp
url = https://github.com/hoest/sublimetext-fsharp
Expand Down Expand Up @@ -113,9 +110,6 @@
[submodule "assets/syntaxes/Org mode"]
path = assets/syntaxes/02_Extra/Org mode
url = https://github.com/jezcope/Org.tmbundle.git
[submodule "assets/syntaxes/requirementstxt"]
path = assets/syntaxes/02_Extra/requirementstxt
url = https://github.com/wuub/requirementstxt
[submodule "assets/syntaxes/DotENV"]
path = assets/syntaxes/02_Extra/DotENV
url = https://github.com/zaynali53/DotENV
Expand Down Expand Up @@ -203,6 +197,9 @@
[submodule "assets/syntaxes/02_Extra/Lean"]
path = assets/syntaxes/02_Extra/Lean
url = https://github.com/leanprover/vscode-lean.git
[submodule "assets/syntaxes/02_Extra/LiveScript"]
path = assets/syntaxes/02_Extra/LiveScript
url = https://github.com/paulmillr/LiveScript.tmbundle
[submodule "assets/syntaxes/02_Extra/Zig"]
path = assets/syntaxes/02_Extra/Zig
url = https://github.com/ziglang/sublime-zig-language.git
Expand Down Expand Up @@ -230,3 +227,12 @@
[submodule "assets/syntaxes/02_Extra/Slim"]
path = assets/syntaxes/02_Extra/Slim
url = https://github.com/slim-template/ruby-slim.tmbundle.git
[submodule "assets/syntaxes/02_Extra/Racket"]
path = assets/syntaxes/02_Extra/Racket
url = https://github.com/follesoe/sublime-racket.git
[submodule "assets/syntaxes/02_Extra/MediaWiki"]
path = assets/syntaxes/02_Extra/MediaWiki
url = https://github.com/tosher/Mediawiker.git
[submodule "assets/syntaxes/02_Extra/Dart"]
path = assets/syntaxes/02_Extra/Dart
url = https://github.com/elMuso/Dartlight.git
16 changes: 14 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

## Features

- Support for `x:-delta` (minus) syntax in line ranges (e.g. `20:-10`). See #1901 (@bojan88)
- Support for `--ignored-suffix` argument. See #1892 (@bojan88)
- `$BAT_CONFIG_DIR` is now a recognized environment variable. It has precedence over `$XDG_CONFIG_HOME`, see #1727 (@billrisher)
- Support for `x:+delta` syntax in line ranges (e.g. `20:+10`). See #1810 (@bojan88)

Expand All @@ -10,16 +12,20 @@
- Fix for poor performance when ANSI escape sequences are piped to `bat`, see #1596 (@eth-p)
- Fix for incorrect handling of ANSI escape sequences when using `--wrap=never`, see #1596 (@eth-p)
- Python syntax highlighting no longer suffers from abysmal performance in specific scenarios. See #1688 (@keith-hall)
- First line not shown in diff context. See #1891 (@divagant-martian)
- Do not ignore syntaxes that handle file names with a `*.conf` extension. See #1703 (@cbolgiano)

## Performance

- Load cached assets as fast as integrated assets, see #1753 (@Enselic)
- Greatly reduce startup time in loop-through mode, e.g. when redirecting output. Instead of *50 ms* - *100 ms*, startup takes *5 ms* - *10 ms*. See #1747 (@Enselic)
- Reduce startup time by approximately 80% for 91 out of 168 syntaxes when using `--language`. See #1787 (@Enselic)
- Load themes lazily to make bat start 25% faster when disregarding syntax load time. See #1969 (@Enselic)

## Other

- Add PowerShell completion, see #1826 (@rashil2000)
- Minimum supported Rust version (MSRV) bumped to 1.46
- Include git hash in `bat -V` and `bat --version` output if present. See #1921 (@Enselic)

## Syntaxes

Expand All @@ -29,6 +35,11 @@
- Highlight for `vimrc` and `gvimrc` files, see #1763 (@SuperSandro2000)
- Syslog highlighting improvements, see #1793 (@scop)
- Added support for `slim` syntax, see #1693 (@mfinelli)
- Racket, see #1884 (@jubnzv)
- LiveScript, see #1915 (@Enselic)
- MediaWiki, see #1925 (@sorairolake)
- The `requirements.txt` syntax has been removed due to incompatible license requirements.
- Dart, new highlighter, see #1959 (@Ersikan)

## New themes

Expand All @@ -38,6 +49,8 @@
- Deprecate `HighlightingAssets::syntaxes()` and `HighlightingAssets::syntax_for_file_name()`. Use `HighlightingAssets::get_syntaxes()` and `HighlightingAssets::get_syntax_for_path()` instead. They return a `Result` which is needed for upcoming lazy-loading work to improve startup performance. They also return which `SyntaxSet` the returned `SyntaxReference` belongs to. See #1747, #1755, #1776, #1862 (@Enselic)
- Remove `HighlightingAssets::from_files` and `HighlightingAssets::save_to_cache`. Instead of calling the former and then the latter you now make a single call to `bat::assets::build`. See #1802 (@Enselic)
- Replace the `error::Error(error::ErrorKind, _)` struct and enum with an `error::Error` enum. `Error(ErrorKind::UnknownSyntax, _)` becomes `Error::UnknownSyntax`, etc. Also remove the `error::ResultExt` trait. These changes stem from replacing `error-chain` with `thiserror`. See #1820 (@Enselic)
- Add new `MappingTarget` enum variant `MapExtensionToUnknown`. Refer to its docummentation for more information. Clients are adviced to treat `MapExtensionToUnknown` the same as `MapToUnknown` in exhaustive matches. See #1703 (@cbolgiano)




Expand Down Expand Up @@ -77,7 +90,6 @@
## Bugfixes

- Mouse support and screen clearing broken for `less` versions with minor version number (581.2), see #1629 and #1639 (@aswild)
>>>>>>> origin/master

## Other

Expand Down
60 changes: 28 additions & 32 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

20 changes: 9 additions & 11 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,12 @@ minimal-application = [
"atty",
"clap",
"dirs-next",
"lazy_static",
"paging",
"regex-onig",
"wild",
]
git = ["git2"] # Support indicating git modifications
paging = ["shell-words"] # Support applying a pager on the output
paging = ["shell-words", "grep-cli"] # Support applying a pager on the output
# Add "syntect/plist-load" when https://github.com/trishume/syntect/pull/345 reaches us
build-assets = ["syntect/yaml-load", "syntect/dump-create"]

Expand All @@ -46,10 +45,9 @@ atty = { version = "0.2.14", optional = true }
ansi_term = "^0.12.1"
ansi_colours = "^1.0"
bincode = "1.0"
console = "0.14.1"
console = "0.15.0"
flate2 = "1.0"
lazy_static = { version = "1.4", optional = true }
lazycell = "1.0"
once_cell = "1.8"
thiserror = "1.0"
wild = { version = "2.0", optional = true }
content_inspector = "0.2.4"
Expand All @@ -64,7 +62,7 @@ path_abs = { version = "0.5", default-features = false }
clircle = "0.3"
bugreport = { version = "0.4", optional = true }
dirs-next = { version = "2.0.0", optional = true }
grep-cli = "0.1.6"
grep-cli = { version = "0.1.6", optional = true }

[dependencies.git2]
version = "0.13"
Expand All @@ -77,23 +75,23 @@ default-features = false
features = ["parsing"]

[dependencies.clap]
version = "2.33"
version = "2.34"
optional = true
default-features = false
features = ["suggestions", "color", "wrap_help"]

[dev-dependencies]
assert_cmd = "2.0.0"
assert_cmd = "2.0.2"
serial_test = "0.5.1"
predicates = "2.0.2"
predicates = "2.1.0"
wait-timeout = "0.2.0"
tempfile = "3.2.0"

[target.'cfg(unix)'.dev-dependencies]
nix = "0.22.1"
nix = "0.23.0"

[build-dependencies]
clap = { version = "2.33", optional = true }
clap = { version = "2.34", optional = true }

[profile.release]
lto = true
Expand Down

0 comments on commit 4c044f5

Please sign in to comment.