Skip to content

[Feature request] Allow floating window dimensions be customizable on demand #1512

Closed
@davidsierradz

Description

@davidsierradz

Is your feature request related to a problem? Please describe.

My use-case would be to open the float window in the center

Describe the solution you'd like

@alex-courtis proposes view.float.open_win_config to be a function that returns a table with the floating window configurations

Describe alternatives you've considered

Tried to calculate the values on entering neovim but with no luck:

local screen_w = vim.opt.columns:get()
local screen_h = vim.opt.lines:get() - vim.opt.cmdheight:get()
local _width = screen_w
local _height = screen_h
local width = math.floor(_width)
local height = math.floor(_height)
local center_y = (vim.opt.lines:get() - _height) / 2
local center_x = (screen_w - _width) / 2

Additional context

#1462 (comment)

Thanks

Metadata

Metadata

Assignees

No one assigned

    Labels

    PR pleasenvim-tree team does not have the bandwidth to implement; a PR will be gratefully appreciatedfeature request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions