Commit Graph

3004 Commits (fcf1b8349f68c3f4b285d1c2c2e331124fe9370e)
 

Author SHA1 Message Date
Wilfred Hughes 26dc10dc67 read_or_die is only used in main.rs, so move it there 2021-07-30 01:09:23 +07:00
Wilfred Hughes daa6ac3f3b Document structs used to track lines 2021-07-30 01:07:51 +07:00
Wilfred Hughes 27c43308c3 Tweak plain text wording to emphasise that it's line oriented 2021-07-30 00:55:31 +07:00
Wilfred Hughes afcb5f5d9c Prefer tests in a nested module 2021-07-30 00:45:01 +07:00
Wilfred Hughes 79018c63fe Be explicit about which languages are supported 2021-07-30 00:38:55 +07:00
Wilfred Hughes fa69fcc045 Fix rustdoc warning 2021-07-28 00:20:29 +07:00
Wilfred Hughes 6e321d070a Bump dependencies to latest minor versions 2021-07-28 00:06:58 +07:00
Wilfred Hughes da63704675 Roll version 2021-07-28 00:04:47 +07:00
Wilfred Hughes 1248682f68 Fix unused import 2021-07-27 23:51:59 +07:00
Wilfred Hughes d68d803521 Formatting 2021-07-27 23:51:28 +07:00
Wilfred Hughes c5aee5cc9d Clarify the license of sample files 2021-07-27 23:50:50 +07:00
Wilfred Hughes d8fb6413ef Ignore local notes 2021-07-27 23:49:31 +07:00
Wilfred Hughes ad585be0fc Add another elisp sample file 2021-07-27 23:48:58 +07:00
Wilfred Hughes 2aae6b6e77 Add a JS test file showing a larger change 2021-07-27 23:48:03 +07:00
Wilfred Hughes 78d0a354db Add sample file for changing nesting levels of variables
The last expression `res` in `fn parse_lines` was previously handled
badly, choosing an inner `res` occurrence.
2021-07-27 23:46:11 +07:00
Wilfred Hughes 6f2140e901 Replace tabs with spaces before parsing
Difftastic uses offsets to store the positions of AST nodes, so we
cannot replace tabs after parsing.

A string literal with a tab character "	" being replaced by a four
space string literal "    " is now ignored by difftastic. This is
wrong: difftastic should only ignore whitespace between atoms.

This is still an improvement for source code that uses tab characters,
which is common in Go. The above case should be rare until we have a
full solution.

Fixes #24
2021-07-27 23:36:20 +07:00
Wilfred Hughes a7f688ee82 Put a spacer between LHS and RHS lines printed
Width calculations already consider the spacer, but it was lost in a
refactor.
2021-07-27 22:02:48 +07:00
Wilfred Hughes f24c4954bc Update changelog for previous commit 2021-07-27 22:01:38 +07:00
maekawatoshiki 725b346c58 Show help if no arguments given 2021-07-26 21:10:27 +07:00
Wilfred Hughes 7701e38510 Add a basic Go parser 2021-07-25 23:46:33 +07:00
sogaiu c00293fb0c Add status clarification to README 2021-07-26 11:59:27 +07:00
Wilfred Hughes e6693d2204 Add TODO 2021-07-25 13:56:00 +07:00
Wilfred Hughes f8b6b8ae13 Define a SyntaxInfo::new helper 2021-07-25 13:52:30 +07:00
Wilfred Hughes 171236e2d5 Avoid recompiling another regex 2021-07-25 13:03:15 +07:00
Wilfred Hughes 9c37d854d1 Avoid .unwrap() when printing positions 2021-07-25 13:00:46 +07:00
Wilfred Hughes 6d5704aed9 Only compile the newline regexp once 2021-07-25 12:56:02 +07:00
Wilfred Hughes e36a2e8c96 Don't crash on binary files 2021-07-25 12:50:42 +07:00
Wilfred Hughes c8481775e2 Remove --context CLI argument 2021-07-25 12:34:50 +07:00
Wilfred Hughes 04214ef1ef Ignore indentation changes on multiline comments 2021-07-25 12:27:24 +07:00
Wilfred Hughes a711d1e424 Fix spelling 2021-07-25 11:39:10 +07:00
Wilfred Hughes 280a5ffe9e Add alignment todo 2021-07-25 10:41:45 +07:00
Wilfred Hughes 9c71298f82 Define a separate Interval type rather than using RangeInclusive 2021-07-25 10:39:15 +07:00
Wilfred Hughes 64cc9ce973 Remove completed todo 2021-07-25 09:53:01 +07:00
Wilfred Hughes 818d69a84a Make clippy happier 2021-07-25 09:52:25 +07:00
Wilfred Hughes fe26935346 cargo fmt 2021-07-25 09:51:26 +07:00
Wilfred Hughes a5b11c5eca Update screenshot 2021-07-24 18:07:32 +07:00
Wilfred Hughes 3ebbf268fd Improve alignment when LHS and RHS have different numbers of lines 2021-07-24 18:01:12 +07:00
Wilfred Hughes 1aeb68427d Simplify result printing so we don't need to concat after 2021-07-24 17:32:51 +07:00
Wilfred Hughes 61e5f912f7 Remove TODO
Contiguous nodes can be the first or last on the line, so we need the
prev_novel data.
2021-07-24 17:26:41 +07:00
Wilfred Hughes 928584676a Only highlight individual comment words for comments that are similar 2021-07-24 17:01:30 +07:00
Wilfred Hughes 3a26616fac Remove commented-out code 2021-07-24 16:58:51 +07:00
Wilfred Hughes 3f8e41d862 Parse @ in elisp 2021-07-24 16:50:53 +07:00
Wilfred Hughes 45af6b4534 Parse < and > as symbols in elisp 2021-07-24 16:45:06 +07:00
Wilfred Hughes 2da5181ffb Prefer replacing comments over novel atoms
This was broken in 4c33f34.
2021-07-24 16:36:36 +07:00
Wilfred Hughes 6d7e155cc6 Remove unused CLI parameter 2021-07-24 16:27:33 +07:00
Wilfred Hughes f79c77d421 Prefer u64 for num_descendants 2021-07-24 16:06:46 +07:00
Wilfred Hughes b3f98e9639 LineNumber only has one field, so use a tuple struct 2021-07-24 16:04:25 +07:00
Wilfred Hughes 1927707001 Treat strings the same as other atoms
There's no different highlighting or behaviour for string literals, so
there's no benefit to the addition complexity of handling them
separately.
2021-07-22 00:19:48 +07:00
Wilfred Hughes 0a7273850f cargo fmt 2021-07-22 00:09:26 +07:00
Wilfred Hughes b81312e88b Roll version 2021-07-22 00:09:13 +07:00