feat(entry_maker): add 'filename_first' option for path_display (#3010)
* Initial commit * Fixes issue with find_files where devicons where disabled * Fixes issue with vimgrep where devicons where disabled * Fixes trailing space for path with only a file name * Adds test for reverse path_display * Refactors reverse to filename_first * Adds tests * Fixes highlighting * Fixes linting issues * Uses trim function * Fixes issue with highlighting * Moves local function to utils * Removes redundant code * Adds highlighting for gen_from_buffer * fix formatting --------- Co-authored-by: alycklama <> Co-authored-by: James Trew <j.trew10@gmail.com>
This commit is contained in:
@@ -277,4 +277,24 @@ describe("transform_path", function()
|
||||
it("handles default 'truncate' path_display", function()
|
||||
assert_path({ "truncate" }, new_relpath "lua/telescope/init.lua", new_relpath "…scope/init.lua")
|
||||
end)
|
||||
|
||||
it("handles 'filename_first' path_display", function()
|
||||
assert_path("filename_first", new_relpath "init.lua", new_relpath "init.lua")
|
||||
assert_path("filename_first", new_relpath "lua/telescope/init.lua", new_relpath "init.lua lua/telescope")
|
||||
end)
|
||||
|
||||
it("handles 'filename_first' path_display with the option to reverse directories", function()
|
||||
assert_path({ filename_first = { reverse_directories = true } }, new_relpath "init.lua", new_relpath "init.lua")
|
||||
assert_path(
|
||||
{ filename_first = { reverse_directories = true } },
|
||||
new_relpath "lua/telescope/init.lua",
|
||||
new_relpath "init.lua telescope/lua"
|
||||
)
|
||||
assert_path({ filename_first = { reverse_directories = false } }, new_relpath "init.lua", new_relpath "init.lua")
|
||||
assert_path(
|
||||
{ filename_first = { reverse_directories = false } },
|
||||
new_relpath "lua/telescope/init.lua",
|
||||
new_relpath "init.lua lua/telescope"
|
||||
)
|
||||
end)
|
||||
end)
|
||||
|
||||
Reference in New Issue
Block a user