sindrets / diffview.nvim

Single tabpage interface for easily cycling through diffs for all modified files for any git rev.
Other
3.57k stars 101 forks source link

Not reset, i.e. preserve your cursor position/folds when switching Tabs #457

Open mangelozzi opened 5 months ago

mangelozzi commented 5 months ago

Description

Annoying behavior of loosing your place when trying to copy multiple lines between a previous vesion of a file, and the current file. One has to keep finding the place where one was when switching between tabs, because DiffView does not keep track of where it was (or is forcing a reset).

Expected behavior

Preserve state when one switchs to a different tab and comes back.

Actual behavior

It resets/restart sitself just because I viewed a different Tab

Steps to reproduce

  1. Say you open DiffviewFileHistory %
  2. You remove all folds (zR)
  3. Scroll to the lines you are interested in.
  4. Copy a line of text
  5. Go back to the buffer you working on, i.e. gt -> goto next tab
  6. Paste the line, now gt to return to DiffView
  7. Boom diff view has reset itself, now repeat, steps 1 to 3 to try find where you were

Health check

N/A

Log info

Relevant info from :DiffviewLog ``` ############################ ### PUT LOG CONTENT HERE ### ############################ ```

Neovim version

NVIM v0.10.0-dev-fcfc87c
Build type: RelWithDebInfo
LuaJIT 2.1.1695266395

Operating system and version

Linux 6.2.0-39-generic x86_64 GNU/Linux

Minimal config

No response

tmillr commented 1 week ago

It does some kind of reset on TabLeave I believe. It is very annoying and I don't understand the point. It ruins my custom winhl settings as well.