mirror of https://github.com/sharkdp/bat.git
Compare commits
6 Commits
b54a0144a3
...
34c9723e52
Author | SHA1 | Date |
---|---|---|
vitalmotif | 34c9723e52 | |
vitalmotif | 2bb880f25d | |
Stéphane Blondon | bb4d1cbd2e | |
Stéphane Blondon | 23ec433167 | |
Sharun | 9eaed3e3f0 | |
sblondon | d5bd4aa93f |
|
@ -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)
|
||||
|
||||
## Bugfixes
|
||||
|
||||
|
@ -33,6 +34,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
|
||||
|
||||
|
|
|
@ -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,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]
|
||||
#[cfg_attr(any(not(feature = "git"), target_os = "windows"), ignore)]
|
||||
fn short_help() {
|
||||
|
@ -2612,7 +2647,7 @@ fn lessopen_validity() {
|
|||
// Syntax highlighting should be the same regardless of
|
||||
// --map-syntax' case or file extension's case
|
||||
#[test]
|
||||
fn highlighting_independant_from_map_syntax_case() {
|
||||
fn highlighting_independent_from_map_syntax_case() {
|
||||
let expected = bat()
|
||||
.arg("-f")
|
||||
.arg("--map-syntax=*.config:JSON")
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
[38;2;117;113;94m//[0m[38;2;117;113;94m limitations under the License.[0m
|
||||
|
||||
[38;2;117;113;94m//[0m[38;2;117;113;94m Implements a fixed-point parameterized pipelined division[0m
|
||||
[38;2;117;113;94m//[0m[38;2;117;113;94m operation. Outputs are expected to be on range [-1,1), techincally[0m
|
||||
[38;2;117;113;94m//[0m[38;2;117;113;94m operation. Outputs are expected to be on range [-1,1), technically[0m
|
||||
[38;2;117;113;94m//[0m[38;2;117;113;94m [-1,2^(BITS-1)-1/2^(BITS-1)]. There is no convergent rounding.[0m
|
||||
[38;2;117;113;94m//[0m
|
||||
[38;2;117;113;94m//[0m[38;2;117;113;94m [TODO] Implement optional convergent rounding and some form of[0m
|
||||
|
|
|
@ -98,7 +98,7 @@ contract ERC721 is Context, ERC165, IERC721, IERC721Metadata {
|
|||
}
|
||||
|
||||
/**
|
||||
* @dev Base URI for computing {tokenURI}. Empty by default, can be overriden
|
||||
* @dev Base URI for computing {tokenURI}. Empty by default, can be overridden
|
||||
* in child contracts.
|
||||
*/
|
||||
function _baseURI() internal view virtual returns (string memory) {
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
// limitations under the License.
|
||||
|
||||
// Implements a fixed-point parameterized pipelined division
|
||||
// operation. Outputs are expected to be on range [-1,1), techincally
|
||||
// operation. Outputs are expected to be on range [-1,1), technically
|
||||
// [-1,2^(BITS-1)-1/2^(BITS-1)]. There is no convergent rounding.
|
||||
//
|
||||
// [TODO] Implement optional convergent rounding and some form of
|
||||
|
|
Loading…
Reference in New Issue