diffview.nvim icon indicating copy to clipboard operation
diffview.nvim copied to clipboard

How to edit files on the right side when using DiffviewOpen origin/master...HEAD

Open kanishkave opened this issue 1 year ago • 1 comments

Hey, Thank you for the great plugin and i apologize if this question has already been asked but say for example i open DiffViewOpen origin/master...

this shows me all the changes on my branch. now if i want to undo some changes I Just want to go to the right side file panel and make my changes but then it says modifiable is off which makes sense. So I use <C-w><C-f> to go to the file and then make my changes. now when i come back the diff view doesn't update and it still shows up the original change which I just undid. Do you understand what I am saying?

Screenshots:

image

now if i go to main.py and undo the print statement image

it still shows up as if i still have it image

is there a way i can get diff between origin/master and current uncommitted changes? thank you for your help

kanishkave avatar Aug 29 '24 18:08 kanishkave

Little late to the party here. Hope you figured it out! Here's how it's done, for anybody else looking. This will allow you to edit the local file directly in the right window, with LSP assistance (if you have it set up). Use :DiffviewOpen origin/master...HEAD --imply-local You can set it to default to the behavior by adding this to the Diffview config: default_args = { DiffviewOpen = { "--imply-local" }, },

Kortantic avatar Sep 18 '24 22:09 Kortantic