Coder Social home page Coder Social logo

Comments (3)

sindrets avatar sindrets commented on May 9, 2024

The file entry structure existed before the API, but some things were changed during that time.

The error seems to occur because the winnr is somehow invalid, which seems strange because I validate and restore the window layout if it's broken before loading buffers. What is even stranger is that the error indicates that the winnr is neither a number nor a string, but it's still able to be concatenated with the lua string in this line:

vim.cmd(winnr .. "windo filetype detect")

This is very difficult to fix without a reproducible scenario, it would be very helpful if you could provide a tarball of a git repo and a commit SHA where this happens.

Otherwise could you at least show the output after you get the error, having applied this patch:

diff --git a/lua/diffview/file-entry.lua b/lua/diffview/file-entry.lua
index 67fca87..246b3ae 100644
--- a/lua/diffview/file-entry.lua
+++ b/lua/diffview/file-entry.lua
@@ -130,6 +130,7 @@ function FileEntry:load_buffers(git_root, left_winid, right_winid)
         table.insert(self.created_bufs, bn)
         a.nvim_win_set_buf(split.winid, bn)
         split.bufid = bn
+        print(vim.inspect(winnr), split.winid, a.nvim_win_is_valid(split.winid), vim.inspect(a.nvim_tabpage_list_wins(0)))
         vim.cmd(winnr .. "windo filetype detect")
       end

This might at least help figure out what's going on with the winnr.

from diffview.nvim.

akinsho avatar akinsho commented on May 9, 2024

@sindrets will try and get the output for you 👍🏾 it could very well be something strange on my system or config since it seemed to happen regardless of the repository. But I'll dig in and feedback.

from diffview.nvim.

akinsho avatar akinsho commented on May 9, 2024

Not sure if this was spurious or due to some config changes I made on my system or what but I haven't been able to reproduce this so I'm going to close this for now as a fluke. If it recurs I'll post back here but it hasn't so far (I mess around with my config a lot so could very easily have been something I did)

from diffview.nvim.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.