Commit Graph

169 Commits (5d75d81b1ec70ff72b03c89bfae0fdcbc3db1380)

Author SHA1 Message Date
Wilfred Hughes 39bd04002c
Merge pull request #369 from esawady/hare
Add Hare support
2022-09-15 09:33:07 +07:00
Wilfred Hughes cafd672cc8 Don't underline all changes in plaintext files
Fixes #371
2022-09-15 09:30:16 +07:00
Ember Sawady 7ed685ae52 Add support for Hare 2022-09-13 23:34:16 +07:00
Wilfred Hughes 3c51f58d8e Add Pascal support
Fixes #365
2022-09-13 00:05:23 +07:00
Wilfred Hughes f155a27522 Underline changed words in comments
This makes them easier to spot in larger changes.

Fixes #328
2022-09-10 15:54:04 +07:00
Yuya Nishihara 84f0b25fb6 Add support for QML
QML is a UI language, and its syntax is basically JSON-like structure
+ JavaScript. The tree-sitter parser is named after the upstream grammar
file qmljs.g, but the canonical language name is QML. So I choose Qml as
the Language enum.

https://doc.qt.io/qt-6/qmlapplications.html
2022-09-10 11:38:35 +07:00
Wilfred Hughes fe5ef8757d Give novel punctuation a lower edge cost
We'd rather see an unchanged variable name than an unchanged comma.

Fixes #366
2022-09-09 09:47:53 +07:00
Yuya Nishihara cc2d354768 Unset LC_ALL and LC_COLLATE to stabilize regression test output
I set LC_COLLATE=C in ~/.profile, which appears to change the glob order.
LC_ALL would also affect that, so let's unset both.
2022-09-08 22:37:27 +07:00
Wilfred Hughes b104c4be10 Fix sliders in a single global pass
Previously we fixed sliders in each 'possibly changed' region. This
meant that we couldn't fix sliders that needed to move outside the
region. The most common case was code of the form `foo, bar, baz`
where `, baz` was unchanged but we wanted to slide to `,`.

We now call `fix_all_sliders` for the toplevel tree on both
sides. This required some minor changes to the slider logic, as the
unchanged/novel regions could occur at any level of the tree.

(It was probably also the case that we were missing slider
opportunities previously, because we terminated as soon as we found an
outer slider for the nested case.)

This change has no performance impact, probably because tree diffing
is vastly more expensive (O(N^2)) than sliders (O(N)).

Fixes #327
2022-09-02 18:10:09 +07:00
Wilfred Hughes eabefd5612 Factor out language name pretty-printing 2022-09-02 11:56:51 +07:00
Wilfred Hughes b31e3c78c1 Add sample files missing from b1b3756fa7 2022-09-01 09:21:25 +07:00
Wilfred Hughes b1b3756fa7 Attempt to detect and decode UTF-16 files too
Closes #345
2022-08-28 15:38:57 +07:00
Wilfred Hughes 09334030ab Fix incorrect line number being used in side-by-side display
Fixes #334
2022-08-22 09:34:34 +07:00
Wilfred Hughes 026b2674d0 Update expected output
The previous two commits were done in a branch that was rebased, so
the integration tets missed 5fe6d551d.
2022-08-21 21:36:00 +07:00
Wilfred Hughes c957818514 Explore two graph nodes for each parenthesis position
This produces substantially better diff results, and fixes the 'last
item in the list shown as changed' problem.

This can produce slower diffing. typing_before.ml takes 10% more
instructions and slow_before.rs takes 110% more instructions.
2022-08-21 16:34:17 +07:00
Wilfred Hughes a71d6118cf Store predecessors and neighbours as mutable fields in graph nodes
This is a more traditional graph representation. It is slightly easier
to reason about, and it's clearer that graph node creation time
dominates graphs exploration.

This is a slight performance regression, but it enables better
exploration of parethesis nesting (see next commit). typing_before.ml
has regressed from 3.75B instructions to 3.85B instructions and
slow_before.rs has regressed from 1.73B instructions to 2.15B
instructions.

This change has also made the diff output for slow_before.rs slightly
worse (note the `lhs` variable is now claimed as changed in more
cases). It's not clear why, but presumably means that the node visit
order has changed slightly.

Closes #324
2022-08-21 16:25:54 +07:00
Wilfred Hughes 58c8f47298 Also consider highlights.scm when marking nodes as comments
This removes the need to special-case Perl, and is necessary for
CMake (which has nodes bracket_comment and line_comment that aren't
marked as 'extra').
2022-08-20 18:28:07 +07:00
Wilfred Hughes 01cce54978 Fix path display when called from git with two arguments
Fixes #332
2022-08-18 23:00:13 +07:00
Wilfred Hughes 0dce9fcec5 Update regression tests following 38c6718c86 2022-07-11 22:14:12 +07:00
Wilfred Hughes 7e34d7073b Update regressio tests for new JSON upstream highlighting 2022-07-10 23:36:11 +07:00
Wilfred Hughes c5a5555862 Update Gleam parser 2022-07-10 22:58:50 +07:00
Wilfred Hughes d05a3d9373 Add Julia sample files 2022-07-04 19:57:00 +07:00
Wilfred Hughes 975ff6eedd Update regression tests now that @conditional is highlighted
This is mostly `if` keywords in various positions now being
highlighted as keywords.
2022-07-04 19:54:00 +07:00
Wilfred Hughes 719654d462
Merge pull request #301 from lilydjwg/master
use unicode-width to align CJK characters
2022-07-04 15:07:25 +07:00
Wilfred Hughes 156c701459 Add large files from #293 for test
This file pair exposed a bunch of perf issues, so it's useful to keep
it around.
2022-07-03 22:18:30 +07:00
Wilfred Hughes 2d43075841 HTML: include doublequotes in attribute atoms 2022-07-03 22:11:25 +07:00
lilydjwg 0648b0a6cf add sample_files for Chinese (CJK fullwidth characters)
One of the other three "expected" updates is caused by a fullwidth emoji
and others are removal of colored empty strings.
2022-07-04 12:01:49 +07:00
Benjamin Manns d131ae1d35 Add HTML parser 2022-07-01 12:23:20 +07:00
Wilfred Hughes 3eada5b9b0 Prefer outer delimiter in lisps 2022-05-11 11:54:02 +07:00
Wilfred Hughes ca1dbbc264 Update expected output file for 902c30f6c 2022-05-11 11:45:48 +07:00
Wilfred Hughes 1a6c5b8e7f Display rename information when before and after paths are different 2022-05-08 11:52:42 +07:00
Wilfred Hughes 2d8e1cf180
Merge pull request #279 from Xuanwo/fix_bad_padding
fix: Bad padding of column numbers at the end of files
2022-05-07 11:27:47 +07:00
cherryblossom defc084637
Add Elvish support
Add support for [Elvish](https://elv.sh).
2022-05-07 20:12:43 +07:00
Xuanwo 5cfe53820b
chore: Update compare expected
Signed-off-by: Xuanwo <github@xuanwo.io>
2022-05-03 14:45:25 +07:00
Wilfred Hughes 03c5d78650 Treat perl regexes as atoms too 2022-04-29 18:28:01 +07:00
Wilfred Hughes 3bb5933163 Ensure Perl comments are treated as atoms with an atom kind of comment 2022-04-29 18:23:31 +07:00
Wilfred Hughes e1cbdc1478 Allow users to override the tab width
Fixes #274
2022-04-28 20:47:04 +07:00
Wilfred Hughes 62e5b21d53 Merge remote-tracking branch 'cherryblossom/swift' 2022-04-28 09:12:54 +07:00
Wilfred Hughes f98f2a8aca Fix directory diffing when files were only present on one side
This particularly helps usage with mercurial when files are added or
removed.

Fixes #272
2022-04-27 21:46:46 +07:00
cherryblossom b87d6c99f7
Add Swift support 2022-04-26 17:08:23 +07:00
Wilfred Hughes a9af73d944 Add a second file to the test directory 2022-04-24 20:13:17 +07:00
Wilfred Hughes b2320b29d5
Merge pull request #264 from Xuanwo/hcl
feat: Add HCL support
2022-04-24 08:48:34 +07:00
Xuanwo d4c3d114dc
fix: Add atoms for hcl
Signed-off-by: Xuanwo <github@xuanwo.io>
2022-04-24 15:57:51 +07:00
Wilfred Hughes f91357b729 Update perl regression test 2022-04-23 11:33:01 +07:00
Xuanwo 5a7ca84455
feat: Add highlights support for hcl
Signed-off-by: Xuanwo <github@xuanwo.io>
2022-04-23 01:55:44 +07:00
Xuanwo 4b3213acdc
feat: Add HCL support
Signed-off-by: Xuanwo <github@xuanwo.io>
2022-04-23 01:10:08 +07:00
Xuanwo 20289dfe91
fix: Expected compare not updated
Signed-off-by: Xuanwo <github@xuanwo.io>
2022-04-22 19:00:00 +07:00
Xuanwo b85f996ff0
feat: Add perl support
Signed-off-by: Xuanwo <github@xuanwo.io>
2022-04-22 10:14:19 +07:00
Wilfred Hughes a91a3e5db0 Handle namespaced highlighting queries 2022-04-18 09:35:09 +07:00
Wilfred Hughes aa14b60933 Update regression test for 8 space indent 2022-04-17 20:15:34 +07:00