Skip to content

Conversation

abeldekat
Copy link
Member

Reference: This discussion

In my workflow, each project is opened in a tmux session. As such, when querying oldfiles, I am mostly interested in files inside the current working directory.

MiniExtra.pickers.oldfiles() currently does not filter on cwd

This PR adds flag "current_dir" to MiniExtra.pickers.oldfiles()

@abeldekat
Copy link
Member Author

abeldekat commented Jun 30, 2024

Remarks:

The name current_dir: Only the value of variable current_dir indicates that this is a boolean.

System call vim.loop.os_uname() is always executed, also when current_dir is not supplied.
Would this approach be appropriate?

@echasnovski echasnovski changed the base branch from main to extra-oldfiles-curdir June 30, 2024 11:32
@echasnovski echasnovski merged commit 521d3d9 into nvim-mini:extra-oldfiles-curdir Jun 30, 2024
@echasnovski
Copy link
Member

Thanks for the PR!

I appreciate the exact copy of the approach from 'mini.starter' (I'd usually do that too), however I think the better approach here is to use plain vim.startswith() with cwd .. '/'. As far as I remember, built-in paths coming from Neovim always use forward slash. If not, we'll wait for a Windows user to report.

I've merged in the temporary branch to polish up a bit.

@echasnovski
Copy link
Member

Thanks again for following through!

This should now be part of latest main.

@abeldekat
Copy link
Member Author

Thank you!

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

Successfully merging this pull request may close these issues.

2 participants