Code Monkey home page Code Monkey logo

Comments (2)

wincent avatar wincent commented on June 14, 2024

Thanks for the report!

Definitely not by design, but it's a consequence of this logic in the buffer finder:

  • List all buffers with vim.api.nvim_list_bufs()
    • For each buffer, check it is loaded with vim.api.nvim_buf_is_loaded(); if it is:
      • Get the name with vim.api.nvim_buf_get_name(); and:
      • Turn it into a relative path with vim.fn.fnamemodify().

So, the intent of the nvim_buf_is_loaded check is to skip over "unloaded" buffers, which can cause problems. The api-buffer docs say this about unloaded buffers:

Unloaded Buffers: ~

Buffers may be unloaded by the |:bunload| command or the buffer's
|'bufhidden'| option. When a buffer is unloaded its file contents are
freed from memory and vim cannot operate on the buffer lines until it is
reloaded (usually by opening the buffer again in a new window). API
methods such as |nvim_buf_get_lines()| and |nvim_buf_line_count()| will be
affected.

I'm concerned that if I remove the nvim_buf_is_loaded check I'll wind up introducing a regression; but I didn't have this kind of thing in the Ruby version (the scanner was just parsing :ls output), so this code is pretty new (added in 0b8c9ed, "feat(lua): continue sketching out UI", July 20, 2022).

I can certainly play around with removing it, and if I can't do that, I might be able to do some special-casing to detect when Neovim has just launched and skip the check in that case...

from command-t.

jaapie avatar jaapie commented on June 14, 2024

Thanks @wincent that's fixed it for me! I appreciate your efforts.

from command-t.

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.