doc: clarify get_current_dir nil return and add Telescope recipe#727
Open
harivansh-afk wants to merge 1 commit into
Open
doc: clarify get_current_dir nil return and add Telescope recipe#727harivansh-afk wants to merge 1 commit into
harivansh-afk wants to merge 1 commit into
Conversation
Expand get_current_dir docs to explain when nil is returned (non-oil buffer, non-files adapter, buffer context change). Add inline code examples showing the capture-before-call pattern for Telescope keymaps. Update the existing Telescope keymap example in oil.txt to guard against nil. Add a dedicated Telescope recipe in recipes.md with find_files and live_grep examples. Add a defensive nil guard in posix_to_os_path for edge-case Windows paths where the drive letter match fails. Closes stevearc#682
barrettruth
added a commit
to barrettruth/canola.nvim
that referenced
this pull request
Feb 20, 2026
Problem: get_current_dir returns nil in several cases that were not documented, causing confusion when used in keymaps that open pickers like Telescope (stevearc#682). Also, posix_to_os_path could crash on Windows when no drive letter is found. Solution: expand get_current_dir docs to explain nil return cases, add a Telescope recipe with nil guards, and add a defensive nil check in posix_to_os_path. Cherry-picked from: stevearc#727
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Expand get_current_dir docs to explain when nil is returned (non-oil buffer, non-files adapter, buffer context change). Add inline code examples showing the capture-before-call pattern for Telescope keymaps.
Update the existing Telescope keymap example in oil.txt to guard against nil. Add a dedicated Telescope recipe in recipes.md with find_files and live_grep examples.
Add a defensive nil guard in posix_to_os_path for edge-case Windows paths where the drive letter match fails.
Closes #682