Shougo / ddu-ui-filer

File listing UI for ddu.vim
MIT License
55 stars 8 forks source link

[Feature request] I want a method that is called when redrawing #40

Closed nabezokodaikon closed 6 months ago

nabezokodaikon commented 6 months ago

The "getLength" method is called every time a directory is opened, and the "getText" method is called every time an item is drawn, but I would like a method to be run on first display and on "redraw".

The reason is that I created a plugin that displays the Git status in a "column", but since the "git status" command is executed within the "getLength" method, the process becomes redundant.

Environment Information

ddu-column-gitstatus

https://github.com/nabezokodaikon/ddu-column-gitstatus/blob/main/denops/%40ddu-columns/gitstatus.ts

Shougo commented 6 months ago

If you really need the feature, the length should be cached in your column.

The "getLength" method is called every time a directory is opened, and the "getText" method is called every time an item is drawn, but I would like a method to be run on first display and on "redraw".

getLength() depends all items and all items are recreated when you have opened/closed directories.

nabezokodaikon commented 6 months ago

In ddu-column-gitstatus, git information is held in the Column class, but is it different from that?

Shougo commented 6 months ago

I have implemented the feature. Please use getBaseText().

nabezokodaikon commented 6 months ago

Thank you!