Skip to content

feat: path_shorten using extmarks#2520

Open
ibhagwan wants to merge 2 commits intomainfrom
path_shorten_extmarks
Open

feat: path_shorten using extmarks#2520
ibhagwan wants to merge 2 commits intomainfrom
path_shorten_extmarks

Conversation

@ibhagwan
Copy link
Owner

I'm quite mind blown, this PR was one shot from a single prompt in opencode using subagents, the prompt:

  ┃  Can you take a look at issue #2517 in fzf-lua github repo and read the linked comment from discussion
  ┃  #2516 and see if you can come up with a PR to enable path_shorten using neovim extmarks?

I haven't reviewed the code yet, but my agents (3 different models) did and this is what they found:
image

Note it chose to use a different option as it affects the main fzf window only within neovim and can't be used in fzf-tmux so to use this you need to use winopts.path_shorten:

:FzfLua files winopts.path_shorten=true
image

Honestly, this is quite shocking, the level of understanding of a very intricate problem and solution from a two-liner prompt...

The review seems to be on-point too (which I'll soon push it's changes too).

@ibhagwan ibhagwan force-pushed the path_shorten_extmarks branch 4 times, most recently from 264608c to 645e973 Compare January 18, 2026 02:14
@nenahp
Copy link

nenahp commented Jan 18, 2026

that's interesting. it seems the shorten parts can be highlighted correctly

maybe just not work well with fd --color=always

Tested it work with term ansi hl, I see the code conceal the part not coverted by path_shorten length, so it's a better solution.

@ibhagwan ibhagwan force-pushed the path_shorten_extmarks branch 3 times, most recently from 53dac58 to e4b5075 Compare January 18, 2026 03:07
@ibhagwan
Copy link
Owner Author

that's interesting. it seems the shorten parts can be highlighted correctly

maybe just not work well with fd --color=always

Tested it work with term ansi hl, I see the code conceal the part not coverted by path_shorten length, so it's a better solution.

I also tested with ANSI hl and it worked, also worked with path_shorten=2 (3,etc...)

Can also use nvim_set_decoration_provider with ephemeral extmark here. It will apply on redraw, so no need to clear marks manually on redraw. return false in on_win to filter non fzf win.

I'll let the AI fix it's own work let's see what it comes up with :-)

@ibhagwan
Copy link
Owner Author

cffe957

image

@ibhagwan ibhagwan force-pushed the path_shorten_extmarks branch from cffe957 to 58013e9 Compare January 29, 2026 16:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants