Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Map fish_history to YAML #2237

Merged
merged 3 commits into from
Sep 4, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
- `Julia`: Fix syntax highlighting for function name starting with `struct`, see #2230
- Minor update to `LiveScript`, see #2291
- Associate `.mts` and `.cts` files with the `TypeScript` syntax. See #2236 (@kidonng)
- Fish history is mapped to YAML. See #2237 (@kidonng)

## Themes

Expand Down
3 changes: 3 additions & 0 deletions src/syntax_mapping.rs
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,9 @@ impl<'a> SyntaxMapping<'a> {
mapping
.insert("*.pac", MappingTarget::MapTo("JavaScript (Babel)"))
.unwrap();
mapping
.insert("fish_history", MappingTarget::MapTo("YAML"))
.unwrap();

// See #2151, https://nmap.org/book/nse-language.html
mapping
Expand Down
11 changes: 11 additions & 0 deletions tests/syntax-tests/highlighted/fish_history/fish_history
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
- cmd: echo "hello world"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for taking the time to open a PR!

I'm a bit confused, because this file looks very gray and not very YAML-y. Do you see what I see or am I doing something wrong?

Screenshot 2022-08-12 at 15 30 11

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The file looks fine to me.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

curl -q https://raw.githubusercontent.com/sharkdp/bat/1e1fa7cde5c973ea42c97ea18479d1b0b1d3d4a0/tests/syntax-tests/highlighted/fish_history/fish_history

image

 when: 1656950812
- cmd: ls /tmp
 when: 1656950818
 paths:
 - /tmp
- cmd: cp .local/share/fish/fish_history .
 when: 1656950833
 paths:
 - .local/share/fish/fish_history
 - .
11 changes: 11 additions & 0 deletions tests/syntax-tests/source/fish_history/fish_history
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
- cmd: echo "hello world"
when: 1656950812
- cmd: ls /tmp
when: 1656950818
paths:
- /tmp
- cmd: cp .local/share/fish/fish_history .
when: 1656950833
paths:
- .local/share/fish/fish_history
- .