Commit Graph

6983 Commits (91db24fc9a9ba09f27d59a1fa07ac7719a6f8a81)
 

Author SHA1 Message Date
Wilfred Hughes 54571a0939 Fix build 2021-11-02 23:35:43 +07:00
Wilfred Hughes 31f8b66243 Collapse the unchanged side if a hunk is exclusively adds/removes 2021-11-02 23:35:43 +07:00
Wilfred Hughes f4fc799b40 Render line numbers properly in hunks 2021-11-02 23:35:43 +07:00
Wilfred Hughes 5c676b1bec Print source with hunks 2021-11-02 23:35:43 +07:00
Wilfred Hughes e1cb9fa94e Hooking up more of hunk line processing 2021-11-02 23:35:43 +07:00
Wilfred Hughes 3bf5fe05ba Fix context to not reuse previous lines 2021-11-02 23:35:43 +07:00
Wilfred Hughes 711e694d4d Improve alignment when printing hunk lines 2021-11-02 23:35:43 +07:00
Wilfred Hughes b1d2d5185e Fix left/right confusion in context calculations 2021-11-02 23:35:43 +07:00
Wilfred Hughes e7b416a205 Use context functions rather than the previous extend ones 2021-11-02 23:35:43 +07:00
Wilfred Hughes 637b13488d Finish basic context implementation 2021-11-02 23:35:43 +07:00
Wilfred Hughes 48d69a2332 Implement before_with_opposites 2021-11-02 23:35:43 +07:00
Wilfred Hughes b117bd69c1 Extract opposite lines from a slice of MatchedPos 2021-11-02 23:35:43 +07:00
Wilfred Hughes 400b54d97a Store a tuple in self_pos 2021-11-02 23:35:43 +07:00
Wilfred Hughes 0769a6bf3c Store self_pos on UnchangedCommentPart 2021-11-02 23:35:43 +07:00
Wilfred Hughes 75ff659bc5 Store self_pos on Unchanged matches 2021-11-02 23:35:43 +07:00
Wilfred Hughes 337c877a97 Don't use prev_opposite_pos in hunk calculations 2021-11-02 23:35:43 +07:00
Wilfred Hughes 4e5dc2b6bd Basic hunk line extraction 2021-11-02 23:35:43 +07:00
Wilfred Hughes 3efa77c43e Add example of a single line changing in a block comment 2021-11-02 23:23:37 +07:00
oxalica 4094e3a040
Handle words containing bare '#' (#109)
* Handle words containing bare '#'

Only a word beginning with a '#' starts a comment. A word can contain
'#' character without escaping as long as it is not the first character.

See: Bash Reference Manual section '3.1.3 Comments'
https://www.gnu.org/software/bash/manual/bash.html#Comments

* Regenerate
2021-11-01 09:59:27 +07:00
Wilfred Hughes a87882c0a3 Increase required rust version
radix-heap uses macros for built-in arguments, which was added in Rust
1.54:
https://github.com/rust-lang/rust/blob/master/RELEASES.md#version-1540-2021-07-29
2021-10-30 12:46:42 +07:00
Wilfred Hughes 1f39284127 Clarify that link points to GitHub 2021-10-29 00:22:55 +07:00
Wilfred Hughes c0cd13bd9b Pin Rust version to 1.46
Specify the minimum Rust version in cargo.toml, exercise this version in CI,
and document it in the manual.

We require 1.46 for bitflags, which is a dependency of clap.

Fixes #51
2021-10-29 00:20:07 +07:00
Wilfred Hughes 86724658c0 Update radix-heap version
This avoids us depending on an old version of ordered_float, which has
a security advisory: https://rustsec.org/advisories/RUSTSEC-2020-0082

It also slightly reduces the number of dependencies of difftastic.
2021-10-28 00:51:37 +07:00
Wilfred Hughes 0f8a2d3672 Highlight line numbers for lines with changes 2021-10-28 00:21:45 +07:00
Wilfred Hughes c23a36411d Only use bold for keywords in novel tokens
This makes added/removed regions slightly less prominent, but easier
to read. It also makes them more consistent with the styling on the
surrounding text.
2021-10-27 23:55:33 +07:00
Wilfred Hughes 9df3089199 Fix typo 2021-10-27 23:39:42 +07:00
Wilfred Hughes 5349571ad7 Only store prev_opposite_pos on novel positions
This is much easier to reason about, rather than overloading
opposite_pos and prev_opposite_pos.
2021-10-23 21:26:46 +07:00
Wilfred Hughes b3106e1382 Print file name and hunk number on every hunk 2021-10-23 16:52:49 +07:00
Wilfred Hughes 5e9a0eec5d Rename JSON files to match sample file naming convention 2021-10-23 16:24:54 +07:00
Wilfred Hughes c698f8979b Rename binary to `difft` for brevity 2021-10-23 16:19:33 +07:00
Wilfred Hughes 5c3f95ae29 Log CLI arguments
This is really helpful when debugging corner cases with git/mercurial
calling difftastic.
2021-10-23 16:08:16 +07:00
Wilfred Hughes aa65b20665 Bump dependencies 2021-10-23 15:43:18 +07:00
Sebastian Dröge ebebfdf23e Fix typo in CHANGELOG.md 2021-10-19 08:54:25 +07:00
Wilfred Hughes e82a3f62f7 Clarify syntax highlighting features in 0.11 2021-10-18 23:10:09 +07:00
Wilfred Hughes ddd05cf738 Fix heading in changelog that should be h3 2021-10-18 23:07:44 +07:00
Wilfred Hughes dff1d3e7f9 Update screenshots and note repro commands 2021-10-18 23:04:27 +07:00
Wilfred Hughes 44b025fdc5 Roll version 2021-10-18 22:42:17 +07:00
Wilfred Hughes 6824ba7d6b Add release instructions to the manual 2021-10-18 22:41:56 +07:00
Wilfred Hughes 4287594cda Don't consider other paths when UnchangedNode is available
This substantially decreases the number of edges in our graphs,
especially when few nodes have changed. Diffing slow_before.rs with
slow_after.rs now takes half the time on my machine.

This makes diffing slightly greedier, so there may exist cases where
diffs are slightly worse. Comparing AXAB with AB is arguably nicer
as (+AX)AB rather than A(+XA)B. However, all the tests still pass,
and it's a huge perf win.

Closes #47
2021-10-18 22:23:44 +07:00
Wilfred Hughes 7f426070f6 Compute multiple MatchedPos from a slice of SingleLineSpan values 2021-10-17 17:24:36 +07:00
Wilfred Hughes 2640cbc101 Store only SingleLineSpan in MatchedPos
Positions almost always span a single line, as they just track
tokens. The only exception is multiline strings or comments.

Trying to match up all the lines between two tokens is far more
complex and doesn't provide much benefit. It was already the case that
we used the first line in the position in several code paths anyway.
2021-10-16 21:38:02 +07:00
Wilfred Hughes de110b3660 cargo fmt 2021-10-16 21:33:44 +07:00
Martin Jambon 7fb8506cbe
Merge pull request #112 from tree-sitter/mj-until
Add support for 'until' loops
2021-10-16 14:38:43 +07:00
Wilfred Hughes 10716461d3 Print the first few items of the route found when tracing 2021-10-16 09:31:10 +07:00
Martin Jambon c93070d720 Regenerate files 2021-10-16 01:46:22 +07:00
Martin Jambon 9d9325f8f9 Add support for 'until' loops 2021-10-16 01:44:38 +07:00
Gleb Pomykalov 1fedb2a117
wasm32-wasi SDK doesn't support exceptions. This commit disables exceptions when compile for wasm32-wasi. (#192) 2021-10-12 10:20:47 +07:00
Arthur Baars bb6a42e42b
Merge pull request #191 from aibaars/forwarded-args
Add forwarded parameters/arguments
2021-10-11 11:41:26 +07:00
Arthur Baars 95af674ff8 Merge remote-tracking branch 'origin/master' into forwarded-args 2021-10-11 11:14:31 +07:00
Martin Jambon 30d369ba45
Merge pull request #111 from tree-sitter/mj-select
Support for 'select' loops
2021-10-10 01:14:12 +07:00