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

Toggle between diff preview and the actual state preview #46

Open
pksunkara opened this issue Mar 23, 2024 · 4 comments
Open

Toggle between diff preview and the actual state preview #46

pksunkara opened this issue Mar 23, 2024 · 4 comments
Labels
enhancement New feature or request

Comments

@pksunkara
Copy link

In the plugin https://github.com/jiaoshijie/undotree, I like how they show the actual state instead of diff. I would love to have the same here. I would want the following:

  • A configuration option that lets us select either the diff or the state
  • Additionally a toggle that switches between diff and the state.
@pksunkara
Copy link
Author

Forgot to mention, really appreciate the plugin. I am going to spend a bit of time later this week to figure out how we can better the experience when taking #40 into view and make sure this is the best plugin out there for this capability.

@debugloop
Copy link
Owner

I though about that for a bit, how would we make this truly useful? By default, that would just preview the same imports and stuff for each state, making this kinda useless especially on longer files, no?

If I grabbed a (first? last?) line number of change from the diff and scrolled there, what about if there are many changes? What does that other plugin do?

@pksunkara
Copy link
Author

I think there's some miscommunication. What I meant is to toggle between the diff and actual full content (current file - diff).

@debugloop
Copy link
Owner

I don't think there is. So assume you can toggle this now, do you think a view of the actual undo state's buffer contents starting at line 0 would be useful?

I personally don't think it would be, it's bound to be just some headers/imports/whatever visible on the previewer. So: If I scroll that preview somewhere else, where should it be? The location of the change in comparison to what? What if the change is very large (i.e. spans many lines), do I go to the first line affected? The last? The average of them, with might mean there is no changed content?

There's some thought to be put into this if I'm to cook this up, but I don't actually see how this should look like myself. In my mind, users open up this telescope and will either:

  1. Browse the tree until some 1-10 states upward to restore a diverged undo state.
  2. Start typing something from their head "I had this earlier but deleted it", find it and yank it.

What's the scenario where a view of a state's very first few lines helps?

@debugloop debugloop added the enhancement New feature or request label Jun 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants