doc: clarify get_current_dir nil return and add Telescope recipe

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
This commit is contained in:
kubasync-clanker[bot] 2026-02-18 20:03:52 +00:00
parent f55b25e493
commit 1580de4c66
3 changed files with 79 additions and 4 deletions

View file

@ -87,6 +87,9 @@ M.posix_to_os_path = function(path)
if M.is_windows then
if vim.startswith(path, "/") then
local drive = path:match("^/(%a+)")
if not drive then
return path
end
local rem = path:sub(drive:len() + 2)
return string.format("%s:%s", drive, rem:gsub("/", "\\"))
else