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

feat: do not close preview when cd into dir #277

Merged
merged 7 commits into from
Jan 22, 2024

Conversation

lucaseras
Copy link
Contributor

@lucaseras lucaseras commented Jan 8, 2024

Implements #236

Hi there! I'm a first-timer in this repo, so apologies in advance if I've missed any process for contributing

This setup has been working locally for me, so I decided to push up for some feedback, thanks in advance!

Also happy to add this to config, in case people would rather keep the existing behavior

Copy link
Owner

@stevearc stevearc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for putting up a PR! Left some comments about a few things to explore

lua/oil/init.lua Outdated Show resolved Hide resolved
lua/oil/init.lua Outdated Show resolved Hide resolved
lua/oil/view.lua Outdated Show resolved Hide resolved
@github-actions github-actions bot requested a review from stevearc January 18, 2024 03:17
lua/oil/init.lua Outdated Show resolved Hide resolved
@lucaseras
Copy link
Contributor Author

lucaseras commented Jan 18, 2024

This new implementation has a problem where sometimes opening a folder this happens:
image
The entry ids are shown next to the icons. I couldn't quite figure out why this is happening — any ideas?

Copy link
Owner

@stevearc stevearc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested it out and it's looking good! Just one small bug to fix and one question

lua/oil/init.lua Outdated Show resolved Hide resolved
lua/oil/init.lua Outdated

if not opts.preview and preview_win and entry_is_file then
vim.api.nvim_win_close(preview_win, true)
vim.api.nvim_set_current_win(prev_win)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this line necessary? Is it possible that the cursor has changed windows between line 533 and here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point, yeah I think we can remove that line — the only case where the current window changes is if opts.preview

@github-actions github-actions bot requested a review from stevearc January 21, 2024 23:24
@lucaseras
Copy link
Contributor Author

Sweet, pushed the changes! Also, is this also happening on your end?

@stevearc
Copy link
Owner

I'm not seeing that issue. It looks to me like the conceallevel isn't being set? Possibly something is interfering with the window options. If you can get a repro LMK and I might be able to look into it.

Thanks for working with me on the PR! I think this is a great addition to oil.

@stevearc stevearc merged commit bf753c3 into stevearc:master Jan 22, 2024
8 checks passed
@mehalter
Copy link
Contributor

@stevearc @lucaseras I also just tried this out and I do get that bug that was mentioned with the entry ids appearing. It seems to only appear on the current line and doesn't happen for every folder. Still working on reproducing in a minimal environment, but just wanted to give a heads up that something is going on here. It looks like conceallevel should be getting set to 3 but is set to 2 in my case (which is what I have it set to in my normal vim options, so maybe it's just not getting set at all to 3 rather than getting overridden).

@mehalter
Copy link
Contributor

Ah I can replicate it extremely easily. Opened a new issue! #287

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants