Commit Graph

6983 Commits (91db24fc9a9ba09f27d59a1fa07ac7719a6f8a81)
 

Author SHA1 Message Date
Wilfred Hughes 91db24fc9a Add language detection based on whole file names 2021-12-27 12:38:22 +07:00
Wilfred Hughes 35c481289a Add basic unit test for language detection by extension 2021-12-27 12:23:22 +07:00
Wilfred Hughes f6f9f16e9f Separate language detection from tree-sitter configuration 2021-12-27 12:18:46 +07:00
Wilfred Hughes 909656398e Print to stderr when reporting errors, even with debugging flags 2021-12-27 12:06:43 +07:00
Wilfred Hughes ca47e6592b Fix typo 2021-12-27 12:05:58 +07:00
Wilfred Hughes abb6bd9657 Fix needless borrows 2021-12-27 12:03:58 +07:00
Wilfred Hughes 9e3118f45d Qualify tree-sitter imports 2021-12-27 11:58:44 +07:00
Wilfred Hughes 6f40d54e27 Use Path arguments when we're dealing with paths 2021-12-26 10:55:38 +07:00
Wilfred Hughes 4883edd90c Factor out a DiffResult type
This separates diffing and printing better, and will make it easier to
provide a JSON output for #73.
2021-12-21 23:44:55 +07:00
Wilfred Hughes cb900c3463 Revert to term_size
Git invokes difftastic and then pipes stdout to less, but stderr still
goes to the terminal. term_size queries both stdout and stderr, so it
can still find the terminal width in this situation.

Previously, we'd always use a width of 80 when invoked by git.

terminal_size discussion:
https://github.com/eminence/terminal-size/issues/23

term_size does claim to support Windows, and #71 was not fixed by
changing libraries, so this seems reasonable.
2021-12-19 12:48:52 +07:00
Wilfred Hughes 382d498559 Fix crash when opposite side has unpaired lines
See #66
2021-12-18 23:30:16 +07:00
Wilfred Hughes 06ad384243 Document the best we can do for mercurial log viewing
Closes #61
2021-12-17 09:46:50 +07:00
Wilfred Hughes efafd817ef Reorder and polish contributing page 2021-12-17 09:39:13 +07:00
Wilfred Hughes 1fc9f3f07a Give git and mercurial their own pages in the manual 2021-12-17 09:38:09 +07:00
Wilfred Hughes 2e61df4fac Update to latest mdbook 2021-12-17 09:25:34 +07:00
Wilfred Hughes 5c365c6212 cargo fmt 2021-12-11 16:02:42 +07:00
Wilfred Hughes 87a9182d3f Clarify docstring wording 2021-12-11 16:02:18 +07:00
Wilfred Hughes 447ed2c14d Fix crash on unicode characters on line boundaries
Fixes #74
2021-12-11 15:58:07 +07:00
Wilfred Hughes 740a82e6fc Note robustness in known issues
There are several crashes in the current release.
2021-12-11 14:49:26 +07:00
Wilfred Hughes 36857c3828 Allow terminal width to be overridden by DFT_WIDTH
Should help with #71.
2021-12-11 14:46:03 +07:00
Wilfred Hughes cc9f2f2d40
Fix typo 2021-12-08 00:50:51 +07:00
Wilfred Hughes 6f1baae23e Prefer terminal_width crate so we support more platforms
term_width is unmaintained and does not support Windows.

Fixes #71
2021-12-07 23:24:13 +07:00
Wilfred Hughes bffbf1b779 Document release dates 2021-12-07 23:13:46 +07:00
Wilfred Hughes d820a4ed29 Document windows build fixes 2021-12-07 23:10:07 +07:00
Wilfred Hughes 2bdd876d40 Expand example in JSX samples to test #72 2021-12-07 23:09:07 +07:00
Wilfred Hughes d417fc9ae1 Print string contents of tree-sitter leaf nodes 2021-12-07 23:09:07 +07:00
Jason Shirk ea055e6356 Fix Windows build warning 2021-12-07 09:13:54 +07:00
Wilfred Hughes 4529018d1d Attempt to set C++ standard for Windows compilers
There's no helper in the cc crate for this, but it's been proposed:
https://github.com/alexcrichton/cc-rs/issues/565

Hopefully will improve #67
2021-12-05 10:43:29 +07:00
Wilfred Hughes 1c4eb774d8 Minor grammar fix to contributing guide 2021-12-04 23:56:59 +07:00
Wilfred Hughes 4948f59855 Roll version 2021-12-04 23:56:42 +07:00
Wilfred Hughes 89e42240fd Remove unused type 2021-12-04 23:53:35 +07:00
Wilfred Hughes 34ab0cd516 Fix comment referencing an unused type 2021-12-04 23:52:20 +07:00
Wilfred Hughes e00f94fed8 Treat float values as atoms in CSS
Otherwise we treat `0.5em` as two atoms, unlike `1em` which was
already a single atom.
2021-12-04 18:34:24 +07:00
Wilfred Hughes 9fbb1a2b78 cargo fmt 2021-12-04 18:20:45 +07:00
Wilfred Hughes aab3e7f2cc Treat regex literals and template string literals as atoms in JS/TS
Fixes #64
2021-12-04 18:19:15 +07:00
Wilfred Hughes 4f0fa617df Don't require flags that only disable warnings
These flags aren't strictly required, they're only used to prevent
warnings when compiling tree-sitter parsers.

Should help with compiling on MSVC, see #63.
2021-12-04 18:10:31 +07:00
Wilfred Hughes 29fa6f1102 Ensure sample file is a syntax error for tree-sitter
Turns out that missing closing parens doesn't lead to ERROR nodes.
2021-12-04 18:03:06 +07:00
Wilfred Hughes d9e149decc Log a warning on parse errors
Fixes #62
2021-12-04 18:02:36 +07:00
Wilfred Hughes 87c486742c Treat punctuation characters individually when splitting comments
Fixes #49
2021-11-30 22:45:10 +07:00
Wilfred Hughes 37c6cc2875 Remove accidental dbg 2021-11-30 22:40:33 +07:00
Wilfred Hughes 5445608ab4 Adding debug logs when diffing whole directories
Should help with #53
2021-11-30 09:40:32 +07:00
Wilfred Hughes 45dd29c822 Cleanup comment 2021-11-30 09:26:15 +07:00
Wilfred Hughes 09f4b3b8e0 Merge commit 'e43ea50e8701bbe319e2a42922caab393267ee1c' 2021-11-28 11:41:26 +07:00
Stephan Seitz e43ea50e87
Merge pull request #8 from theHamsta/fix-replacement-character
Fix replacement character
2021-11-28 15:00:08 +07:00
Stephan Seitz f45d38cc63 Parse sly in CI 2021-11-28 14:59:14 +07:00
Stephan Seitz cfce2b5a58 Fix unquoting in defuns 2021-11-28 14:57:02 +07:00
Stephan Seitz 9a7474e00d fixup: only allow "#\(" and "#\(" 2021-11-28 13:59:46 +07:00
Stephan Seitz 0cf1354208 fix: allow "(" ")" in char literals 2021-11-28 13:55:40 +07:00
Stephan Seitz 14700f45ee Improve parsing of loop macro 2021-11-28 13:49:22 +07:00
Stephan Seitz 6078eed3f5 Update tests 2021-11-28 13:20:11 +07:00