Skip to content
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

fzf can not "become()" helix #6522

Closed
thomas-mangin opened this issue Mar 31, 2023 · 2 comments
Closed

fzf can not "become()" helix #6522

thomas-mangin opened this issue Mar 31, 2023 · 2 comments
Labels
C-bug Category: This is a bug R-duplicate Duplicated issue: please refer to the linked issue

Comments

@thomas-mangin
Copy link

Summary

When attempting to use helix as editor with the fzf script below (from their documentation), helix panics (vim does not).

Reproduction Steps

#!/usr/bin/env bash

# Switch between Ripgrep launcher mode (CTRL-R) and fzf filtering mode (CTRL-F)
rm -f /tmp/rg-fzf-{r,f}
RG_PREFIX="rg --column --line-number --no-heading --color=always --smart-case "
INITIAL_QUERY="${*:-}"
FZF_DEFAULT_COMMAND="$RG_PREFIX $(printf %q "$INITIAL_QUERY")" \
fzf --ansi \
    --color "hl:-1:underline,hl+:-1:underline:reverse" \
    --disabled --query "$INITIAL_QUERY" \
    --bind "change:reload:sleep 0.1; $RG_PREFIX {q} || true" \
    --bind "ctrl-f:unbind(change,ctrl-f)+change-prompt(2. fzf> )+enable-search+rebind(ctrl-r)+transform-query(echo {q} > /tmp/rg-fzf-r; cat /tmp/rg-fzf-f)" \
    --bind "ctrl-r:unbind(ctrl-r)+change-prompt(1. ripgrep> )+disable-search+reload($RG_PREFIX {q} || true)+rebind(change,ctrl-f)+transform-query(echo {q} > /tmp/rg-fzf-f; cat /tmp/rg-fzf-r)" \
    --bind "start:unbind(ctrl-r)" \
    --prompt '1. ripgrep> ' \
    --delimiter : \
    --header '╱ CTRL-R (ripgrep mode) ╱ CTRL-F (fzf mode) ╱' \
      --bind='tab:toggle-preview' \
      --preview 'bat --color=always {1}' \
      --preview-window 'right,60%,border-bottom,+{2}+3/3,~3' \
      --bind 'enter:become(hx {1}:{2})'

I expected to edit the file.

Instead, this happened:

❯ rfv                       
thread 'main' panicked at 'reader source not set', /Users/thomas/Library/Caches/Homebrew/cargo_cache/registry/src/git.luolix.top-1ecc6299db9ec823/crossterm-0.26.1/src/event/read.rs:38:30
stack backtrace:
   0:        0x103557154 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::hb17ae407ceb5e85c
   1:        0x102d30814 - core::fmt::write::h4368cf77ad7a6983
   2:        0x103538560 - std::io::Write::write_fmt::hab72d7663689ca67
   3:        0x103556f70 - std::sys_common::backtrace::print::h7eb3daa302a590d2
   4:        0x103540df8 - std::panicking::default_hook::{{closure}}::hbc150029db62d796
   5:        0x103540ae0 - std::panicking::default_hook::hfe5aaf6e5d93cdb0
   6:        0x10354148c - std::panicking::rust_panic_with_hook::h4df824f9cff6c7b7
   7:        0x103557d48 - std::panicking::begin_panic_handler::{{closure}}::ha727866dc627bc3e
   8:        0x103557284 - std::sys_common::backtrace::__rust_end_short_backtrace::hce17f933963409ec
   9:        0x103541100 - _rust_begin_unwind
  10:        0x10360c6d4 - core::panicking::panic_fmt::hd674a81fcd3c72a2
  11:        0x102d2c674 - core::panicking::panic_display::h6cdb04be318fb65b
  12:        0x102d2c638 - core::panicking::panic_str::hdaf3a70f84843610
  13:        0x10360c60c - core::option::expect_failed::hc4382ab1af9bdf69
  14:        0x102d42dd4 - <crossterm::event::stream::EventStream as core::default::Default>::default::h7c36bc421e8d9f30
  15:        0x1033e7f08 - hx::main_impl::{{closure}}::h3be503960427ed5d
  16:        0x1033e5910 - tokio::runtime::context::BlockingRegionGuard::block_on::hb90b2115f2a0be0a
  17:        0x1033fd988 - tokio::runtime::runtime::Runtime::block_on::hc52c41317f193b03
  18:        0x1034114f0 - hx::main::ha914837170f9d56c
  19:        0x1033ed75c - std::sys_common::backtrace::__rust_begin_short_backtrace::hfffc07fe1ef46e45
  20:        0x1033f3420 - std::rt::lang_start::{{closure}}::hf596c72c62b46a58
  21:        0x10353ed84 - std::rt::lang_start_internal::ha09578cf5ed4491a
  22:        0x1034115ec - _main

Helix log

~/.cache/helix/helix.log
2023-03-31T23:25:09.802 helix_view::editor [ERROR] Failed to initialize the LSP for `source.python` { cannot find binary path }

Platform

macOS macOS, 13.2.1, Apple M1 Max

Terminal Emulator

kitty 0.27.1

Helix Version

helix 23.03 (3cf0372)

@thomas-mangin thomas-mangin added the C-bug Category: This is a bug label Mar 31, 2023
@kirawi
Copy link
Member

kirawi commented Mar 31, 2023

Duplicate of #2111
Resolved by #5468

@kirawi kirawi closed this as not planned Won't fix, can't repro, duplicate, stale Mar 31, 2023
@kirawi kirawi added the R-duplicate Duplicated issue: please refer to the linked issue label Mar 31, 2023
@thomas-mangin
Copy link
Author

Thank you for the quick answer.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: This is a bug R-duplicate Duplicated issue: please refer to the linked issue
Projects
None yet
Development

No branches or pull requests

2 participants