Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

plugins.dropbar.settings.symbol.preview.reorient

Function to reorient the source window when previewing symbol given the source window win and the range of the symbol range.

Type: null or raw lua code

Default: null

Plugin default:

lib.nixvim.mkRaw ''
  function(_, range)
    local invisible = range['end'].line - vim.fn.line('w$') + 1
    if invisible > 0 then
      local view = vim.fn.winsaveview() --[[@as vim.fn.winrestview.dict]]
      view.topline = math.min(
        view.topline + invisible,
        math.max(1, range.start.line - vim.wo.scrolloff + 1)
      )
      vim.fn.winrestview(view)
    end
  end
''

Declared by: