Commit Graph

349 Commits

Author SHA1 Message Date
Martin Nordholts a81009607a HighlightingAssets: Make .syntaxes() and syntax_for_file_name() failable
Or rather, introduce new versions of these methods and deprecate the old ones.

This is preparation to enable robust and user-friendly support for lazy-loading.
With lazy-loading, we don't know if the SyntaxSet is valid until after we try to
use it, so wherever we try to use it, we need to return a Result. See discussion
about panics in #1747.
2021-07-29 08:26:18 +02:00
Martin Nordholts ccf4563573 Make loading of cached assets closer in performance to integrated assets
Using BufReader makes sense for large files, but assets are never large enough
to require buffering. It is significantly faster to load the file contents in
one go, so let's do that instead.

Closes #1753
2021-07-27 14:53:59 +02:00
David Peter 6e536ab06d Update CHANGELOG 2021-07-25 13:28:43 +02:00
David Peter 945bba777b Upgrade CHANGELOG with security vulnerability notice 2021-07-13 10:56:51 +02:00
David Peter a4b674902f Bump version to v0.18.2 2021-07-12 23:17:48 +02:00
David Peter 3c59b98dc8 Add CHANGELOG entry for #1687 2021-07-09 06:36:06 +02:00
Ville Skyttä 0e9d612173 Add change log entry for bash completion 2021-06-28 11:58:03 +02:00
Ville Skyttä 90e48e9b61 Spelling fixes 2021-06-13 22:08:56 +02:00
Martin Nordholts f4217eba73
Merge pull request #1669 from sharkdp/dependabot/submodules/assets/syntaxes/02_Extra/DotENV-58201ba
Bump assets/syntaxes/02_Extra/DotENV from `a1c9176` to `58201ba`
2021-06-02 07:48:13 +02:00
Mohamed Abdelnour 14900f6ed8 Update `CHANGELOG.md` for #1668 2021-06-01 22:36:56 +02:00
Martin Nordholts bcca56e3b1 CHANGELOG.md: Apply DotENV syntax also for .env.default and .env.defaults 2021-06-01 18:45:17 +02:00
Mohamed Abdelnour cf7d9ef962 Update `CHANGELOG.md` for #1661 2021-05-27 12:05:07 +02:00
Mohamed Abdelnour 8435cad602 Merge master 2021-05-15 09:41:27 +02:00
Mohamed Abdelnour 6fc9641f6a Update CHANGELOG for #1655 2021-05-15 00:13:42 +02:00
Mohamed Abdelnour ef5154d5b3 Update CHANGELOG for #1654 2021-05-14 22:12:58 +02:00
David Peter 73dab51ad1 Bump version, update dependencies 2021-05-12 22:55:25 +02:00
David Peter 9328007d05 Updated CHANGELOG 2021-05-12 22:46:44 +02:00
David Peter 5db3c93057
Merge branch 'master' into syslog 2021-05-12 11:34:35 +02:00
Keith Hall 3559079de0 Improvements to CSV highlighting 2021-05-11 21:04:02 +02:00
Ethan P aa09a9dc04
Update changelog for #1589 2021-04-06 15:33:34 -07:00
Keith Hall 1537733e6b replace Syslog dependency with a custom syntax 2021-04-04 22:47:01 +03:00
Sean McLoughlin d89fa3ebc2 Add SystemVerilog support 2021-03-15 07:21:15 +01:00
David Peter 52f84b063c Update dependencies, MSRV: 1.45 2021-03-07 15:33:37 +01:00
Aleksey Kladov 35347c2310 Improve readability
Using `Path`s for paths expresses intent more clearly.
2021-03-07 14:59:10 +01:00
David Peter b147443c32 Add new unreleased section 2021-02-28 23:28:59 +01:00
David Peter ca60937c2e Do not ignore non-existent BAT_CONFIG_PATH
Do not ignore `BAT_CONFIG_PATH` if it doesn't exist. Both when
generating a new config file with `--generate-config-file` and
when attempting to read the config.

Also, provide a better error message in case the file can not
be created.

closes #1550
2021-02-28 10:08:24 +01:00
David Peter 2aa3ed9da8 Update CHANGELOG 2021-02-28 10:06:56 +01:00
David Peter 7eabb5e05a Highlight *.pac files as JavaScript
closes #1515
2021-02-16 21:52:52 +01:00
Martin Nordholts 37d0d8984c README.md: Warn about buggy snap packages
As discussed in #1519, the batcat snap package is too problematic for
official endorsement, so withdraw recommendation from README.me (and
remove section from CHANGELOG.md since a release with it has not been
made yet).
2021-02-15 22:39:48 +01:00
Keith Hall 2e8c0a39db Add support for env vars and manpage refs with dots to Manpage syntax 2021-02-15 22:30:42 +01:00
Martin Nordholts c48e779e8a CHANGELOG.md: Add entry for #1413 2021-01-11 21:56:10 +01:00
sharkdp 060b9981b5 Remove deprecated PrettyPrinter methods 2021-01-11 21:36:08 +01:00
Martin Nordholts 02e6ff4183 Merge remote-tracking branch 'origin/master' into fix-1063 2021-01-10 11:56:03 +01:00
sharkdp 7ada963ec2 Add ChangeLog entry 2021-01-09 22:35:50 +01:00
sharkdp 7c227169a4 Add note about breaking change 2021-01-09 20:44:44 +01:00
mark chaitin de6cb75f4b Addressed PR feedback. Upped min version and used matches! macro 2021-01-09 15:21:26 +01:00
mark chaitin 83c9cb7907 fix bug where long lines were truncated in plain mode without wrap=never not being set 2021-01-09 15:21:26 +01:00
Martin Nordholts da10166625 Merge remote-tracking branch 'origin/master' into fix-1063 2021-01-07 12:58:26 +01:00
sharkdp 2b44940f81 Update CHANGELOG 2021-01-06 22:55:12 +01:00
Martin Nordholts 478233f795 Merge remote-tracking branch 'origin/master' into fix-1063 2021-01-04 21:02:51 +01:00
sharkdp 7fbb3a5352 Add Zig entry in ChangeLog, see #1470 2021-01-02 21:37:11 +01:00
sharkdp aa5b941ed5 Add ChangeLog entry 2021-01-02 09:46:58 +01:00
Martin Nordholts bfa5342331 Also replace 'more' from PAGER with 'less'
But first do some quite significant refactorings to keep the code clean
and easy to understand.
2020-12-30 17:59:30 +01:00
Martin Nordholts 22bdc7c20f When PAGER=most, don't print a warning to stderr, silently use less instead 2020-12-30 08:25:39 +01:00
sharkdp 6d0e7650c3 Add .resource extension for Robot Framework 2020-12-29 09:04:34 +01:00
Martin Nordholts 552545fe5f Merge remote-tracking branch 'origin/master' into fix-1063 2020-12-28 22:48:52 +01:00
Martin Nordholts dcfe883f4b Simplify and polish pager.rs and related code 2020-12-28 22:39:34 +01:00
Martin Nordholts f45fa5e187 CHANGELOG.md: Add bugfix entry for #614 2020-12-28 22:32:56 +01:00
Martin Nordholts cc0f8ca813 Merge remote-tracking branch 'origin/master' into fix-1063 2020-12-28 21:57:38 +01:00
sharkdp 73d9a95862 Update CHANGELOG 2020-12-28 09:36:49 +01:00
David Peter 07bd7503c5 Update CHANGELOG.md 2020-12-21 21:52:04 +01:00
John Meow 1b5af89ddd Move changelog entry to unreleased 2020-12-21 21:52:04 +01:00
John Meow 3d07dec8fd Use Briles/gruvbox .tmTheme files instead of peaceant's port 2020-12-21 21:52:04 +01:00
Mitchell Kember 3099f51ba7 Add ansi theme to replace ansi-light and ansi-dark
This combines ansi-light and ansi-dark into a single theme that works
with both light and dark backgrounds. Instead of specifying white/black,
the ansi theme uses the terminal's default foreground/background color
by setting alpha=01, i.e. #00000001. This is in addition to the alpha=00
encoding where red contains an ANSI color palette number.

Now, `--theme ansi-light` and `--theme ansi-dark` will print a
deprecation notice and use ansi instead (unless the user has a custom
theme named ansi-light or ansi-dark, which would take precedence).
2020-12-21 17:05:10 +01:00
sharkdp 19e7763f35 Add changelog entry 2020-12-21 09:42:06 +01:00
David Peter 947133d295 Update CHANGELOG.md 2020-12-21 09:24:56 +01:00
Stefan Kunkel cffacad306 make bat -L use pager 2020-12-21 09:24:56 +01:00
David Peter 73c16574e6
Merge branch 'master' into fix-1438-newline-can-be-added-even-if-style-plain 2020-12-21 08:22:01 +01:00
Martin Nordholts 60e00d49a9
Fix #1443 macOS: regression_test.sh: mktemp: illegal option (#1444)
The macOS version of mktemp does not recognize the --suffix option.
Using pure -d should work since, it seems [1], macOS 10.11 however.

So to make the script work on macOS, stop using the --suffix option.

The downside is of course that the temporary dir will have an anonymous
name, but I see no risk of confusion given how short-lived the usage of
the dir is, and given the context it is used.

[1] https://unix.stackexchange.com/questions/30091/fix-or-alternative-for-mktemp-in-os-x
2020-12-21 08:16:49 +01:00
Martin Nordholts 68d525cd8b Don't add artificial newline to last line if --style=plain
This fixes #1438.

Note however, that using a pager such as less will add a newline itself.
So to actually not print a newline for such files, you need to either
disable paging:

  bat --style=plain --paging=never no-newline-at-end-of-file.txt

or use a "pager" that does not add a newline:

  bat --style=plain --pager=cat no-newline-at-end-of-file.txt

Note that we also update syntax tests file since a bunch of them had
missing newlines on the last lines.
2020-12-19 10:32:50 +01:00
rsteube 84b0702399 only print themes hint in interactive mode 2020-12-17 10:41:07 +01:00
purvesh-linux11 f3489ffa29 add packaging in unreleased section 2020-12-02 08:46:29 +01:00
purvesh-linux11 8e6ba2a3e1 update changelog file 2020-12-02 08:46:29 +01:00
purvesh-linux11 bc01999f0d update chagelog.md 2020-12-02 08:46:29 +01:00
purvesh-linux11 b0fcb3065f add snap installtion command 2020-12-02 08:46:29 +01:00
Martin Nordholts 986d0e9777 Ignore PAGER=most by default with a warning to stderr
closes #1063
2020-11-27 06:47:46 +01:00
sharkdp 6d981498d8 Bump version to 0.17.1 2020-11-24 21:40:11 +01:00
sharkdp 8884104e82 Bump version to v0.17.0 2020-11-23 14:41:32 +01:00
sharkdp 35da065445 Add zsh completion fix to CHANGELOG 2020-11-06 21:25:27 +01:00
Ethan P 61f947a580
Merge pull request #1276 from tommilligan/style-rule
style: add component 'rule' for horizontal file delimiter
2020-10-31 23:14:00 -07:00
sharkdp c4bbf28862 Highlight ebuild/eclass files with shell syntax
Upstream patch: https://github.com/sublimehq/Packages/pull/2541

closes #1292
2020-10-30 22:33:23 +01:00
Adrian Rivera 456216ab37 Update CHANGELOG.md 2020-10-29 20:16:33 +01:00
Adrian Rivera c747ac181d Updates CHANGELOG entry 2020-10-29 19:33:58 +01:00
Kyle Hubert 072fb380d8
Add Svelte as a syntax 2020-10-29 19:33:09 +01:00
sharkdp 95954b7c57 Update CHANGELOG 2020-10-25 19:09:52 +01:00
Armand Philippot a707f81726 Add Coldark in New Themes 2020-10-25 08:18:55 +01:00
Keith Hall 5d9adc14e7 Include details about Manpage syntax improvements in the changelog 2020-10-17 16:46:18 +02:00
Tom Milligan d7da4f5f2b
update changelog 2020-10-12 09:04:56 +01:00
gahag 83ecc3d3ac Update changelog 2020-10-08 18:51:42 +02:00
henil b8535689d3 update CHANGELOG.md 2020-10-04 06:33:11 +02:00
sharkdp a74d35582e Update CHANGELOG for 0.16 2020-10-02 20:45:29 +02:00
sharkdp 8d531b6436 Update CHANGELOG 2020-10-01 21:09:46 +02:00
Ethan P fd52c01e78 Add custom languages/themes sections to manpage 2020-10-01 20:57:18 +02:00
sharkdp 1c24ec16e2 Update CHANGELOG 2020-09-30 19:53:36 +02:00
sharkdp f18009e5d5 Remove 'liquid' dependency 2020-09-20 19:50:39 +02:00
Kienyew 6bc477e88f Update CHANGELOG.md 2020-09-20 12:14:21 +02:00
sharkdp a4ffc9d5ed Update CHANGELOG 2020-09-14 11:30:47 +02:00
Kienyew aa182dad76 Update CHANGELOG.md 2020-09-14 11:28:09 +02:00
Alexander Karlis 6017989c4c removed printlns, updated Changelog, updated man 2020-09-14 11:24:14 +02:00
Niklas Mohrin 57a8122a6b Document PR in CHANGELOG.md 2020-09-14 10:36:22 +02:00
Mitchell Kember f9d5e81f0e Add new theme: base16-256
Bat already has a base16 theme. The new base16-256 theme is for users
of base16-shell, who configure their terminal with a 256-color variant
of a base16 theme. These variants put some of the base16 colors in
elsewhere in the 256-color table to avoid clobbering bright color slots
(ansi codes 8 to 15) with colors that don't respect the ordinary meaning
of that slot (e.g. bright green in ordinary base16 is not green).

For more details, see https://github.com/chriskempson/base16-shell
2020-08-03 11:39:49 +02:00
Dash Peters 0e38c1728e Update changelog 2020-07-09 08:15:04 +02:00
Dash Peters c264f74771 Hide alias in help, update man and completions
A long alias doesn't make sense, since `--paging=never` already exists
2020-07-02 00:07:37 -07:00
David Peter 3a62e3d188
Merge pull request #1066 from gsomix/feature/1061-show-all-redirected
Enable non-printable characters for redirected output
2020-07-02 08:21:50 +02:00
Evgeniy Andreev (gsomix) 3c5ce9f86c Enable non-printable chars for redirected output (#1061) 2020-07-02 09:36:58 +04:00
David Peter 611c6e9c74
Merge branch 'master' into add_gruvbox_theme 2020-07-02 07:02:04 +02:00
Kyle Ondy 541f014d50
add peaceant's port of gruvbox themes
This adds Martin Radimec's [1] port [2] of the gruvbox theme [3].

Brian Reilly (Briles) [4] has a pretty complete collection of gruvbox
ports [5] but they are all in `sublime-color-scheme` which is not yet
supported in bat, see #759 [6].

[1] https://github.com/peaceant
[2] https://github.com/peaceant/gruvbox
[3] https://github.com/morhetz/gruvbox
[4] https://github.com/Briles
[5] https://github.com/Briles/gruvbox
[6] https://github.com/sharkdp/bat/issues/759
2020-06-22 21:25:51 -04:00
Caio Alonso 233d375983 Adds GLSL syntax 2020-06-22 22:19:48 -03:00
sharkdp 5ebf0215c5 Update CHANGELOG 2020-05-29 22:14:20 +02:00
Ethan P 9957da6b93 Remove <font> tag from CHANGELOG.md 2020-05-29 22:13:10 +02:00
Ethan P c03a027240 Move PR changes in README to unreleased section 2020-05-29 22:13:10 +02:00
Ethan P 0319149b4d [breaking] Remove special handling for theme previews 2020-05-29 22:13:10 +02:00
Ethan P 2f823d59b0 Add PrettyPrinter::input function 2020-05-29 22:13:10 +02:00
Ethan P 981352992b Add InputDescription API 2020-05-29 22:13:10 +02:00
Ethan P 8b481dd41f Add support for NO_COLOR env var (#1021) 2020-05-28 21:49:10 +02:00
David Peter 6f88ba0e6f
Update CHANGELOG.md 2020-05-27 12:04:31 +02:00
sharkdp 9e65ecd03e Updates for v0.15.4 2020-05-27 10:14:32 +02:00
sharkdp 69e6cae0a7 Fix CHANGELOG 2020-05-26 08:38:12 +02:00
sharkdp 2e2043971b Update CHANGELOG for 0.15.3 2020-05-26 08:11:41 +02:00
sharkdp 3f6e88b4be Remove dummy line from CHANGELOG 2020-05-25 17:30:19 +02:00
sharkdp 28af18ba27 Bump version to 0.15.2 2020-05-25 17:27:27 +02:00
sharkdp 8f1babf346 Mark 'vcs_modification_markers' as deprecated 2020-05-25 11:51:10 +02:00
sharkdp fa25695b74 Make 'vcs_modification_markers' change non-breaking 2020-05-25 11:51:10 +02:00
sharkdp 943b1f82b6 Fix syntax detection for symlinks
closes #1001
2020-05-24 17:32:43 +02:00
sharkdp b7a09516e7 Update CHANGELOG 2020-05-24 11:30:10 +02:00
sharkdp d6abad908a Update README and CHANGELOG, see #650 2020-05-24 10:01:53 +02:00
sharkdp 7e84477408 Add CHANGELOG entry 2020-05-19 06:40:24 +02:00
sharkdp 3094ac90b7 Update CHANGELOG entry 2020-05-16 13:44:26 +02:00
Ethan P 35b6067496 Print error message when invalid syntax is specified 2020-05-16 13:44:26 +02:00
Ethan P f03ab11623
Update CHANGELOG.md 2020-05-15 14:03:04 -07:00
Ethan P 403ab6e443
Update CHANGELOG.md 2020-05-15 13:23:24 -07:00
sharkdp ee287447c5 Update CHANGELOG 2020-05-13 08:21:58 +02:00
Prat T 491a5a17f3 Update CHANGELOG 2020-05-12 16:37:29 +02:00
sharkdp 48441b99ef Patch Markdown syntax
closes #963
see #977
2020-05-11 20:22:50 +02:00
sharkdp ce4717144a Update CHANGELOG 2020-05-11 19:33:13 +02:00
pylipp 74ec390770 Add QML syntax
QML.sublime-syntax file generated from Support/QML.tmLanguage using
Sublime's built-in converter.
Fix sharkdp/bat#962
2020-04-30 09:59:14 +02:00
Mario Zaizar 9014ffcfd8 Adds Email (https://github.com/mariozaizar/email.sublime-syntax) 2020-04-29 19:38:39 +02:00
sharkdp 296bad8ffd Update CHANGELOG 2020-04-27 22:01:41 +02:00
sharkdp 38c096bf79 Update CHANGELOG 2020-04-25 15:19:42 +02:00
sharkdp 696d1b3ed3 Update CHANGELOG 2020-04-25 13:17:07 +02:00
sharkdp 989109145a Add '-d' for '--diff' 2020-04-24 16:12:38 +02:00
sharkdp 82e7786e74 Implementation of 'bat --diff'
This adds a new `--diff` option that can be used to only show lines
close to Git changes (added/removed/modified lines). The amount of
additional context can be controlled with `--diff-context=N`.

closes #23
2020-04-24 09:57:57 +02:00
sharkdp c8abe3f235 Update CHANGELOG 2020-04-22 23:56:20 +02:00
sharkdp 7a87315b94 Fix #937 2020-04-22 23:55:28 +02:00
sharkdp 371c929ede Update CHANGELOG 2020-04-21 18:21:12 +02:00
sharkdp 72618db179 Add metadata information to cached assets
When saving/reading user-provided syntaxes or themes, `bat` will now maintain a
`metadata.yaml` file which includes information about the `bat` version which was
used to create the cached files. When loading cached files, we now print an error
if they have been created with an incompatible version

closes #882
2020-04-21 18:14:31 +02:00
sharkdp 95a56a2795 Typo in CHANGELOG 2020-04-21 17:49:36 +02:00
sharkdp ce583eb9bf Revert "Pass '--mouse' to less versions >= 551"
This reverts commit cb21b74ecd.
2020-04-21 17:29:01 +02:00
sharkdp 47abb192bc Patch Rust syntax file
closes #924
2020-04-21 13:45:26 +02:00
sharkdp a927815292 Update CHANGELOG 2020-04-21 11:50:26 +02:00
sharkdp c386cb35fb Pass '--mouse' to less versions >= 551
When using `less` version 551 or newer, `bat` will now pass the `--mouse` argument, allowing
for (better) mouse scrolling support in some terminals.

closes #904
2020-04-21 10:00:32 +02:00
sharkdp 97ea3dd4dc Update CHANGELOG 2020-04-21 08:58:38 +02:00
sharkdp 0ecc94956b Add performance patch for Makefile syntax
Thanks to @keith-hall!

closes #750
2020-04-13 10:38:22 +02:00
David Peter 61e47e0c13
Add Stylus syntax (#917)
closes #915
2020-04-12 19:42:36 +02:00
sharkdp 8b3d54ce29 Update CHANGELOG 2020-04-11 23:55:27 +02:00
sharkdp 3355aeba22 Update CHANGELOG 2020-03-31 09:33:58 +02:00
sharkdp 9a050cd87f Update CHANGELOG 2020-03-27 07:33:56 +01:00
sharkdp 522ab7a83c CHANGELOG: Add entries for upcoming release 2020-03-26 09:55:21 +01:00
David Peter 0c5b4fcd4a Add CHANGELOG to the repository 2020-03-26 09:55:21 +01:00