aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/generators/gen_options.lua
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2024-12-07 10:17:36 +0800
committerGitHub <noreply@github.com>2024-12-07 02:17:36 +0000
commitec94c2704f5059794923777ed51412d80bd26b5b (patch)
tree5e75aa7277274401f475e3eb1ccc711b7cd2ddc8 /src/nvim/generators/gen_options.lua
parent517ecb85f58ed6ac8b4d5443931612e75e7c7dc2 (diff)
downloadrneovim-ec94c2704f5059794923777ed51412d80bd26b5b.tar.gz
rneovim-ec94c2704f5059794923777ed51412d80bd26b5b.tar.bz2
rneovim-ec94c2704f5059794923777ed51412d80bd26b5b.zip
vim-patch:9.1.0908: not possible to configure :messages (#31492)
Problem: not possible to configure :messages Solution: add the 'messagesopt' option (Shougo Matsushita) closes: vim/vim#16068 https://github.com/vim/vim/commit/51d4d84d6a7159c6ce9e04b36f8edc105ca3794b Co-authored-by: Shougo Matsushita <Shougo.Matsu@gmail.com> Co-authored-by: h_east <h.east.727@gmail.com>
Diffstat (limited to 'src/nvim/generators/gen_options.lua')
-rw-r--r--src/nvim/generators/gen_options.lua6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/nvim/generators/gen_options.lua b/src/nvim/generators/gen_options.lua
index 779b31e7a0..c79683dc00 100644
--- a/src/nvim/generators/gen_options.lua
+++ b/src/nvim/generators/gen_options.lua
@@ -47,7 +47,9 @@ end
--- @param s string
--- @return string
local lowercase_to_titlecase = function(s)
- return s:sub(1, 1):upper() .. s:sub(2)
+ return table.concat(vim.tbl_map(function(word) --- @param word string
+ return word:sub(1, 1):upper() .. word:sub(2)
+ end, vim.split(s, '[-_]')))
end
-- Generate options enum file
@@ -177,7 +179,7 @@ for _, option in ipairs(options_meta) do
vars_w(
(' kOpt%sFlag%s = 0x%02x,'):format(
opt_name,
- lowercase_to_titlecase(flag_name),
+ lowercase_to_titlecase(flag_name:gsub(':$', '')),
enum_values[flag_name]
)
)