diff --git a/README.md b/README.md index 401e58d..8313ee1 100644 --- a/README.md +++ b/README.md @@ -36,6 +36,15 @@ A beautiful toggleable floating window for managing terminal buffers within Neov } ``` +## Border styles +To change border style, use +```lua + +{ + border = true -- Defaults to "single". Set to "rounded" or "double" for those styles. +} +``` + ## Mappings This are the mappings for sidebar diff --git a/lua/floaterm/init.lua b/lua/floaterm/init.lua index a9c6676..ddc0449 100644 --- a/lua/floaterm/init.lua +++ b/lua/floaterm/init.lua @@ -21,6 +21,11 @@ M.open = function() local usr_terms = type(conf.terminals) == "table" and conf.terminals or conf.terminals() state.terminals = state.terminals or vim.tbl_deep_extend("force", {}, usr_terms) + local border_style = "single" + if type(state.config.border) == "string" then + border_style = state.config.border + end + utils.gen_term_bufs() state.buf = state.buf or state.terminals[1].buf @@ -30,8 +35,8 @@ M.open = function() local sidebar_w = 20 - if conf.position then - conf.position = type(conf.position) == 'table' and conf.position or conf.position() + if conf.position then + conf.position = type(conf.position) == "table" and conf.position or conf.position() end local pos_row = conf.position and conf.position.row or (vim.o.lines / 2 - state.h / 2) - 1 @@ -44,7 +49,7 @@ M.open = function() height = state.h, relative = "editor", style = "minimal", - border = "single", + border = border_style, zindex = 100, } @@ -69,7 +74,7 @@ M.open = function() height = state.h - 3, relative = "win", style = "minimal", - border = bordered and "single" or colored_border, + border = bordered and border_style or colored_border, zindex = 100, } @@ -83,7 +88,7 @@ M.open = function() height = 1, relative = "win", style = "minimal", - border = "single", + border = border_style, zindex = 100, }