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

Bug: can not jump to location when nvim is open as manpager #1204

Closed
4 of 6 tasks
sandangel opened this issue May 20, 2024 · 2 comments
Closed
4 of 6 tasks

Bug: can not jump to location when nvim is open as manpager #1204

sandangel opened this issue May 20, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@sandangel
Copy link

RTFM Checklist

  • I have searched exisiting issues / discussions
  • I have read the Wiki including the Advanced section
  • I have read man fzf / I am well versed in shell fzf

Operating system

Linux

Shell

zsh

Neovim version (nvim --version)

NVIM v0.10.0-dev-9e2f378

Fzf version (fzf --version)

0.51.0

Output of :lua print(os.getenv('FZF_DEFAULT_OPTS'))

--ansi --border --bind page-up:preview-up,page-down:preview-down,?:toggle-preview

Is the problem reproducible with mini.sh?

  • My issue is reproducible with mini.sh
  • My issue IS NOT reproducible with mini.sh
  • I have not tested with mini.sh (not relevant, requires LSP, Windows, etc)

Fzf-lua configuration

local fzf_history_dir = vim.env.HOME .. '/.local/share/nvim/fzf-history'
if vim.fn.isdirectory(fzf_history_dir) == 0 then
  vim.fn.system { 'mkdir', '-p', fzf_history_dir, }
end

local fzf_lua = require 'fzf-lua'

local sel_to_qf = function(selected, opts)
  local qf_list = {}
  for i = 1, #selected do
    local file = fzf_lua.path.entry_to_file(selected[i], opts)
    local text = selected[i]:match ':%d+:%d?%d?%d?%d?:?(.*)$'
    table.insert(qf_list, {
      filename = file.bufname or file.path,
      lnum = file.line,
      col = file.col,
      text = text,
    })
  end
  vim.fn.setqflist(qf_list)
  vim.cmd 'FzfLua quickfix'
end

local function file_edit_or_qf(selected, opts)
  if #selected > 1 then
    return sel_to_qf(selected, opts)
  else
    fzf_lua.actions.file_edit(selected, opts)
  end
end

fzf_lua.setup {
  keymap = {
    builtin = {
      ['<F1>'] = 'toggle-help',
      ['<F2>'] = 'toggle-fullscreen',
      ['<F3>'] = 'toggle-preview',
      ['<PageDown>'] = 'preview-page-down',
      ['<PageUp>'] = 'preview-page-up',
      ['<Home>'] = 'preview-page-reset',
    },
    fzf = {
      ['tab'] = 'toggle',
      ['ctrl-a'] = 'toggle-all',
      ['ctrl-f'] = 'half-page-down',
      ['ctrl-b'] = 'half-page-up',
    },
  },
  fzf_opts = {
    ['--layout'] = 'default',
    ['--history'] = fzf_history_dir .. '/fzf-lua',
    ['--history-size'] = '10000',
  },
  actions = {
    files = {
      ['enter']  = file_edit_or_qf,
      ['ctrl-s'] = fzf_lua.actions.file_vsplit,
    },
  },
  files = {
    git_icons = false,
  },
  grep = {
    git_icons = false,
    file_icons = false,
    color_icons = false,
  },
}

Describe the bug / steps to reproduce

When running nvim as man pager:

export MANPAGER='nvim +Man!'

Then we can not jump to locations with FzfLua.

aws configure set help
:FzfLua loclist
image
@sandangel sandangel added the bug Something isn't working label May 20, 2024
@sandangel
Copy link
Author

It works with gO (ge-oh)

@ibhagwan
Copy link
Owner

@sandangel with 8c15b66 should work as expected.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants