ThePrimeagen / harpoon

MIT License
6.84k stars 367 forks source link

Telescope preview with long file path #411

Open nkien0204 opened 9 months ago

nkien0204 commented 9 months ago

When I use Harpoon as extension of Telescope to open a file with really long path, it just display from the beginning, and I can not see the file name. The problem is if I have 2 different files but same directory, Telescope will show exactly the same and I think it quite inconvenience!

image

I think this will better if it perform like the other Telescope preview windows, always show the file name. Like this:

image
kimabrandt-flx commented 8 months ago

The #512 PR would allow you to use the path_display = { "truncate" }-config for telescope. If it's already set - inside your telescope defaults - it should just work!

require("telescope").extensions.harpoon.marks({
    path_display = { "truncate" },
})

or

require("telescope").extensions.harpoon.marks(
    require("telescope.themes").get_dropdown({
        path_display = { "truncate" },
    })
)

or

-- when setting up telescope:
require("telescope").setup({
    defaults = {
        path_display = { "truncate" },
    },
})

-- when using a keymap:
require("telescope").extensions.harpoon.marks()

...

idelice commented 7 months ago

@ThePrimeagen can we please merge this awesome feature.. long path names makes the actual filenames non-visible