diff options
Diffstat (limited to 'scripts')
-rw-r--r-- | scripts/genvimvim.lua | 9 | ||||
-rw-r--r-- | scripts/lua2dox.lua | 23 | ||||
-rwxr-xr-x | scripts/vim-patch.sh | 4 |
3 files changed, 32 insertions, 4 deletions
diff --git a/scripts/genvimvim.lua b/scripts/genvimvim.lua index ff60b6cce7..7e9d649cb4 100644 --- a/scripts/genvimvim.lua +++ b/scripts/genvimvim.lua @@ -44,12 +44,13 @@ local function cmd_kw(prev_cmd, cmd) end -- Exclude these from the vimCommand keyword list, they are handled specially --- in syntax/vim.vim (vimAugroupKey, vimAutoCmd). #9327 -local function is_autocmd_cmd(cmd) +-- in syntax/vim.vim (vimAugroupKey, vimAutoCmd, vimSubst). #9327 +local function is_special_cased_cmd(cmd) return (cmd == 'augroup' or cmd == 'autocmd' or cmd == 'doautocmd' - or cmd == 'doautoall') + or cmd == 'doautoall' + or cmd == 'substitute') end local vimcmd_start = 'syn keyword vimCommand contained ' @@ -60,7 +61,7 @@ for _, cmd_desc in ipairs(ex_cmds.cmds) do w('\n' .. vimcmd_start) end local cmd = cmd_desc.command - if cmd:match('%w') and cmd ~= 'z' and not is_autocmd_cmd(cmd) then + if cmd:match('%w') and cmd ~= 'z' and not is_special_cased_cmd(cmd) then w(' ' .. cmd_kw(prev_cmd, cmd)) end prev_cmd = cmd diff --git a/scripts/lua2dox.lua b/scripts/lua2dox.lua index c32370517c..6a206066b8 100644 --- a/scripts/lua2dox.lua +++ b/scripts/lua2dox.lua @@ -403,6 +403,29 @@ function TLua2DoX_filter.readfile(this,AppStamp,Filename) if string.sub(line, 3, 3) == '@' or string.sub(line, 1, 4) == '---@' then -- it's a magic comment state = 'in_magic_comment' local magic = string.sub(line, 4 + offset) + + local magic_split = string_split(magic, ' ') + + local type_index = 2 + if magic_split[1] == 'param' then + type_index = type_index + 1 + end + + if magic_split[type_index] == 'number' or + magic_split[type_index] == 'number|nil' or + magic_split[type_index] == 'string' or + magic_split[type_index] == 'string|nil' or + magic_split[type_index] == 'table' or + magic_split[type_index] == 'table|nil' or + magic_split[type_index] == 'boolean' or + magic_split[type_index] == 'boolean|nil' or + magic_split[type_index] == 'function' or + magic_split[type_index] == 'function|nil' + then + magic_split[type_index] = '(' .. magic_split[type_index] .. ')' + end + magic = table.concat(magic_split, ' ') + outStream:writeln('/// @' .. magic) fn_magic = checkComment4fn(fn_magic,magic) elseif string.sub(line,3,3)=='-' then -- it's a nonmagic doc comment diff --git a/scripts/vim-patch.sh b/scripts/vim-patch.sh index 57f51d9d46..e7e8f0b274 100755 --- a/scripts/vim-patch.sh +++ b/scripts/vim-patch.sh @@ -239,6 +239,10 @@ preprocess_patch() { LC_ALL=C sed -e 's/\( [ab]\/src\/nvim\)\/highlight\(\.[ch]\)/\1\/highlight_group\2/g' \ "$file" > "$file".tmp && mv "$file".tmp "$file" + # Rename keymap.h to keycodes.h + LC_ALL=C sed -e 's/\( [ab]\/src\/nvim\)\/keymap\.h/\1\/keycodes.h/g' \ + "$file" > "$file".tmp && mv "$file".tmp "$file" + # Rename test_urls.vim to check_urls.vim LC_ALL=C sed -e 's@\( [ab]\)/runtime/doc/test\(_urls\.vim\)@\1/scripts/check\2@g' \ "$file" > "$file".tmp && mv "$file".tmp "$file" |