mirror of https://github.com/sharkdp/bat.git
Compare commits
17 Commits
55bebbb9b3
...
d0bb0ba06e
Author | SHA1 | Date |
---|---|---|
einfachIrgendwer0815 | d0bb0ba06e | |
einfachIrgendwer0815 | 1e52d10752 | |
einfachIrgendwer0815 | e34f073f7b | |
einfachIrgendwer0815 | 9594b0e4aa | |
einfachIrgendwer0815 | 8c1d7b18db | |
dependabot[bot] | b4e3a84e1a | |
dependabot[bot] | f7c39e8353 | |
dependabot[bot] | 37d9f0533c | |
dependabot[bot] | d560f2a515 | |
Stéphane Blondon | bb4d1cbd2e | |
Stéphane Blondon | 23ec433167 | |
Sharun | 9eaed3e3f0 | |
sblondon | d5bd4aa93f | |
Keith Hall | 66b70dd8ed | |
Michael Vorburger | 01731478a6 | |
Rivera Calzadillas | f8c5429a6c | |
Rivera Calzadillas | f71226adbb |
|
@ -26,4 +26,4 @@ guidelines for adding new syntaxes:
|
|||
[Name or description of the syntax/language here]
|
||||
|
||||
**Guideline Criteria:**
|
||||
[packagecontro.io link here]
|
||||
[packagecontrol.io link here]
|
||||
|
|
|
@ -6,6 +6,7 @@
|
|||
- `bat --squeeze-blank`/`bat -s` will now squeeze consecutive empty lines, see #1441 (@eth-p) and #2665 (@einfachIrgendwer0815)
|
||||
- `bat --squeeze-limit` to set the maximum number of empty consecutive when using `--squeeze-blank`, see #1441 (@eth-p) and #2665 (@einfachIrgendwer0815)
|
||||
- `PrettyPrinter::squeeze_empty_lines` to support line squeezing for bat as a library, see #1441 (@eth-p) and #2665 (@einfachIrgendwer0815)
|
||||
- Syntax highlighting for JavaScript files that start with `#!/usr/bin/env bun` #2913 (@sharunkumar)
|
||||
- Add line length soft/hard limits to prevent out-of-memory events, see issue #636 and PR #2902 (@einfachIrgendwer0815)
|
||||
|
||||
## Bugfixes
|
||||
|
@ -34,6 +35,8 @@
|
|||
- Relax syntax mapping rule restrictions to allow brace expansion #2865 (@cyqsimon)
|
||||
- Apply clippy fixes #2864 (@cyqsimon)
|
||||
- Faster startup by offloading glob matcher building to a worker thread #2868 (@cyqsimon)
|
||||
- Display which theme is the default one in basic output (no colors), see #2937 (@sblondon)
|
||||
- Display which theme is the default one in colored output, see #2838 (@sblondon)
|
||||
|
||||
## Syntaxes
|
||||
|
||||
|
|
|
@ -647,9 +647,9 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "indexmap"
|
||||
version = "2.2.2"
|
||||
version = "2.2.6"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "824b2ae422412366ba479e8111fd301f7b5faece8149317bb81925979a53f520"
|
||||
checksum = "168fb715dda47215e360912c096649d23d58bf392ac62f73919e831745e40f26"
|
||||
dependencies = [
|
||||
"equivalent",
|
||||
"hashbrown 0.14.1",
|
||||
|
@ -839,9 +839,9 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "os_str_bytes"
|
||||
version = "6.6.1"
|
||||
version = "7.0.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "e2355d85b9a3786f481747ced0e0ff2ba35213a1f9bd406ed906554d7af805a1"
|
||||
checksum = "7ac44c994af577c799b1b4bd80dc214701e349873ad894d6cdf96f4f7526e0b9"
|
||||
dependencies = [
|
||||
"memchr",
|
||||
]
|
||||
|
@ -1116,18 +1116,18 @@ checksum = "b97ed7a9823b74f99c7742f5336af7be5ecd3eeafcb1507d1fa93347b1d589b0"
|
|||
|
||||
[[package]]
|
||||
name = "serde"
|
||||
version = "1.0.197"
|
||||
version = "1.0.199"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "3fb1c873e1b9b056a4dc4c0c198b24c3ffa059243875552b2bd0933b1aee4ce2"
|
||||
checksum = "0c9f6e76df036c77cd94996771fb40db98187f096dd0b9af39c6c6e452ba966a"
|
||||
dependencies = [
|
||||
"serde_derive",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "serde_derive"
|
||||
version = "1.0.197"
|
||||
version = "1.0.199"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "7eb0b34b42edc17f6b7cac84a52a1c5f0e1bb2227e997ca9011ea3dd34e8610b"
|
||||
checksum = "11bd257a6541e141e42ca6d24ae26f7714887b47e89aa739099104c7e4d3b7fc"
|
||||
dependencies = [
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
|
@ -1156,9 +1156,9 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "serde_with"
|
||||
version = "3.7.0"
|
||||
version = "3.8.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "ee80b0e361bbf88fd2f6e242ccd19cfda072cb0faa6ae694ecee08199938569a"
|
||||
checksum = "0ad483d2ab0149d5a5ebcd9972a3852711e0153d863bf5a5d0391d28883c4a20"
|
||||
dependencies = [
|
||||
"serde",
|
||||
"serde_derive",
|
||||
|
@ -1167,9 +1167,9 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "serde_with_macros"
|
||||
version = "3.7.0"
|
||||
version = "3.8.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "6561dc161a9224638a31d876ccdfefbc1df91d3f3a8342eddb35f055d48c7655"
|
||||
checksum = "65569b702f41443e8bc8bbb1c5779bd0450bbe723b56198980e80ec45780bce2"
|
||||
dependencies = [
|
||||
"darling",
|
||||
"proc-macro2",
|
||||
|
|
|
@ -66,7 +66,7 @@ regex = { version = "1.10.2", optional = true }
|
|||
walkdir = { version = "2.4", optional = true }
|
||||
bytesize = { version = "1.3.0" }
|
||||
encoding_rs = "0.8.33"
|
||||
os_str_bytes = { version = "~6.6", optional = true }
|
||||
os_str_bytes = { version = "~7.0", optional = true }
|
||||
run_script = { version = "^0.10.1", optional = true}
|
||||
|
||||
[dependencies.git2]
|
||||
|
@ -102,13 +102,13 @@ nix = { version = "0.26.4", default-features = false, features = ["term"] }
|
|||
|
||||
[build-dependencies]
|
||||
anyhow = "1.0.78"
|
||||
indexmap = { version = "2.2.2", features = ["serde"] }
|
||||
indexmap = { version = "2.2.6", features = ["serde"] }
|
||||
itertools = "0.12.1"
|
||||
once_cell = "1.18"
|
||||
regex = "1.10.2"
|
||||
serde = "1.0"
|
||||
serde_derive = "1.0"
|
||||
serde_with = { version = "3.7.0", default-features = false, features = ["macros"] }
|
||||
serde_with = { version = "3.8.1", default-features = false, features = ["macros"] }
|
||||
toml = { version = "0.8.9", features = ["preserve_order"] }
|
||||
walkdir = "2.4"
|
||||
|
||||
|
|
|
@ -0,0 +1,14 @@
|
|||
Submodule assets/syntaxes/01_Packages contains modified content
|
||||
diff --git syntaxes/01_Packages/JavaScript/JavaScript.sublime-syntax syntaxes/01_Packages/JavaScript/JavaScript.sublime-syntax
|
||||
index 05a4fed6..78a7bf55 100644
|
||||
--- syntaxes/01_Packages/JavaScript/JavaScript.sublime-syntax
|
||||
+++ syntaxes/01_Packages/JavaScript/JavaScript.sublime-syntax
|
||||
@@ -5,7 +5,7 @@ name: JavaScript
|
||||
file_extensions:
|
||||
- js
|
||||
- htc
|
||||
-first_line_match: ^#!\s*/.*\b(node|js)\b
|
||||
+first_line_match: ^#!\s*/.*\b(node|bun|js)\b
|
||||
scope: source.js
|
||||
variables:
|
||||
bin_digit: '[01_]'
|
|
@ -30,6 +30,7 @@ use directories::PROJECT_DIRS;
|
|||
use globset::GlobMatcher;
|
||||
|
||||
use bat::{
|
||||
assets::HighlightingAssets,
|
||||
config::Config,
|
||||
controller::Controller,
|
||||
error::*,
|
||||
|
@ -199,19 +200,31 @@ pub fn list_themes(cfg: &Config, config_dir: &Path, cache_dir: &Path) -> Result<
|
|||
let stdout = io::stdout();
|
||||
let mut stdout = stdout.lock();
|
||||
|
||||
if config.colored_output {
|
||||
for theme in assets.themes() {
|
||||
let default_theme = HighlightingAssets::default_theme();
|
||||
for theme in assets.themes() {
|
||||
let default_theme_info = if default_theme == theme {
|
||||
" (default)"
|
||||
} else {
|
||||
""
|
||||
};
|
||||
if config.colored_output {
|
||||
writeln!(
|
||||
stdout,
|
||||
"Theme: {}\n",
|
||||
Style::new().bold().paint(theme.to_string())
|
||||
"Theme: {}{}\n",
|
||||
Style::new().bold().paint(theme.to_string()),
|
||||
default_theme_info
|
||||
)?;
|
||||
config.theme = theme.to_string();
|
||||
Controller::new(&config, &assets)
|
||||
.run(vec![theme_preview_file()], None)
|
||||
.ok();
|
||||
writeln!(stdout)?;
|
||||
} else {
|
||||
writeln!(stdout, "{theme}{default_theme_info}")?;
|
||||
}
|
||||
}
|
||||
|
||||
if config.colored_output {
|
||||
writeln!(
|
||||
stdout,
|
||||
"Further themes can be installed to '{}', \
|
||||
|
@ -220,10 +233,6 @@ pub fn list_themes(cfg: &Config, config_dir: &Path, cache_dir: &Path) -> Result<
|
|||
https://github.com/sharkdp/bat#adding-new-themes",
|
||||
config_dir.join("themes").to_string_lossy()
|
||||
)?;
|
||||
} else {
|
||||
for theme in assets.themes() {
|
||||
writeln!(stdout, "{theme}")?;
|
||||
}
|
||||
}
|
||||
|
||||
Ok(())
|
||||
|
@ -272,24 +281,25 @@ fn invoke_bugreport(app: &App, cache_dir: &Path) {
|
|||
.info(OperatingSystem::default())
|
||||
.info(CommandLine::default())
|
||||
.info(EnvironmentVariables::list(&[
|
||||
"SHELL",
|
||||
"PAGER",
|
||||
"LESS",
|
||||
"LANG",
|
||||
"LC_ALL",
|
||||
"BAT_PAGER",
|
||||
"BAT_PAGING",
|
||||
"BAT_CACHE_PATH",
|
||||
"BAT_CONFIG_PATH",
|
||||
"BAT_OPTS",
|
||||
"BAT_PAGER",
|
||||
"BAT_PAGING",
|
||||
"BAT_STYLE",
|
||||
"BAT_TABS",
|
||||
"BAT_THEME",
|
||||
"XDG_CONFIG_HOME",
|
||||
"XDG_CACHE_HOME",
|
||||
"COLORTERM",
|
||||
"NO_COLOR",
|
||||
"LANG",
|
||||
"LC_ALL",
|
||||
"LESS",
|
||||
"MANPAGER",
|
||||
"NO_COLOR",
|
||||
"PAGER",
|
||||
"SHELL",
|
||||
"TERM",
|
||||
"XDG_CACHE_HOME",
|
||||
"XDG_CONFIG_HOME",
|
||||
]))
|
||||
.info(FileContent::new("System Config file", system_config_file()))
|
||||
.info(FileContent::new("Config file", config_file()))
|
||||
|
|
|
@ -272,6 +272,41 @@ fn squeeze_limit_line_numbers() {
|
|||
.stdout(" 1 line 1\n 2 \n 3 \n 4 \n 5 line 5\n 6 \n 7 \n 8 \n 9 \n 10 \n 20 line 20\n 21 line 21\n 22 \n 23 \n 24 line 24\n 25 \n 26 line 26\n 27 \n 28 \n 29 \n 30 line 30\n");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn list_themes_with_colors() {
|
||||
#[cfg(target_os = "macos")]
|
||||
let default_theme_chunk = "Monokai Extended Light\x1B[0m (default)";
|
||||
|
||||
#[cfg(not(target_os = "macos"))]
|
||||
let default_theme_chunk = "Monokai Extended\x1B[0m (default)";
|
||||
|
||||
bat()
|
||||
.arg("--color=always")
|
||||
.arg("--list-themes")
|
||||
.assert()
|
||||
.success()
|
||||
.stdout(predicate::str::contains("DarkNeon").normalize())
|
||||
.stdout(predicate::str::contains(default_theme_chunk).normalize())
|
||||
.stdout(predicate::str::contains("Output the square of a number.").normalize());
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn list_themes_without_colors() {
|
||||
#[cfg(target_os = "macos")]
|
||||
let default_theme_chunk = "Monokai Extended Light (default)";
|
||||
|
||||
#[cfg(not(target_os = "macos"))]
|
||||
let default_theme_chunk = "Monokai Extended (default)";
|
||||
|
||||
bat()
|
||||
.arg("--color=never")
|
||||
.arg("--list-themes")
|
||||
.assert()
|
||||
.success()
|
||||
.stdout(predicate::str::contains("DarkNeon").normalize())
|
||||
.stdout(predicate::str::contains(default_theme_chunk).normalize());
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn soft_line_limit() {
|
||||
bat()
|
||||
|
|
Loading…
Reference in New Issue