Comments (8)
Hey, thank you for the project. I am looking to replace fzf with zf.
The preview feature is actually one of the most important features for me, I use it to preview the contents of files when I use fzf in my editor.
Another example: preview contents of tmux sessions before switching to it, a pseudo-code command would be like this tmux list-windows | zf --preview "tmux-preview {}" --preview-window-size=60 | xargs -n1 -I{} tmux switch-to {}
.
from zf.
@mizlan there shouldn't be any performance impact of a disabled preview with the way I'm planning on adding preview.
I also have some fuzzy plans to add multithreading to zf so if anything, it will be even more performant in the future!
from zf.
@kovetskiy thanks for expressing interest!
I've only thought about this feature for a day now, but I'm 95% certain I'll add it. I think I'll target the 0.9.0 release (0.8.0 should be released in about 2 weeks probably) so not too far away. Maybe sooner depending on how much time the remaining 0.8.0 features take.
At the same time, I want to keep zf really simple (I think fzf has way too many options). But I also want to make it useful. I think --preview
and --preview-size
commands are reasonable. Are you aware of any other options that might be needed?
Also, is the --preview-size
a column width or a percentage?
from zf.
Also, is the --preview-size a column width or a percentage?
I think fzf's way is optimal in this sense, it uses a column width (or a number of rows for horizontal preview) if no %
is specified, and uses percentage otherwise. But I'd personally be happy with the percentage as I often resize my windows and can't really stick to some static numbers.
Thanks!
from zf.
Thanks for the clarification. I think I will start with a percentage, then if it seems like a fixed width is also needed I'll add that.
I thought about this more and I'm not sure how to best add this to zf's main loop. Currently I keep things very CPU efficient by using blocking reads in the UI. The problem with that is if I wanted to make subprocess calls async (which they should be for a good experience) I would need to make the read calls non-blocking. Otherwise the UI preview would not update unless a key was pressed.
This could be trivially handled by adding a sleep of sorts to the main loop. Or using evented IO. Currently Zig's async implementation is incomplete in the self-hosted compiler, but ideally I would use that for syntax support.
I do want to add this, so I'll keep thinking of solutions.
from zf.
If I'm understanding it correctly, I think std.io.poll
introduced in 0.11.0 will be a good solution. ziglang/zig#14744
So I will add previews once Zig 0.11.0 is released.
from zf.
I am curious, will the existence of previewing functionality cause a hit to performance even if the previewing is disabled?
from zf.
I just merged some commits that introduces an event loop to zf, so I'll start working on this feature in the next week or so!
from zf.
Related Issues (20)
- alternative algorithm HOT 2
- Feature request: Custom deliminator HOT 1
- doesnt't build on current master HOT 2
- some problems that block me adopting zf HOT 4
- UI blocks until all results are collected HOT 3
- Respond to `SIGWINCH`
- Evented IO HOT 1
- Ranking improvements
- Buffer writing to stdout
- Usable as C library? HOT 1
- Which Zig version works? HOT 9
- Replace `--lines` with `--height`
- Improve zfâs speed HOT 5
- Add newlines after usage
- Error parsing arg after short option
- Remove `--lines`
- Support for fzf syntax HOT 4
- Add a potentially new option `-0` for NUL-separated lines. HOT 1
- Issue with system and linking libc
- Highlights and selected row go off screen
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
đ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. đđđ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google â¤ď¸ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from zf.