Skip to content

Commit 3b7b443

Browse files
martihomssolerMHS
and
MHS
authored
syntect additional file type support (#2160)
closes #2005 Co-authored-by: MHS <[email protected]>
1 parent 5fafe78 commit 3b7b443

File tree

4 files changed

+17
-3
lines changed

4 files changed

+17
-3
lines changed

CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
2828
### Fixes
2929
* bump yanked dependency `bumpalo` to fix build from source ([#2087](https://github.com/extrawurst/gitui/issues/2087))
3030
* pin `ratatui` version to fix building without locked `cargo install gitui` ([#2090](https://github.com/extrawurst/gitui/issues/2090))
31+
* add syntax highlighting support for more file types, e.g. Typescript, TOML, etc. [[@martihomssoler](https://github.com/martihomssoler)] ([#2005](https://github.com/extrawurst/gitui/issues/2005))
3132

3233
## [0.25.0] - 2024-02-21
3334

Cargo.lock

+12
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

+3-2
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ syntect = { version = "5.2", default-features = false, features = [
5555
"html",
5656
] }
5757
tui-textarea = "0.4.0"
58+
two-face = { version = "0.3.0", default-features = false }
5859
unicode-segmentation = "1.11"
5960
unicode-truncate = "0.2"
6061
unicode-width = "0.1"
@@ -71,8 +72,8 @@ maintenance = { status = "actively-developed" }
7172
default = ["ghemoji", "regex-fancy", "trace-libgit", "vendor-openssl"]
7273
ghemoji = ["gh-emoji"]
7374
# regex-* features are mutually exclusive.
74-
regex-fancy = ["syntect/regex-fancy"]
75-
regex-onig = ["syntect/regex-onig"]
75+
regex-fancy = ["syntect/regex-fancy", "two-face/syntect-fancy"]
76+
regex-onig = ["syntect/regex-onig", "two-face/syntect-onig"]
7677
timing = ["scopetime/enabled"]
7778
trace-libgit = ["asyncgit/trace-libgit"]
7879
vendor-openssl = ["asyncgit/vendor-openssl"]

src/ui/syntax_text.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ pub struct SyntaxText {
3333
}
3434

3535
static SYNTAX_SET: Lazy<SyntaxSet> =
36-
Lazy::new(SyntaxSet::load_defaults_nonewlines);
36+
Lazy::new(two_face::syntax::extra_no_newlines);
3737
static THEME_SET: Lazy<ThemeSet> = Lazy::new(ThemeSet::load_defaults);
3838

3939
pub struct AsyncProgressBuffer {

0 commit comments

Comments
 (0)