Skip to content

Conversation

@joshw1013
Copy link

@joshw1013 joshw1013 commented Jan 3, 2026

Description

This is where the bug is

if path ~= vim.fs.normalize(vim.api.nvim_buf_get_name(buf)) then
   return
end

In the current code, if you open up a file whose path is a symlink (inside of Neovim not from the terminal), the path variable gets the symlink path, while the vim.api.nvim_buf_get_name(buf) returns the target path. This causes a mismatch making the program mistakenly return.

The fix just uses vim.uv.fs_realpath(path) to translate it to the target path

Example

This is my debugging messages after fixing it for the case that was causing me trouble

path    : /var/folders/dc/6mmnz_w549n7k146r10rsqfr0000gn/T/sourcekit-lsp/GeneratedInterfaces/SwiftUI.swiftinterface
buf name: /private/var/folders/dc/6mmnz_w549n7k146r10rsqfr0000gn/T/sourcekit-lsp/GeneratedInterfaces/SwiftUI.swiftinterface
Big file detected `/private/var/folders/dc/6mmnz_w549n7k146r10rsqfr0000gn/T/sourcekit-lsp/GeneratedInterfaces/SwiftUI.swiftinterface`.
Some Neovim features have been **disabled**.

@github-actions github-actions bot added bigfile size/xs Extra small PR (<3 lines changed) labels Jan 3, 2026
@joshw1013 joshw1013 changed the title Fix(bigfile): Fix bigfile detection with symlinks fix(bigfile): Fix bigfile detection with symlinks Jan 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bigfile size/xs Extra small PR (<3 lines changed)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant