Skip to content

Commit

Permalink
fix(telescope): doc and check select is nil
Browse files Browse the repository at this point in the history
  • Loading branch information
bingcoke authored and NTBBloodbath committed Feb 12, 2024
1 parent de3c0fd commit e862e72
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -192,13 +192,13 @@ request method (e.g. `GET`) and run `rest.nvim`.
Run `export DEBUG_PLENARY="debug"` before starting nvim. Logs will appear most
likely in ~/.cache/nvim/rest.nvim.log

## Telescope
## Telescope Extension

```lua

-- first load extension
require("telescope").load_extension("rest")
-- then use telescope
-- then use it
require("telescope").extensions.rest.select_env()

```
Expand Down
4 changes: 2 additions & 2 deletions lua/telescope/_extensions/rest.lua
Original file line number Diff line number Diff line change
Expand Up @@ -30,17 +30,17 @@ local function rest_env_select(opt)

pickers
.new({}, {
prompt_title = "Select Evn",
prompt_title = "Select Env File",
finder = finders.new_table({
results = lines,
}),
attach_mappings = function(prompt_bufnr, map)
actions.select_default:replace(function()
local selection = action_state.get_selected_entry()
actions.close(prompt_bufnr)
if selection == nil then
return
end
actions.close(prompt_bufnr)
rest.select_env(selection[1])
end)
map("i", "<c-o>", function()
Expand Down

0 comments on commit e862e72

Please sign in to comment.