From 839e62cff842acbf01c0894b8ffc2c51227f7f9b Mon Sep 17 00:00:00 2001 From: Kid <44045911+kidonng@users.noreply.github.com> Date: Mon, 4 Jul 2022 21:19:09 +0000 Subject: [PATCH] Map `fish_history` to YAML --- src/syntax_mapping.rs | 3 +++ .../highlighted/fish_history/fish_history | 15 +++++++++++++++ .../syntax-tests/source/fish_history/fish_history | 11 +++++++++++ 3 files changed, 29 insertions(+) create mode 100644 tests/syntax-tests/highlighted/fish_history/fish_history create mode 100644 tests/syntax-tests/source/fish_history/fish_history diff --git a/src/syntax_mapping.rs b/src/syntax_mapping.rs index 8c8473fd..5e655070 100644 --- a/src/syntax_mapping.rs +++ b/src/syntax_mapping.rs @@ -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 diff --git a/tests/syntax-tests/highlighted/fish_history/fish_history b/tests/syntax-tests/highlighted/fish_history/fish_history new file mode 100644 index 00000000..a7f1a930 --- /dev/null +++ b/tests/syntax-tests/highlighted/fish_history/fish_history @@ -0,0 +1,15 @@ +───────┬──────────────────────────────────────────────────────────────────────── + │ File: fish_history +───────┼──────────────────────────────────────────────────────────────────────── + 1 │ - cmd: echo "hello world" + 2 │  when: 1656950812 + 3 │ - cmd: ls /tmp + 4 │  when: 1656950818 + 5 │  paths: + 6 │  - /tmp + 7 │ - cmd: cp .local/share/fish/fish_history . + 8 │  when: 1656950833 + 9 │  paths: + 10 │  - .local/share/fish/fish_history + 11 │  - . +───────┴──────────────────────────────────────────────────────────────────────── diff --git a/tests/syntax-tests/source/fish_history/fish_history b/tests/syntax-tests/source/fish_history/fish_history new file mode 100644 index 00000000..f295a482 --- /dev/null +++ b/tests/syntax-tests/source/fish_history/fish_history @@ -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 + - .