Commit Graph

994 Commits

Author SHA1 Message Date
a5bd9f51be Added JSONC and aws credentials to the syntax mappings 2024-02-11 04:57:42 +08:00
1023399c5e Remove hyperlink when wrapping lines 2024-02-09 22:09:39 -08:00
6549e26f5d Re-emit hyperlinks when wrapping lines 2024-02-09 22:09:39 -08:00
165c495e75 Replace AnsiCodeIterator in printer.rs
This uses the new EscapeSequenceIterator, saving us a preprocessing step
for each line.
2024-02-09 22:09:39 -08:00
6b9b085be3 Add EscapeSequenceIterator
This is an iterator for escape sequences, using
EscapeSequenceOffsetsIterator for the underlying parsing of individual
escape sequences.
2024-02-09 22:09:39 -08:00
054421268f Strip OSC sequences before printing
This commit strips OSC (Operating System Command) sequences before
printing lines. Eventually when time permits, I want to add back
support for printing OSC sequences (and improve it to treat hyperlinks
like an attribute).

Until then, this should help prevent garbled output :)
2024-02-09 22:09:39 -08:00
414403b062 Add EscapeSequenceOffsetsIterator
This can be used to extract a subset of ANSI escape sequences from a
string of text. I have big plans for this eventually, but for now, it'll
be used to strip OSC before printing.
2024-02-09 22:09:35 -08:00
1a54c9bf6d Eliminate dependency on serde's "derive" feature 2024-02-08 15:55:30 -08:00
02077db53e undid unnecessary api visibility changes 2024-02-08 21:41:20 +00:00
7ce010d9ed Using hypens instead of underscores for set-terminal-title command 2024-02-08 21:33:03 +00:00
0af1df5258 Create xonsh.toml 2024-01-31 14:07:56 +01:00
7f12989127 added set_terminal_title arg to clap_app.rs to fix ci errors 2024-01-29 09:47:41 +00:00
60e32cf823 removed set_terminal_title arg from clap_app.rs since other boolean args aren't in clap_app.rs 2024-01-27 14:46:13 +00:00
b33e33fe26 terminal title is only set if user opts in with --set_terminal_title flag 2024-01-27 14:17:25 +00:00
9239b125b1 added a flag to config for setting terminal title 2024-01-27 14:14:40 +00:00
e586751208 Attempt to fix integration test 2024-01-21 19:48:26 +01:00
5c1f47359e Run cargo fmt 2024-01-21 19:48:26 +01:00
45ee2dc4c7 fix: Wrap file name in header 2024-01-21 19:48:26 +01:00
230abfd2bc Merge branch 'master' into syntax-mapping-refactor 2024-01-19 15:18:48 +08:00
c0f2d6f934 Add note on subdirectory's irrelevance to ordering 2024-01-18 23:26:00 +08:00
e4d637a3d8 Reverse precedence of syntax mappings specified on CLI 2024-01-18 22:41:57 +08:00
8e66bc8722 Make the error handler FnMut 2024-01-17 22:00:29 +01:00
3b0ade9cb8 slightly changed set terminal command to match docs & broke print line into multiple variables 2023-12-31 22:24:44 +00:00
57016f4e04 small refactoring of set terminal title function 2023-12-31 22:15:00 +00:00
12b74dfb4e terminal title is only set when pager is being used 2023-12-18 16:59:12 +00:00
f0a6fe216d Benchmark prototype 2023-12-11 10:38:59 +08:00
8a08025091 Disable builtin_mappings_are_lazily_evaluated for ARM builds 2023-12-11 10:21:06 +08:00
586c804b1e Add test: builtin_mappings_are_lazily_evaluated 2023-12-11 10:21:06 +08:00
e30161ac3c Add test: builtin_mappings_matcher_only_compile_once 2023-12-11 10:21:06 +08:00
3865908439 Add test: custom_mappings_precedence 2023-12-11 10:21:06 +08:00
9474b4cf8b Rename & sort syntax mapping tests 2023-12-11 10:21:06 +08:00
b48bda21a3 Add test: all_fixed_builtin_mappings_can_compile 2023-12-11 10:21:06 +08:00
36073a3d95 Document another rule ignore condition 2023-12-11 10:21:06 +08:00
1f10d846a3 Fix tests
1. for override test, test for something in `common`
2. move git mappings to `common`
2023-12-11 10:21:05 +08:00
22531eab90 Port all mappings to new system 2023-12-11 10:21:05 +08:00
0c1b80faab Impl per-target syntax mappings 2023-12-11 10:21:05 +08:00
ad628c0471 Fix iterator lifetime incompatibility 2023-12-11 10:21:05 +08:00
f483d2df42 Lazily compile GlobMatchers 2023-12-11 10:21:05 +08:00
4ad3002543 s/Lazy<GlobMatcher>/Lazy<Option<GlobMatcher>>/ 2023-12-11 10:21:05 +08:00
cfd622d6e1 Migrate SyntaxMapping impl to new system
Most existing builtins are removed but not yet ported, so the test
`user_can_override_builtin_mappings` should fail. It should pass once the old
rules have been ported.
2023-12-11 10:21:05 +08:00
1c7c9a6b6d Split syntax_mapping/builtin.rs 2023-12-11 10:21:05 +08:00
de6d418d42 Remove BuiltinMatcher enum
Explanation added as comments in code
Using plain `Lazy<Option<GlobMatcher>>` is just better
2023-12-11 10:21:04 +08:00
7e1fbcfe95 Fix visibility for SyntaxMapping::get_syntax_for
This change was made in 31fb708, but then was reverted (I assume incorrectly)
in 6246485.
2023-12-11 10:21:04 +08:00
0fea82cff9 Minor improvement of variable naming accuracy 2023-12-11 10:20:11 +08:00
64840fbbae join_segments -> build_glob_string
- this is a more descriptive name
2023-12-11 10:20:11 +08:00
827b3eca2f Add unset *.conf example 2023-12-11 10:20:11 +08:00
9478d2dfe8 Isolate variables at compile time 2023-12-11 10:20:11 +08:00
d24501ab5e include! generated mappings in source 2023-12-11 10:20:11 +08:00
52f94b4623 Clarify syntax selection algorithm behaviour 2023-12-11 10:20:10 +08:00
37fd050100 Describe filename ordering more accurately 2023-12-11 10:20:10 +08:00