gitui-org / gitui-org/gitui

Load partial files lazily for preview

Aperta
#2,256 1 commento 0 reazioni 0 assegnatari Vedi su GitHub
feature-request
Lingua principale
Rust
Stelle
22.5k
Fork
773
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

**Is your feature request related to a problem? Please describe.**
If you have large files in your repo, gitui tries to load more than what is required, and it seems to block the ui partially, and causes application to freeze for a few seconds depending on the performance of the machine, it almost froze on my rpi, but it was just a 1-2 second stutter on my workstation.

**Describe the solution you'd like**
I am unsure about the implementation. But it should provide lazy "partial" file loading for previews so that it only loads the first N bytes required for displaying the preview. It should be fairly easy to implement it irrespective of platform and will help avoid the cost of fetching large files.

Also, I am not entirely sure if this is a feature request but as it didn't feel fair calling it a bug so here it is.

**Describe alternatives you've considered**
None, I can't think of any other solutions, in case it's already implemented it might be worth looking into why it stutters with large files, we can also directly back the preview with Mmap to ensure not more than the part of the file required for preview is loaded (I haven't written interactive tui in rust much, so I am unsure, but I think it shouldn't be hard to implement).

**Additional context**
Will try to find time to implement it, also have a look at gitui code base while I am at it.

I don't use gitui much, but it's a nice to have, to stage changes partially, thanks for the hard work folks.

Guida per i contributori

Apri la guida per i contributori

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.