Giter Site home page Giter Site logo

swapdiff's People

Contributors

dependabot[bot] avatar j4k0xb avatar shalimski avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Forkers

j4k0xb

swapdiff's Issues

Swap for Comparing File with Clipboard

I'd like to be able to swap diff views between a file and the clipboard

Steps taken:

  1. I have an open file
  2. I have some content in my clipboard
  3. Run File: Compare Active File with Clipboard
  4. Run Swap diff documents
  5. I get Nothing to swap :(

The use case I have here is I have chatGPT helping me with writing small scripts, and as I get it to output different versions of the code I want to make sure it isn't making modifications elsewhere where I don't see them. Currently, this works but the new version - which is in my clipboard - is displayed on the left pane and I want it on the right pane

need to swap color highlights along with swapping files

VSCode assumes the paradigm that the first file (left panel) is the "older" one in the comparison and the second file (right panel) is the "newer" one - hence marking with color highlights red for "removed" code and green for "added" code.
This paradigm applies both when you manually select 2 files to compare (in specific order first+second) and when you show CVS changes where the first file is read-only instance from a remote repository and the second file is your local copy. So to speak, the red<->green highlights resemble the direction in which the changes are applied.

My long time dev experience made a habit and mindset of mine to expect seeing my pending changes on the left panel and checking them against the right file panel which is the read-only base from the repo. The other way around is really confusing and inconvenient for me. So I really appreciate having the option to swap views, which VSCode should absolutely provide itself !!!

But while swapping both files works fine along with their read-only attribute, it keeps the red highlight on the left and the green on the right. And swapping the files without swapping their color highlights actually leads to even more confusion (as it breaks the perception of the direction of changes) than it takes to flip my mind and wrap it around the assumption that the views are always ordered "(left) old file<->new file (right)"

So pls, consider swapping the color highlights as well (if possible at all?).
Keep up the good work!
Salute

Can't swap temporary unsaved documents

After #3 was fixed, you can now only swap two documents if they have been saved as files. A new, unsaved document doesn't get recognized as a document to swap. If you open two new untitled documents, put some text in them, and compare them, then you can't swap the diff.

Can't swap when the output pane is also open

It seems that the Output, Problems, and Debug Console panels at the bottom of the screen are considered "editors" by VS Code. So when you have one of them open, it gets counted in vscode.window.visibleTextEditors. This causes the error message "More than 2 visible files, can`t swap it :(" and prevents me from swapping a diff while I have one of those panels open.

Edit: If I disable all other extensions besides swapdiff, it works in the Debug Console and the Problems panel but still not in the Output panel.

Seemingly related:
microsoft/vscode#45188
microsoft/vscode#58869
https://stackoverflow.com/questions/60235689/how-to-distinguish-output-panel-from-other-activetexteditor

Could you publish the extension on Open VSX?

Hi, I'd like to try out the extension, but I'm using VSCodium, which doesn't have access to the VSCode Marketplace. If you could publish to Open VSX, I would appreciate it, and I'm sure many others using Codium would too :)

The publishing process is documented in the Open VSX Wiki. For more info on Open VSX, see this article.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.