Skip to content
  • Florian 
  • 5 min read

Edit comparisons on the fly in Kaleidoscope 4

(Part 2 of our series about the major new features in Kaleidoscope 4. See Part 1 to learn about the powerful new Text Filters.)

Quite a few users over the years have told us they need to be able to add new text into comparisons. 

You would start out comparing two inputs, such as two config files, looking at the exact differences, and you would end up wanting to choose a blend of the two inputs, and maybe even add some additional changes right on the spot. Ideally, you’d want to make those changes while looking at the comparison, not later on in a text editor.

So far that hasn’t been possible.

Real world use case: Trying to create a useful .gitignore file for our macOS development projects using both Swift and Objective-C. Here, we are starting with two templates from GitHub, one for Objective-C and one for Swift projects. Turns out there is content we don’t need in our case, the Accio section. On the other hand both samples are lacking entries for invisible files that macOS typically creates and that should not go into a git repository. So what we want here is a merge of those two files, while also removing some content and adding new content.

New Merge from Comparison

Kaleidoscope 4 adds that ability by allowing you to convert any comparison into a merge that can be edited. We added a new command to the Merge menu: New Merge from Comparison. Here’s how to use it.

You can start by comparing text in Kaleidoscope, by dropping files on Kaleidoscope Prism, or by just pasting from the clipboard. Note that you are not limited to two inputs if you have more than two that you’d like to compare. The File Shelf lets you quickly switch between inputs, so you can decide which combination works best as a starting point.

When you review the comparison, you might realize that neither input is exactly what you want, so copying changes between them won’t do the trick. Maybe one of the parts that you want to keep has a typo, for example. 

Now, in Kaleidoscope 4, you can select New Merge from Comparison, either via the main Merge menu or via the bottom toolbar. 

This presents you with a 3-way merge, where you now can choose parts from either A or B (including the standard Undo capabilities). You can also edit the middle column, and get the exact result you need. Note: the merge opens in a new tab in the same window, leaving the original comparison untouched, in case you want to refer to it while working on your result.

Continuing our use case: the new merge opened from the comparison depicted above. Now we can remove the Accio section and add useful entries to the bottom. We retrieved those from by entering macOS.

Once you are done with your text, you can either select the result and copy it back to the Clipboard, or you can save it to a new file.

Selecting File > Save (⌘S) or trying to close the window (⌘W) gives us the opportunity to save our new merge as a new file.

As we know from our customers, as well as in our own experience, the desire to edit a comparison is natural. We worked hard to make it simple to act on this impulse.

Starting merges from the app itself

You might want to merge two conflicting files that are not located in Git. Using these same steps, you can now do that too. For the first time, merges in Kaleidoscope can be opened directly, rather than only through the ksdiff command line tool.

A great example is consolidating changes from two versions of a text document, something we explored in our blog post introducing ksdiff. Instead of using ksdiff to consolidate two files with overlapping content into a third, clean file, you can now open the files directly from Kaleidoscope and then select Merge > New Merge from Comparison.

As always, we hope you like the changes we are making to Kaleidoscope. Let us know if you have a use case that Kaleidoscope does not yet cover. We are always planning what we will work on next. We’re also interested hearing about how Kaleidoscope improves your workflow. Feel free to email us with any comments and suggestions.