-
Notifications
You must be signed in to change notification settings - Fork 264
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
vis_pipe*: take a Text object, vis-lua: add pipe_buffer #1177
Conversation
I'm not sure about this one. Can you provide some real example of where (Ignore the failing macOS CI, github broke something.) |
In my case I had to display a list in the format of printf '
./file1:0:line zero
./file1:1:'unterminated quote
' |
Is there reason why you don't pipe the output of the fuzzy finder to the next stage in one go? Why do you need to save the intermediate output? |
The contents I shared are generated by my lua code, I'm using it for displaying all the lines for the goto references in LSP. I get the file and line numbers from the LSP server, and then construct a buffer in lua that is piped to a fuzzy finder |
I wanted something like this too, but for different reasons. Sometimes you do not have a window or a file to use For example during the creation of the |
I'm OK with the idea but I'm not a fan of needing to go through at least 4 different dynamic allocations (text, piece, change, at least 1 in text_insert(), etc.) just to pass a string to a shell program. Maybe there is a better way? |
Yeah we can definitely come up with more efficient ways of doing this, but for the PR just wanted to re-use as much of the existing code as possible |
@git-bruh Hi, what is the status of this PR, please? Your last comment seems to indicate that there will be some new version of this PR coming. |
Hey sorry, I won't be having time soon to work on this PR. In the comment I meant we could discuss and implement a more efficient version, but I didn't get time to follow up on it |
I played with the idea and came up with #1204. |
Superseded by #1204 |
This adds a pipe_buffer helper to the lua api to allow piping arbritary buffers to an external command, as the current way of constructing a
printf
command is quite hacky and is prone to shell injectionAs a workaround, I'd written a wrapper like this but it messes up the scroll position, so made this PR instead: