aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/options.lua
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2024-01-24 12:27:38 +0800
committerGitHub <noreply@github.com>2024-01-24 12:27:38 +0800
commitc8a27bae3faeaca137e5f67b1b052ce0f0225b36 (patch)
tree15b6e73e1e0d8ee6235c5c4365491e13cc13d812 /src/nvim/options.lua
parent65bfa86efeeb2ec18ba82fd821ffd4c8f97fcd2b (diff)
downloadrneovim-c8a27bae3faeaca137e5f67b1b052ce0f0225b36.tar.gz
rneovim-c8a27bae3faeaca137e5f67b1b052ce0f0225b36.tar.bz2
rneovim-c8a27bae3faeaca137e5f67b1b052ce0f0225b36.zip
fix(options): use a union for def_val (#27169)
Problem: APIs get wrong boolean option default values on big-endian platforms. Solution: Use a union for def_val. Cannot use OptVal or OptValData yet as it needs to have the same types as option variables.
Diffstat (limited to 'src/nvim/options.lua')
-rw-r--r--src/nvim/options.lua12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/nvim/options.lua b/src/nvim/options.lua
index 2b90f4c315..b361539fc9 100644
--- a/src/nvim/options.lua
+++ b/src/nvim/options.lua
@@ -61,7 +61,7 @@ end
--- @return fun(): string
local function macros(s)
return function()
- return s
+ return '.string=' .. s
end
end
@@ -69,7 +69,7 @@ end
--- @return fun(): string
local function imacros(s)
return function()
- return '(intptr_t)' .. s
+ return '.number=' .. s
end
end
@@ -1271,7 +1271,7 @@ return {
abbreviation = 'co',
cb = 'did_set_lines_or_columns',
defaults = {
- if_true = macros('DFLT_COLS'),
+ if_true = imacros('DFLT_COLS'),
doc = '80 or terminal width',
},
desc = [=[
@@ -4024,7 +4024,7 @@ return {
{
abbreviation = 'imi',
cb = 'did_set_iminsert',
- defaults = { if_true = macros('B_IMODE_NONE') },
+ defaults = { if_true = imacros('B_IMODE_NONE') },
desc = [=[
Specifies whether :lmap or an Input Method (IM) is to be used in
Insert mode. Valid values:
@@ -4050,7 +4050,7 @@ return {
},
{
abbreviation = 'ims',
- defaults = { if_true = macros('B_IMODE_USE_INSERT') },
+ defaults = { if_true = imacros('B_IMODE_USE_INSERT') },
desc = [=[
Specifies whether :lmap or an Input Method (IM) is to be used when
entering a search pattern. Valid values:
@@ -4747,7 +4747,7 @@ return {
{
cb = 'did_set_lines_or_columns',
defaults = {
- if_true = macros('DFLT_ROWS'),
+ if_true = imacros('DFLT_ROWS'),
doc = '24 or terminal height',
},
desc = [=[