Skip to content

Commit

Permalink
Undo manual edits to docs, which should be auto-generated.
Browse files Browse the repository at this point in the history
Only make paths relative if within fast event.
  • Loading branch information
caojoshua committed Jun 6, 2021
1 parent fc6e5c2 commit e847780
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 5 deletions.
33 changes: 33 additions & 0 deletions doc/telescope.txt
Original file line number Diff line number Diff line change
Expand Up @@ -502,6 +502,11 @@ builtin.tags({opts}) *builtin.tags()*
{show_line} (boolean) if true, shows the content of the line the
tag is found on in the picker (default is
true)
{shorten_path} (boolean) if true, makes file paths shown in picker
use one letter for folders (default is true)
{hide_filename} (boolean) if true, hides the name of the file in the
current picker (default is false)


builtin.current_buffer_tags({opts}) *builtin.current_buffer_tags()*
Lists all of the tags for the currently open buffer, with a preview
Expand Down Expand Up @@ -799,6 +804,13 @@ builtin.tagstack({opts}) *builtin.tagstack()*
Parameters: ~
{opts} (table) options to pass to the picker

Fields: ~
{shorten_path} (boolean) if true, makes file paths shown in picker
use one letter for folders (default is true)
{hide_filename} (boolean) if true, hides the name of the file in the
current picker (default is true)


builtin.jumplist({opts}) *builtin.jumplist()*
Lists items from Vim's jumplist, jumps to location on `<cr>`

Expand All @@ -815,6 +827,10 @@ builtin.lsp_references({opts}) *builtin.lsp_references()*
Parameters: ~
{opts} (table) options to pass to the picker

Fields: ~
{shorten_path} (boolean) if true, makes file paths shown in picker use
one letter for folders (default is false)


builtin.lsp_definitions({opts}) *builtin.lsp_definitions()*
Goto the definition of the word under the cursor, if there's only one,
Expand Down Expand Up @@ -876,7 +892,12 @@ builtin.lsp_workspace_symbols({opts}) *builtin.lsp_workspace_symbols()*
{opts} (table) options to pass to the picker

Fields: ~
{shorten_path} (boolean) if true, makes file paths shown in picker
use one letter for folders (default is
false)
{ignore_filename} (string) file(s) to ignore
{hide_filename} (boolean) if true, hides the name of the file in the
current picker (default is false)


builtin.lsp_dynamic_workspace_symbols({opts})*builtin.lsp_dynamic_workspace_symbols()*
Expand All @@ -889,6 +910,10 @@ builtin.lsp_dynamic_workspace_symbols({opts})*builtin.lsp_dynamic_workspace_symb
Parameters: ~
{opts} (table) options to pass to the picker

Fields: ~
{hide_filename} (boolean) if true, hides the name of the file in the
current picker (default is false)


builtin.lsp_document_diagnostics({opts}) *builtin.lsp_document_diagnostics()*
Lists LSP diagnostics for the current buffer
Expand All @@ -900,6 +925,10 @@ builtin.lsp_document_diagnostics({opts}) *builtin.lsp_document_diagnostics()*
Parameters: ~
{opts} (table) options to pass to the picker

Fields: ~
{hide_filename} (boolean) if true, hides the name of the file in the
current picker (default is false)


builtin.lsp_workspace_diagnostics({opts})*builtin.lsp_workspace_diagnostics()*
Lists LSP diagnostics for the current workspace if supported, otherwise
Expand All @@ -912,6 +941,10 @@ builtin.lsp_workspace_diagnostics({opts})*builtin.lsp_workspace_diagnostics()*
Parameters: ~
{opts} (table) options to pass to the picker

Fields: ~
{hide_filename} (boolean) if true, hides the name of the file in the
current picker (default is false)



================================================================================
Expand Down
9 changes: 4 additions & 5 deletions lua/telescope/utils.lua
Original file line number Diff line number Diff line change
Expand Up @@ -165,11 +165,10 @@ utils.transform_path = function(opts, path)
if vim.tbl_contains(path_display, "tail") then
transformed_path = utils.path_tail(transformed_path)
else
-- TODO: absolute/relative paths. we can't call vimL functions in lua loop callback.
-- if not vim.tbl_contains(path_display, "absolute") then
-- local cwd = vim.fn.expand(opts.cwd or vim.fn.getcwd())
-- transformed_path = pathlib.make_relative(transformed_path, cwd)
-- end
if not vim.in_fast_event() and not vim.tbl_contains(path_display, "absolute") then
local cwd = vim.fn.expand(opts.cwd or vim.fn.getcwd())
transformed_path = pathlib.make_relative(transformed_path, cwd)
end

if vim.tbl_contains(path_display, "shorten") then
transformed_path = pathlib.shorten(transformed_path)
Expand Down

0 comments on commit e847780

Please sign in to comment.