-
Notifications
You must be signed in to change notification settings - Fork 170
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
lua/fzf-lua/win.lua:296: attempt to index a nil value on master #59
Comments
You are correct, the new window requires all 8 border chars as it draws the border manually, I fixed the Alternatively you can go back to the old previewer by setting |
Just tested it and I have a question for you: with the new built in previewer where the preview window is a separate window - does it even make sense to have no border? It looks so weird and not intuitive UI at all. I can make the no border apply to the fzf window and keep the border for the preview window (especially important since it has title/scrollbar as well as an option to expand in size) but then again it looks quite awful. If you give me some input on what is the look you’re after (with the the builtin previewer) I’ll do my best to accommodate while keeping it usable. |
Should be fixed in the latest commit, the way it works is as follows: The winopts = {
win_border = { ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ' }
} Note that by default the builtin previewer will also draw a title and scrollbar so you might want to get rid of those as well by setting: previewers = {
builtin = {
title = false,
scrollbar = false,
}
} |
I have the same issue but for a different reason, I use a tool to encrypt some files in my dotfiles repo. Right now it prints some warnings that I can't suppress. elasticdog/transcrypt#55 So the split call here will return a list with a single item Line 97 in 2315413
nil Line 98 in 2315413
Line 98 in 2315413
1 and only set diff_files if the condition is true.
|
I see, is there anyway I can reproduce this myself and maybe come up with a more robust regex as a solution? Btw, this has no relation to this issue, this bug only affects the git icons and wasn’t introduced with the latest commit, maybe it’s better we open a new issue for this? |
I think you can set up a demo git repo & set up For regex, I think a good start maybe would be something like this
I posted it here because I had the same exact error at nearly the same line too |
First, thank you very much for the quick fix. Second, sorry for my bad report, I guess I was misusing it. I didn't realize the default previewer had changed! I agree it doesn't make sense to have no border with the built-in previewer. For now I changed the default to bat, but I'll give the new previewer a shot too! :D |
Let me know what you think, since the |
Tysm for the info I’ll do some testing and update you, I still believe the two issues are unrelated, can you let me know if you’re still getting this error (you shouldn’t) and if not open a new issue just for good measure? |
Just tried it and it looks great! I guess one thing that I'm missing is the ability to highlight the line in the preview (for example when using grep or lsp_references). Do I need to use some special highlight group? |
Sorry just read the docs and saw that I just tried it with buffers and it looks much better! Will definitely change the default once |
Range would be when a match range was found (perhaps just for LSP ranges?), for now the line is highlighted using the default For reference, check out the below screenshot, the highlighted line (black bg) should be the grep/rg search match and if a column is specified and is > 1, the cursor will also be highlighted (light blue bg, column 7) on the right side. Note that the left line (247) doesn’t match the preview line (343) because I scrolled down inside the preview using |
Ohhh I see. The problem is that I had |
Definitely, the preview window has it’s own set of curated window options, I’ll add this option later so it’s always visible as well as the option to change its highlight. Edit: unfortunately I need to head out, I’ll make sure this is added tonight and post here once I do. Edit 2: technically what you’re asking is already possible using the deprecated setting winopts = {
window_on_create = function() vim.cmd(“setlocal cursorlineopt=both”) end
} |
No rush! Thanks for the quick interactions! I sent #61 defining the option :D |
FYI, the latest commit added the option to set the highlight for the CursorLine, take a look at |
I believe this was introduced on eefed45, likely because I'm customizing winopts here: https://github.com/fsouza/dotfiles/blob/85d807163e0b380ddc067c9d170c29f39de95817/nvim/lua/fsouza/fzf-lua.lua#L63
I'll try to send a PR fixing it later 😁
The text was updated successfully, but these errors were encountered: