Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature request: Compare two no-file buffer #26

Closed
4goodapp opened this issue Jan 19, 2020 · 15 comments
Closed

Feature request: Compare two no-file buffer #26

4goodapp opened this issue Jan 19, 2020 · 15 comments

Comments

@4goodapp
Copy link

I used this service to compare two text sometimes: https://text-compare.com
Is it posible to have option to open vdiff, ready to receive two text?
The current implementation require you to create two tmp buffer for that which isn't just quick.

@justbur
Copy link
Owner

justbur commented Jan 19, 2020

You want a function for vdiff that creates two buffers to paste text into?

@4goodapp
Copy link
Author

Yes, Exactly.
something like this ready to receive texts from lets say, clipboard
Screen Shot 2020-01-20 at 19 19 16

@edkolev
Copy link
Contributor

edkolev commented Jan 20, 2020

A wrapper like vim's linediff might make sense https://github.com/AndrewRadev/linediff.vim

Sorry for tailgating another feature request I would like to discuss - would it be simple to support diff-ing narrowed buffers? I could do a PR, as long as there isn't a conceptual issue with this approach.

@4goodapp
Copy link
Author

Yes, something like that exactly 😀.

diff-ing narrowed buffers

Sorry I don't understand what you mean here.

@4goodapp
Copy link
Author

However, The two texts (to compare) don't necessarily need to come from Emacs or an open file itself. It may just come from code I copied from let's Chrome web browser.

@justbur
Copy link
Owner

justbur commented Jan 21, 2020

Would the buffers be deleted by default or kept by default? Would you want to name the buffers or give them a temporary name?

@4goodapp
Copy link
Author

I think a temporary name would be OK, left right, text 1 - text 2, or just whatever you may think fit better. by default of course. Maybe add options to rename them.

Would the buffers be deleted by default or kept by default?

Not sure what you mean here.

@justbur
Copy link
Owner

justbur commented Jan 21, 2020 via email

@4goodapp
Copy link
Author

Yeah, why not. at least, by default yeah. Maybe not. I don't know... Chose the best, am fine with both 🙂.

@justbur
Copy link
Owner

justbur commented Feb 14, 2020

try vdiff-temp-files on master

@4goodapp
Copy link
Author

4goodapp commented Feb 15, 2020

@justbur
Hello, Sorry for the delay,
Thank you very much for implementing this feature
I just test it and here is my thoughts:

When it comes to layout It works perfectly.
the auto scroll on both buffer is nice too, I didn't expect that one.

Now about the colors, Am little confused.
Like It's easy to see line that doesn't exist on the other side with the red dashes -----------
howerver on line with different text, only the color change.
An ideal solution would be to use different background to highlight the differences like in this example:

Screen Shot 2020-02-15 at 19 33 27

instead of just changing the color like in the current implementation:

Screen Shot 2020-02-15 at 20 01 06

@justbur
Copy link
Owner

justbur commented Feb 15, 2020

The colors used are not set by this package. Their set by the theme you are using.

@4goodapp
Copy link
Author

Hello,
vdiff-temp-files isn't available on Melpa yet.

@justbur
Copy link
Owner

justbur commented May 19, 2020

It's been there since February. I just downloaded it again. Maybe you pinned it?

@4goodapp
Copy link
Author

That's weird, I just try again but M-x vdiff-temp-files doesn't show nothing...
I remember it was working back in february.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants