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

[Bug] Changed code shown as removed and created #526

Open
franroa opened this issue Aug 19, 2024 · 0 comments
Open

[Bug] Changed code shown as removed and created #526

franroa opened this issue Aug 19, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@franroa
Copy link

franroa commented Aug 19, 2024

Description

I have commented out my code and in the diff view it shows as if I would have created new code

Expected behavior

What I have expected is what I see on git delta command:

diffview2

Actual behavior

diffview1

Steps to reproduce

  1. I am not sure if this is a isolated case or if that is repeteable, but..
  2. Remove a piece of code before changing other piece right down

Health check

Output of :checkhealth diffview
==============================================================================
diffview: require("diffview.health").check()

Checking plugin dependencies ~
- OK nvim-web-devicons installed.

Checking VCS tools ~
- The plugin requires at least one of the supported VCS tools to be valid.
- OK Git found.
- OK Git is up-to-date. (2.34.1)
- WARNING Configured `hg_cmd` is not executable: 'hg'

Log info

Relevant info from :DiffviewLog
[INFO  2024-08-19 09:01:49.388 +0200] ...local/share/nvim/lazy/diffview.nvim/lua/diffview/job.lua:342: Retry was successful!
[INFO  2024-08-19 09:01:49.613 +0200] ...iffview.nvim/lua/diffview/scene/views/diff/diff_view.lua:488: [DiffView] Completed update for 22 files successfully (270.139 ms)
[INFO  2024-08-19 09:01:49.643 +0200] ...iffview.nvim/lua/diffview/scene/views/diff/diff_view.lua:488: [DiffView] Completed update for 22 files successfully (426.663 ms)
[INFO  2024-08-19 09:01:50.542 +0200] ...iffview.nvim/lua/diffview/scene/views/diff/diff_view.lua:488: [DiffView] Completed update for 21 files successfully (177.624 ms)
[INFO  2024-08-19 09:01:51.386 +0200] ...iffview.nvim/lua/diffview/scene/views/diff/diff_view.lua:488: [DiffView] Completed update for 21 files successfully (58.466 ms)
[INFO  2024-08-19 09:09:48.632 +0200] ...local/share/nvim/lazy/diffview.nvim/lua/diffview/lib.lua:24: [command call] :DiffviewOpen 
[INFO  2024-08-19 09:09:48.782 +0200] ...iffview.nvim/lua/diffview/scene/views/diff/diff_view.lua:488: [DiffView] Completed update for 2 files successfully (41.658 ms)
[INFO  2024-08-19 09:10:05.893 +0200] ...local/share/nvim/lazy/diffview.nvim/lua/diffview/lib.lua:24: [command call] :DiffviewOpen 
[INFO  2024-08-19 09:10:06.220 +0200] ...iffview.nvim/lua/diffview/scene/views/diff/diff_view.lua:488: [DiffView] Completed update for 434 files successfully (271.324 ms)
[INFO  2024-08-19 09:14:08.996 +0200] ...local/share/nvim/lazy/diffview.nvim/lua/diffview/lib.lua:24: [command call] :DiffviewOpen 
[INFO  2024-08-19 09:14:09.250 +0200] ...iffview.nvim/lua/diffview/scene/views/diff/diff_view.lua:488: [DiffView] Completed update for 434 files successfully (191.822 ms)
[INFO  2024-08-19 09:21:22.455 +0200] ...local/share/nvim/lazy/diffview.nvim/lua/diffview/lib.lua:24: [command call] :DiffviewOpen 
[INFO  2024-08-19 09:21:22.688 +0200] ...iffview.nvim/lua/diffview/scene/views/diff/diff_view.lua:488: [DiffView] Completed update for 434 files successfully (152.539 ms)
[INFO  2024-08-19 09:35:47.380 +0200] ...local/share/nvim/lazy/diffview.nvim/lua/diffview/lib.lua:24: [command call] :DiffviewOpen 
[INFO  2024-08-19 09:35:47.669 +0200] ...iffview.nvim/lua/diffview/scene/views/diff/diff_view.lua:488: [DiffView] Completed update for 434 files successfully (206.686 ms)
[INFO  2024-08-19 09:37:03.477 +0200] ...local/share/nvim/lazy/diffview.nvim/lua/diffview/lib.lua:24: [command call] :DiffviewOpen 
[INFO  2024-08-19 09:37:03.774 +0200] ...iffview.nvim/lua/diffview/scene/views/diff/diff_view.lua:488: [DiffView] Completed update for 434 files successfully (239.894 ms)
[INFO  2024-08-19 09:46:46.186 +0200] ...local/share/nvim/lazy/diffview.nvim/lua/diffview/lib.lua:24: [command call] :DiffviewOpen 
[INFO  2024-08-19 09:46:46.480 +0200] ...iffview.nvim/lua/diffview/scene/views/diff/diff_view.lua:488: [DiffView] Completed update for 434 files successfully (231.630 ms)

Neovim version

NVIM v0.11.0-dev
Build type: RelWithDebInfo
LuaJIT 2.1.0-beta3

Operating system and version

Linux 5.15.153.1-microsoft-standard-WSL2 x86_64 GNU/Linux

Minimal config

-- #######################################
-- ### USAGE: nvim --clean -u mini.lua ###
-- #######################################

local root = vim.fn.stdpath("run") .. "/nvim/diffview.nvim"
local plugin_dir = root .. "/plugins"
vim.fn.mkdir(plugin_dir, "p")

for _, name in ipairs({ "config", "data", "state", "cache" }) do
  vim.env[("XDG_%s_HOME"):format(name:upper())] = root .. "/" .. name
end

local plugins = {
  { "nvim-web-devicons", url = "https://github.com/nvim-tree/nvim-web-devicons.git" },
  { "diffview.nvim", url = "https://github.com/sindrets/diffview.nvim.git" },
  -- ##################################################################
  -- ### ADD PLUGINS THAT ARE _NECESSARY_ FOR REPRODUCING THE ISSUE ###
  -- ##################################################################
}

for _, spec in ipairs(plugins) do
  local install_path = plugin_dir .. "/" .. spec[1]
  if vim.fn.isdirectory(install_path) ~= 1 then
    if spec.url then
      print(string.format("Installing '%s'...", spec[1]))
      vim.fn.system({ "git", "clone", "--depth=1", spec.url, install_path })
    end
  end
  vim.opt.runtimepath:append(spec.path or install_path)
end

require("diffview").setup({
  -- ##############################################################################
  -- ### ADD DIFFVIEW.NVIM CONFIG THAT IS _NECESSARY_ FOR REPRODUCING THE ISSUE ###
  -- ##############################################################################
})

vim.opt.termguicolors = true
vim.cmd("colorscheme " .. (vim.fn.has("nvim-0.8") == 1 and "habamax" or "slate"))

-- ############################################################################
-- ### ADD INIT.LUA SETTINGS THAT ARE _NECESSARY_ FOR REPRODUCING THE ISSUE ###
-- ############################################################################

print("Ready!")
@franroa franroa added the bug Something isn't working label Aug 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant