lapce icon indicating copy to clipboard operation
lapce copied to clipboard

Arbitrary Editors diff Comparison

Open goyalyashpal opened this issue 2 years ago • 17 comments

Is your feature request related to a problem? Please describe.

Need to see the difference i.e. compare two arbitrary buffers - i.e. in full generality.

  • Buffers as it maybe unsaved new files too, not necessarily a saved file.
  • Arbitrary as I am talking in context of non-SCM or non-R/VCS

Use Cases

Based on https://github.com/lapce/lapce/issues/2136#issuecomment-1426859906 , here are some use cases:

  • compare dirty file (changes in editors) with saved file
  • compare 2 non-consecutive commits
  • compare modifications w.r.t. a refrence document - say the TA's provided answers

Describe the solution you'd like

Ability to select any two arbitrary editors in the "Open Editors" panel and "Compare selected".

This feature is available in VS Codium, Atom, Notepad++, doublecmd

Describe alternatives you've considered

The frontend is as simple as it can get, so, i don't think any alternates exist.

Additional context

  • https://github.com/lapce/lapce/issues/687#issuecomment-1426794223

goyalyashpal avatar Feb 11 '23 15:02 goyalyashpal

Here is the link to the plugin that made this work for Atom: https://github.com/mupchrch/split-diff

Jieiku avatar Feb 11 '23 18:02 Jieiku

Being open source, and source of inspiration for Lapce interface (i guess), here's links for development of compare view or difference editor in vs code:

  • Diff editor review pane (v1.14 2017-06)
  • Compare dirty file with version on disk (v1.15 2017-07)
  • Compare open file to Clipboard (v1.19 2017-11)
  • Multi select in the Explorer (v1.20 2018-01)
  • Timeline view (v1.54 2021-02)
  • Difference editor https://code.visualstudio.com/docs/editor/command-line#_core-cli-options

goyalyashpal avatar Feb 11 '23 19:02 goyalyashpal

I was marked as off topic, the requested feature here, is a plugin in Atom and that plugin was open source with MIT license (so possibly useful?)... I'm not sure how I was off topic... I get the feeling I'm not wanted here, so I will simply quit trying to help in this repository. I still hope Lapce is a blazing success but I won't bother wasting my time with bug reports or feature requests anymore. Going to find any threads Ive posted in this repository and unsubscribe because I can't bother taking the time to follow up on things if that's how its going to be handled.

Jieiku avatar Feb 12 '23 03:02 Jieiku

@dzhou121 and @bugadani you might want to review the way that @panekj is moderating people. good luck to you all and this repo.

Jieiku avatar Feb 12 '23 04:02 Jieiku

is a plugin in Atom and that plugin was open source with MIT license (so possibly useful?)... I'm not sure how I was off topic...

It's marked as off-topic because this is a Rust language codebase with completely different design, so I don't see how mentioning a plugin for another editor would help anyhow

panekj avatar Feb 12 '23 04:02 panekj

If you dont see how comparing similar features between other programs can be helpful, then I am really not sure what else to say... but like I said, I have unsubscribed from all my threads here, you won't have to deal with me anymore.

Jieiku avatar Feb 12 '23 04:02 Jieiku

you might want to review the way that @panekj is moderating people.

I'm not moderating people, I'm (trying) to moderate a bug tracker. I hide stuff that I think is not helpful and detracts from actual discussion

panekj avatar Feb 12 '23 04:02 panekj

hi @Jieiku , i can understand ur feelings...

i would say that

  • don't take it personally
  • he hides his own comments as offtopic too (see attached screenshot below)

a better way could just have been to raise an objection, something like: "hey, i think my comment is very relevant to this issue for source of inspiration. can u please unhide it"

Different people have different way of categorising things, and often times, conflcts arise... i'd say to take it easy.

  • Lots of things are happening all the times in issue trackers lol. people single handedly close ur issues or pulls as "fixed" when they are not or "discarded" without waiting for input from other side, or blatantly ignore ur input and don't consider it, etc etc.... Not to mention those rutheless stalebot horrors.

Better would be to stay lite and don't pile such meager things to heart.

goyalyashpal avatar Feb 12 '23 04:02 goyalyashpal

I also think that it's partially due to lack of features in issue trackers.... it's all just one linear comment mode here...

i always wanted different tabs or some way for moderators to club (group comments as related) in issues so,

  • "reproductions statuses" (for bugs),
  • "summary/conclusions" (youtrack from jetbrains has this pinned comment field for summaries by moderators),
  • "inspirations" (from other things)
  • "implementations" (how to get it actually for current software)
  • or custom ones

goyalyashpal avatar Feb 12 '23 04:02 goyalyashpal

Yes your right, for whatever reason it felt like a slap in the face and I just got off work. I did not realize they were marking their own posts like that too.... I can honestly say in my years of using github I have not seen it done that way, but there plenty of people more active on github than I am.

I apologize if I upset anyone, not my intention, we can end it with this... don't want to derail this feature request because it is a good one! @panekj again I apologize if I came off as harsh, I could have responded more calmly to my post being marked off topic.

Jieiku avatar Feb 12 '23 04:02 Jieiku

Now if we can hide all these as offtopic 😆🤣🤣 , just kiddin'

goyalyashpal avatar Feb 12 '23 04:02 goyalyashpal

No worries and I'm sorry too, it's just my habit from work :)

I can honestly say in my years of using github I have not seen it done that way

I know few projects but it's definitely very rare occurrence

panekj avatar Feb 12 '23 05:02 panekj

meanwhile, something similar to kate can be done - to pass both the selected files to some external tool like meld

goyalyashpal avatar Apr 02 '23 12:04 goyalyashpal

nothing beats being able to edit as you compare, I just launch the relevant files in Atom when I need to. (apparently meld allows you to edit? so maybe that would be neat)

Jieiku avatar Apr 02 '23 17:04 Jieiku

(apparently meld allows you to edit? so maybe that would be neat)

yep, it does :) and maybe as other alternates for default external diff-ers maybe proposed, here's more data which can help in comparisons.

  • meld v3.22.0 is licensed at GPL-v2, works on all major desktop os (using distributions or otherwise),
  • written in python, takes ~100 MiB space on windows 10, can be invoked via cli
  • it can compare files while supporting live edit in its own GUI, compare folders,
  • apply text filters (like comments etc for the languages it recognises),
  • export differences as patch
  • i don't think it provides any choice of which diffing algorithm is used. but that's just too nitty gritty of me

goyalyashpal avatar Apr 02 '23 17:04 goyalyashpal

  • I just today found that even VS Code has an extension for comparing via external comparison tools, and
  • i found it very helpful as i needed the diffs as patches, and the inbuilt diff of VSCode doesn't provide that.

Again, this goes on to reinforce that having this ability to diff with external dedicated tools is still required despite having inbuilt diffs - 'cz there's only so much stuff u can stuff inside/inbuilt - so, why not have it earlier ;)

Meld DIff Use meld (or other tools like WinMerge, Beyond Compare, ...) to compare files, folders, clipboard or git changes from visual studio code directly https://open-vsx.org/vscode/item?itemName=danielroedl.meld-diff

goyalyashpal avatar Apr 14 '23 16:04 goyalyashpal