Comments (3)
@Wilfred has there been any progress on your thinking about this ? (sorry for the necrobump)
from difftastic.
This is definitely I'm interested in future, but it's too early right now. The API is still changing a lot as I figure out how make a design that actually works.
from difftastic.
@luzpaz I was the person who made the reqeust over at GNOME. https://gitlab.gnome.org/GNOME/meld/-/issues/756
I noticed this PR that adds a library interface, though that has not been looked at for well over a year. I guess this makes sense as it's not worth publishing an API for a moving target.
Perhaps there is another, simple way to add difft as a backend to meld?
There is a feature (experimental) where difftastic emits a simple json file with the --display <MODE>
option.
Could that be used with a temp file, named pipe or Bekeley socket until there is a more direct interface?
Example below...
Note this was generated a file with few characters (~15) and a tiny change. I am wondering if JSON is the best way to communicate that change information? For a large file the diff data could be massive. There are binary alternatives for arbitrary data serialisation that would be more efficient. e.g. Apache Thrift? Or maybe do it live with a socket and a virtual cursor - next/prev/print/count etc that would mean far less data to transfer.
before (lhs comma rhs)
-> [(lhs) comma rhs]
after
DFT_UNSTABLE=yes target/debug/difft \
--display json \
sample_files/change_outer_before.el \
sample_files/change_outer_after.el
{
"chunks": [
[
{
"lhs": {
"line_number": 0,
"changes": [
{ "start": 0, "end": 1, "content": "(", "highlight": "delimiter" },
{ "start": 14, "end": 15, "content": ")", "highlight": "delimiter" }
]
},
"rhs": {
"line_number": 0,
"changes": [
{ "start": 0, "end": 1, "content": "[", "highlight": "delimiter" },
{ "start": 1, "end": 2, "content": "(", "highlight": "delimiter" },
{ "start": 5, "end": 6, "content": ")", "highlight": "delimiter" },
{ "start": 16, "end": 17, "content": "]", "highlight": "delimiter" }
]
}
}
]
],
"language": "Emacs Lisp",
"path": "sample_files/change_outer_after.el",
"status": "changed"
}
from difftastic.
Related Issues (20)
- A temporary typo squating of the `difft` crate
- Whitespace not ignored in HTML
- Feature request: Exclude files and subdirectories matching patterns
- Update to latest FxHash when it's released
- Wrong diff highlights for a lot of unchanged lines HOT 2
- update LaTeX parser
- Build Failed in old MacOS version
- Comparing two completely different files is going to panic
- [Feature Request] Minimal diffs of comments and strings.
- [RHEL-8] difft: /lib64/libc.so.6: version `GLIBC_2.29' not found (required by difft) HOT 1
- crash when diffing files HOT 1
- pipe to PAGER lost syntax highlighting HOT 1
- Removals shown as red, but additions are not colored HOT 2
- [Feature Request] Saved Sessions HOT 1
- [Feature Request] Nvim Plugin
- Benchmark -C target-cpu=native in release binaries
- multi-line perl within bash confuses difft
- Incorrect 'permissions changed' output on macOS HOT 3
- Consider assuming that line numbers are at least two digits HOT 1
- Panic in line-numbers-0.3.0/src/lib.rs:105:13 HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from difftastic.