1

Refresh generated neovim config

This commit is contained in:
2024-08-15 13:01:03 +02:00
parent 64b51cf53a
commit f5af8e2b28
1836 changed files with 38979 additions and 31094 deletions

View File

@ -1,5 +1,12 @@
# Changelog
## [2.12.0](https://github.com/akinsho/toggleterm.nvim/compare/v2.11.0...v2.12.0) (2024-06-25)
### Features
* add shading_ratio option ([#580](https://github.com/akinsho/toggleterm.nvim/issues/580)) ([74ce690](https://github.com/akinsho/toggleterm.nvim/commit/74ce6904e10e9bf2b7ffde598afc106c1d61e59c))
## [2.11.0](https://github.com/akinsho/toggleterm.nvim/compare/v2.10.0...v2.11.0) (2024-04-22)

View File

@ -186,7 +186,8 @@ require("toggleterm").setup{
},
},
shade_terminals = true, -- NOTE: this option takes priority over highlights specified so if you specify Normal highlights you should set this to false
shading_factor = '<number>', -- the percentage by which to lighten terminal background, default: -30 (gets multiplied by -3 if background is light)
shading_factor = '<number>', -- the percentage by which to lighten dark terminal background, default: -30
shading_ratio = '<number>', -- the ratio of shading factor for light/dark terminal background, default: -3
start_in_insert = true,
insert_mappings = true, -- whether or not the open mapping applies in insert mode
terminal_mappings = true, -- whether or not the open mapping applies in the opened terminals

View File

@ -1,4 +1,4 @@
*toggleterm.txt* For Neovim >= 0.8.0 Last change: 2024 May 19
*toggleterm.txt* For Neovim >= 0.8.0 Last change: 2024 July 17
==============================================================================
Table of Contents *toggleterm-table-of-contents*
@ -173,7 +173,8 @@ what options are available. It is not written to be used as is.
},
},
shade_terminals = true, -- NOTE: this option takes priority over highlights specified so if you specify Normal highlights you should set this to false
shading_factor = '<number>', -- the percentage by which to lighten terminal background, default: -30 (gets multiplied by -3 if background is light)
shading_factor = '<number>', -- the percentage by which to lighten dark terminal background, default: -30
shading_ratio = '<number>', -- the ratio of shading factor for light/dark terminal background, default: -3
start_in_insert = true,
insert_mappings = true, -- whether or not the open mapping applies in insert mode
terminal_mappings = true, -- whether or not the open mapping applies in the opened terminals

View File

@ -28,6 +28,7 @@ local function shade(color, factor) return colors.shade_color(color, factor) end
--- @field close_on_exit boolean
--- @field direction '"horizontal"' | '"vertical"' | '"float"'
--- @field shading_factor number
--- @field shading_ratio number
--- @field shell string|fun():string
--- @field auto_scroll boolean
--- @field float_opts table<string, any>
@ -50,6 +51,7 @@ local config = {
close_on_exit = true,
direction = "horizontal",
shading_factor = constants.shading_amount,
shading_ratio = constants.shading_ratio,
shell = vim.o.shell,
autochdir = false,
auto_scroll = true,
@ -91,7 +93,7 @@ local function get_highlights(conf)
if conf.shade_terminals then
local is_bright = colors.is_bright_background()
local degree = is_bright and -3 or 1
local degree = is_bright and conf.shading_ratio or 1
local amount = conf.shading_factor * degree
local normal_bg = colors.get_hex("Normal", "bg")
local terminal_bg = conf.shade_terminals and shade(normal_bg, amount) or normal_bg

View File

@ -3,8 +3,9 @@ local M = {}
-- Constants
-----------------------------------------------------------
M.FILETYPE = "toggleterm"
-- -30 is a magic number based on manual testing of what looks good
-- -30 and -3 is a magic number based on manual testing of what looks good
M.shading_amount = -30
M.shading_ratio = -3
-- Highlight group name prefix
M.highlight_group_name_prefix = "ToggleTerm"