Heuristic42
Blog
Opengl
Rendering
Meta
1
created
May 9 at 17:50
Weld Merge: GNOME Meld in Visual Studio Code
TL;DR: I forked Meld and put it in vscode! - https://github.…
–
pknowles
comment
Apr 24 at 1:47
Matching complex shapes for a custom keyboard in Fusion360
[deleted]
–
anonymous
created
Apr 7 at 1:56
How AI Presentation Tools Like Havi AI Are Transforming Visual …
In today’s fast-paced digital environment, creating visually co…
–
smithjemimaa
reverted
Mar 2 at 10:03
Why std::move and move semantics?
spam..
–
anonymous
edited
Mar 2 at 1:40
Watches
https://timepiecesunveiled.wordpress.com/ https://timepiecesun…
–
anonymous
comment
Feb 2 at 22:55
Calling Babel from Django for React+JSX
[deleted]
–
anonymous
comment
Jan 12 at 3:20
Matrices
[deleted]
–
anonymous
comment
Dec 19 '25
Matrices
[deleted]
–
anonymous
comment
Dec 16 '25
Making a real EMF Reader
Can you show us what the wires go to please.
–
anonymous
comment
Nov 10 '25
DerBard: Custom Split Mechanical Keyboard Prototype
Hi heuristic42.com Owner.
–
anonymous
comment
Nov 9 '25
Embedding GDB pretty printers, just like natvis
Hello 👋. Welcome 🙂
–
pknowles
comment
Nov 9 '25
Embedding GDB pretty printers, just like natvis
Hello heuristic42.com Administrator.
–
anonymous
edited
Oct 12 '25
Why std::move and move semantics?
For years C++ destructors felt like an academic solution that d…
–
pknowles
comment
Oct 12 '25
Clip Space
Thanks for the reminder. Please see [https://www.heuristic42.co…
–
pknowles
comment
Oct 10 '25
Contributing
I have bilateral carpel tunnel and my Microsoft 4k has a torn c…
–
anonymous
edited
Oct 5 '25
Pages About This Site
... in an effort to keep presented content and self discussion …
–
admin
created
Oct 5 '25
Privacy and Data Collection
This wiki stores a small amount of personal data to function an…
–
admin
comment
Sep 12 '25
Clip Space
Hello, We ran a 30-second scan of your domain and found: - …
–
anonymous
created
Jul 6 '25
Hello Ray, a Hello World Vulkan Ray Tracing Tutorial
\*WORK IN PROGRESS\* Want to do some quick 3D graphics progr…
–
pknowles
created
Jul 3 '25
Why std::move and move semantics?
A few years ago, I was fortunate enough to have Jon Kalb explai…
–
pknowles
edited
Jul 3 '25
3D Rendering (Computer Graphics)
Rendering in 3D computer graphics is computing a 2D image from …
–
pknowles
edited
Jul 3 '25
Heuristic42, A Graphics Programming Website
#[Blog](/blog/) An unstructured assortment of personal graph…
–
pknowles
edited
Jun 23 '25
RAII++ - the powerful implication of always initializing
If you search, most definitions of RAII refer to using "**scope…
–
pknowles
created
Jun 23 '25
RAII++ - the powerful implication of always initializing
If you search, most definitions of RAII refer to using "**scope…
–
pknowles
…
View All
Log in
Weld Merge: GNOME Meld in Visual Studio Code
leave this field blank to prove your humanity
Article title
*
Article revisions must have a non-empty title
Article body
*
TL;DR: I forked Meld and put it in vscode! - https://github.com/pknowles/weld-merge - https://marketplace.visualstudio.com/items?itemName=pknowles.meld-auto-merge - https://open-vsx.org/extension/pknowles/meld-auto-merge I love [meld merge](https://meldmerge.org/). It's simple, intuitive and does a remarkably better job at initial conflict resolution than any other tool I've used. You can even set it up with tabs for `base <-> local` and `base <-> remote` comparison is fantastic to see the intent of each branch before choosing what the merged result should look like. Here's my git config for that: ``` [diff] tool = meld_diff [difftool "meld_diff"] cmd = meld $LOCAL $REMOTE --output $MERGED [merge] conflictstyle = diff3 tool = meld_merge [mergetool] keepBackup = false [mergetool "meld_merge"] keepBackup = false cmd = meld --auto-merge $LOCAL $BASE $REMOTE --output=$MERGED --diff $BASE $LOCAL --diff $BASE $REMOTE ``` My biggest problem is when I want to handle merge conflicts remotely. Most of my time coding is now spent in vscode remote development over SSH, or a fork like `cursor` and `antigravity`. I then need to run meld on the remote machine. Using meld is still possible in some cases: - sshfs; run locally (sloow; linux only) - X forwarding (slooow; linux only) - VNC (sloow) - RDP (slow) Yes, AI can now resolve conflicts but I often want to do some myself or check up on what it's doing. In many cases the merge is easy and can actually auto-resolve with Meld's algorithms whereas the default resolution would fail. What I really want is meld but inside visual studio code with its implicit remote development support. A few months back I started work and the result is now live. It's currently in alpha, still with a few bugs. Check the readme and release version! You can install it already just by searching for **Weld Merge** in the extensions list. More instructions on [github.com/pknowles/weld-merge](https://github.com/pknowles/weld-merge). What follows is some cherry-picked dev log entries. As usual with AI it went fast at first, then slowed with features and finally went backwards as AI started adding more bugs than it was fixing. The issue was letting bad patterns fester due to not reviewing closely enough. Maybe one day we won't have to but until then AI has a lot of questionable code to learn on and unless it has clean examples in the same repo it *will* become an unmaintainable mess. ## VSCode and the CustomTextEditor VSCode doesn't allow direct extension of regular editor windows. Instead, they're written from scratch in a custom "webview" panel. Yes, this means Weld Merge has a full blob of the `monaco` text editor embedded in the extension. Maybe I could pull this out of vscode itself but I haven't figured that out yet. To make the webview panel behave like a regular text editor, vscode provides a [*custom editor*](https://code.visualstudio.com/api/extension-guides/custom-editors) API. This keeps all editors, or "views", of the backing `TextDocument` in sync. Now, I'd expect vscode to make this nice and easy for common use-cases, but to my surprise their [samples](https://github.com/microsoft/vscode-extension-samples/tree/main/custom-editor-sample) take a gigantic shortcut: the entire document contents is copied every time there is a change 🤯! Clearly the intent of the API is to pass incremental updates of changes, but there is no sample code and I have not been able to find a single example of someone doing this correctly online. OK. I'll have to do it myself... TODO (the code is written so if you need answers quickly there are comments describing what I came up with) ## Restoring Git Merge Conflicts It's fairly common to finish resolving merge conflicts and realise you messed up. E.g. when you run tests before `git rebase --continue`. At this point you want to go back to the 3-way merge editor and fix your mistake, but the file is already resolved with the new content. What do you do? ``` git checkout -m path/to/file ``` Nice and easy. Don't forget to `git rerere forget` if you already recorded the resolution during a rebase. One problem for the Weld Merge UI however is that after resolving conflicts and staging the file there is no way to ask git which files were originally conflicted, the user can be presented with a list and a button to restore the conflict. The workaround currently used is: *Scrape `.git/MERGE_MSG` for the `# Conflicts:` block. Eek. It's not pretty but it works for now.* Another problem: what if the conflict is a file "deleted by us/them"? What if the conflict is a submodule? `git checkout -m` does not work in these cases. For these, we have to understand how git actually records conflicts, where you see "both modified" in the status for example. TODO
Toggle Preview
Edit message
*
A description of the changes made
Discard Draft
Save Draft
leave this field blank to prove your humanity
Flag
the thing you clicked
for moderator attention.
Reason choice:
Spam, promoting, advertising without disclosure
Rude, inappropriate, generally offensive
Too arrogant or demeaning to others
Other
Reason:
The reason for raising the flag
Error