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

fix: move the moon behind show_moon option (… #2079

Merged
merged 1 commit into from
Jul 22, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions doc/telescope.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1117,6 +1117,8 @@ builtin.planets({opts}) *telescope.builtin.planets()*
Options: ~
{show_pluto} (boolean) we love pluto (default: false, because its a
hidden feature)
{show_moon} (boolean) we love the moon (default: false, because its
a hidden feature)


builtin.symbols({opts}) *telescope.builtin.symbols()*
Expand Down
3 changes: 2 additions & 1 deletion lua/telescope/builtin/__internal.lua
Original file line number Diff line number Diff line change
Expand Up @@ -208,14 +208,15 @@ end

internal.planets = function(opts)
local show_pluto = opts.show_pluto or false
local show_moon = opts.show_moon or false

local sourced_file = require("plenary.debug_utils").sourced_filepath()
local base_directory = vim.fn.fnamemodify(sourced_file, ":h:h:h:h")

local globbed_files = vim.fn.globpath(base_directory .. "/data/memes/planets/", "*", true, true)
local acceptable_files = {}
for _, v in ipairs(globbed_files) do
if show_pluto or not v:find "pluto" then
if (show_pluto or not v:find "pluto") and (show_moon or not v:find "moon") then
table.insert(acceptable_files, vim.fn.fnamemodify(v, ":t"))
end
end
Expand Down
1 change: 1 addition & 0 deletions lua/telescope/builtin/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,7 @@ builtin.pickers = require_on_exported_call("telescope.builtin.__internal").picke
--- Use the telescope...
---@param opts table: options to pass to the picker
---@field show_pluto boolean: we love pluto (default: false, because its a hidden feature)
---@field show_moon boolean: we love the moon (default: false, because its a hidden feature)
builtin.planets = require_on_exported_call("telescope.builtin.__internal").planets

--- Lists symbols inside of `data/telescope-sources/*.json` found in your runtime path
Expand Down