Commit Graph

1873 Commits (c73b18be77ca73e461a991bf8d30a8c5f95af597)

Author SHA1 Message Date
Wilfred Hughes ef6a65f6f8 Always show a divider, and include the line number 2021-03-07 14:53:10 +07:00
Wilfred Hughes c6d0f97cda Silence a clippy lint 2021-03-07 14:11:17 +07:00
Wilfred Hughes 30a07bb9ff Prefer bold colours for consistency with normal diff 2021-03-07 13:13:11 +07:00
Wilfred Hughes f59e9d0f78 Make clippy happy 2021-03-06 13:46:18 +07:00
Wilfred Hughes ca4fe593cb Silence lint 2021-03-06 13:19:45 +07:00
sogaiu 61139f828d Regenerate src/grammar.json 2021-03-06 10:50:53 +07:00
sogaiu 079a25dc49 Upgrade tree-sitter to 0.19.2 plus related 2021-03-06 10:39:22 +07:00
sogaiu f8006afc91 Rearrangement 2020-10-31 15:07:43 +07:00
sogaiu 3239ee35f3 Tidy up 2020-10-31 11:57:20 +07:00
sogaiu d43e9dd62b Add src files 2020-10-29 22:28:02 +07:00
sogaiu d5f1c03efe Split grammar with sigils 2020-03-10 07:16:41 +07:00
sogaiu 319eae813b Treat tag and metadata as extras 2020-03-10 05:21:12 +07:00
Wilfred Hughes 45e25f7796 cargo fix --edition-idioms 2019-11-22 14:06:46 +07:00
Wilfred Hughes bbb9c37d14 Format tests too 2019-11-21 15:00:07 +07:00
Wilfred Hughes e336e1c762 Fix off-by-one in from_offset 2019-11-19 13:40:59 +07:00
Wilfred Hughes 36732af060 Derive debug on NewlinePositions to help printing when debugging 2019-11-19 13:34:44 +07:00
Wilfred Hughes bd95bdc68c Add clarifying comments on boundary conditions 2019-11-19 13:34:24 +07:00
Wilfred Hughes cc9d24ac98 Comment this deeply imperative logic 2019-11-19 11:51:10 +07:00
Wilfred Hughes 4ecab9b413 Prefer pattern matches over .unwrap() 2019-11-19 11:46:57 +07:00
Wilfred Hughes b517f4571f Ensure we always match up lines on side-by-side diff 2019-11-19 11:32:42 +07:00
Wilfred Hughes 5e0aeca0d3 Fix formatting 2019-11-19 11:29:55 +07:00
Wilfred Hughes 7dd2825254 Rename Range to AbsoluteRange to distinguish from LineRange 2019-11-18 17:58:11 +07:00
Wilfred Hughes fb81bea0c4 Adding TODO for bad newlines 2019-11-18 17:48:40 +07:00
Wilfred Hughes 658cc00bd5 Print both before and after in inline implementation 2019-11-18 17:47:42 +07:00
Wilfred Hughes 2a834beb62 Crude inline diff implementation 2019-11-18 17:17:40 +07:00
Wilfred Hughes a3723797bc Factor out helper function for grouping ranges 2019-11-18 16:36:01 +07:00
Wilfred Hughes 1a8c5c7079 rustfmt 2019-11-18 14:14:10 +07:00
Wilfred Hughes 46ba91b834 Separate CLI flags from doing the diff work 2019-11-18 14:13:57 +07:00
Wilfred Hughes f81a982807 Handle filesystem errors gracefully 2019-11-18 13:25:10 +07:00
Wilfred Hughes 26a3ee36a6 Use pretty assertions 2019-11-18 12:03:33 +07:00
Wilfred Hughes fda3e52010 Run cargo fmt 2019-11-18 11:40:42 +07:00
Wilfred Hughes c7b1281a91 Update for Rust 2018 2019-11-18 11:38:14 +07:00
Wilfred Hughes a15fd77302 Adding another JS lexing test 2019-01-27 19:11:09 +07:00
Wilfred Hughes 0e9b30b6d2 Handle nonexistent paths robustly 2019-01-27 19:11:09 +07:00
Wilfred Hughes a4d2b74094 Adding a crude separator 2019-01-27 19:11:09 +07:00
Wilfred Hughes b142d9e8ad First attempt at matching up corresponding lines 2019-01-27 19:11:09 +07:00
Wilfred Hughes 522e24f178 Track the corresponding line in the alternate file 2019-01-27 19:11:09 +07:00
Wilfred Hughes 5b2d6167b5 Defining a Change struct 2019-01-25 09:54:18 +07:00
Wilfred Hughes cd6cabc14b Rename Change to ChangeKind 2019-01-25 09:47:46 +07:00
Wilfred Hughes d0faad336b Minor option refactoring 2019-01-25 09:44:27 +07:00
Wilfred Hughes c49dfc8c37 Print left lines and right lines separately 2019-01-25 09:44:16 +07:00
Wilfred Hughes 178864e416 Move line boundary logic into NewlinePositions 2019-01-24 10:02:08 +07:00
Wilfred Hughes f75c3784a5 Factoring out a newline conversion API 2019-01-23 09:42:41 +07:00
Wilfred Hughes ef9d05fee3 Enforcing length should not remove newlines 2019-01-22 00:54:25 +07:00
Wilfred Hughes 498bd8df1b Lex single quoted strings in JS 2019-01-22 00:47:25 +07:00
Wilfred Hughes 37f7a4edbf Crude rust support 2019-01-22 00:45:55 +07:00
Wilfred Hughes f20ba428cf Use apply_color_by_line for highlighting 2019-01-22 00:37:59 +07:00
Wilfred Hughes 820a1b49db Fixing tests broken in f94ef9e 2019-01-22 00:37:42 +07:00
Wilfred Hughes 206e9be4b2 Ensure apply_color_by_line doesn't discard newlines 2019-01-22 00:35:19 +07:00
Wilfred Hughes 1dd56fff47 Truncate excessively long lines so output fits in the terminal 2019-01-22 00:12:33 +07:00
Wilfred Hughes a27f7c11c1 Allow overriding the terminal width calculation 2019-01-21 10:05:56 +07:00
Wilfred Hughes 1c6501cf6f Tweak help formatting 2019-01-21 10:05:32 +07:00
Wilfred Hughes 842f8f0554 Three lines of context by default 2019-01-21 09:57:53 +07:00
Wilfred Hughes f94ef9e300 Factoring out a helper function for line start positions 2019-01-21 01:02:30 +07:00
Wilfred Hughes 140ad392ab A function for colouring on a line-by-line basis 2019-01-21 00:38:53 +07:00
Wilfred Hughes 586842721d Make apply_color handle ranges that exceed the length of the string 2019-01-18 09:41:32 +07:00
Wilfred Hughes ed653c0b20 Factor out a diffs module 2019-01-15 09:54:45 +07:00
Wilfred Hughes 07e0774818 Basic context implementation 2019-01-15 09:44:57 +07:00
Wilfred Hughes 8823efa83c Remove debugging 2019-01-14 09:59:27 +07:00
Wilfred Hughes 6ff9764716 Add Language::from helper function 2019-01-14 09:59:04 +07:00
Wilfred Hughes 4971083c23 Move language detection and lexing to a separate module 2019-01-14 09:53:57 +07:00
Wilfred Hughes 9775bf9b60 Move lines functionality to a separate file 2019-01-14 01:13:40 +07:00
Wilfred Hughes 5f487211a7 WIP allow the user to specify context 2019-01-13 10:43:26 +07:00
Wilfred Hughes 33a6d189fe Define a LineNumber wrapper type 2019-01-12 15:10:06 +07:00
Wilfred Hughes c3fd6ab072 Factor out a range type 2019-01-12 13:37:36 +07:00
Wilfred Hughes 07b72c1ee6 Factor out a LineRange type 2019-01-12 01:28:42 +07:00
Wilfred Hughes 5bb9fca580 Get relative line length calculations passing 2019-01-11 09:50:24 +07:00
Wilfred Hughes ee4650b031 WIP line relative positions 2019-01-10 01:48:32 +07:00
Wilfred Hughes d763cf9c3b Drop trivia, fix start positions for lexing, and add test 2019-01-04 01:14:24 +07:00
Wilfred Hughes 8d0710d4f0 Use first class string offsets 2019-01-04 01:14:20 +07:00
Wilfred Hughes 79d32067f0 Infer file type from extension 2019-01-01 13:45:43 +07:00
Wilfred Hughes 71bc6a53c4 Pad to the terminal width if the files are narrower 2018-12-31 17:53:07 +07:00
Wilfred Hughes 958033924a Initial proof of concept 2018-12-29 15:29:42 +07:00