From a09ddd7ce55037edc9747a682810fba6a26bc201 Mon Sep 17 00:00:00 2001 From: Lewis Russell Date: Sat, 9 Mar 2024 12:21:01 +0000 Subject: docs(editorconfig): move to source --- scripts/gen_vimdoc.lua | 70 +++++++++++++++++++++++++++++++++----------------- scripts/text_utils.lua | 8 +++--- 2 files changed, 51 insertions(+), 27 deletions(-) (limited to 'scripts') diff --git a/scripts/gen_vimdoc.lua b/scripts/gen_vimdoc.lua index 22df411a35..b3b211d5a6 100755 --- a/scripts/gen_vimdoc.lua +++ b/scripts/gen_vimdoc.lua @@ -94,12 +94,12 @@ end local function fn_helptag_fmt_common(fun) local fn_sfx = fun.table and '' or '()' if fun.classvar then - return fmt('*%s:%s%s*', fun.classvar, fun.name, fn_sfx) + return fmt('%s:%s%s', fun.classvar, fun.name, fn_sfx) end if fun.module then - return fmt('*%s.%s%s*', fun.module, fun.name, fn_sfx) + return fmt('%s.%s%s', fun.module, fun.name, fn_sfx) end - return fmt('*%s%s*', fun.name, fn_sfx) + return fun.name .. fn_sfx end --- @type table @@ -129,7 +129,7 @@ local config = { return name .. ' Functions' end, helptag_fmt = function(name) - return fmt('*api-%s*', name:lower()) + return fmt('api-%s', name:lower()) end, }, lua = { @@ -241,22 +241,22 @@ local config = { end, helptag_fmt = function(name) if name == '_editor' then - return '*lua-vim*' + return 'lua-vim' elseif name == '_options' then - return '*lua-vimscript*' + return 'lua-vimscript' elseif name == 'tohtml' then - return '*tohtml*' + return 'tohtml' end - return '*vim.' .. name:lower() .. '*' + return 'vim.' .. name:lower() end, fn_helptag_fmt = function(fun) local name = fun.name if vim.startswith(name, 'vim.') then local fn_sfx = fun.table and '' or '()' - return fmt('*%s%s*', name, fn_sfx) + return name .. fn_sfx elseif fun.classvar == 'Option' then - return fmt('*vim.opt:%s()*', name) + return fmt('vim.opt:%s()', name) end return fn_helptag_fmt_common(fun) @@ -297,9 +297,9 @@ local config = { end, helptag_fmt = function(name) if name:lower() == 'lsp' then - return '*lsp-core*' + return 'lsp-core' end - return fmt('*lsp-%s*', name:lower()) + return fmt('lsp-%s', name:lower()) end, }, diagnostic = { @@ -312,7 +312,7 @@ local config = { return 'Lua module: vim.diagnostic' end, helptag_fmt = function() - return '*diagnostic-api*' + return 'diagnostic-api' end, }, treesitter = { @@ -337,9 +337,28 @@ local config = { end, helptag_fmt = function(name) if name:lower() == 'treesitter' then - return '*lua-treesitter-core*' + return 'lua-treesitter-core' end - return '*lua-treesitter-' .. name:lower() .. '*' + return 'lua-treesitter-' .. name:lower() + end, + }, + editorconfig = { + filename = 'editorconfig.txt', + files = { + 'runtime/lua/editorconfig.lua', + }, + section_order = { + 'editorconfig.lua', + }, + section_fmt = function(_name) + return 'EditorConfig integration' + end, + helptag_fmt = function(name) + return name:lower() + end, + fn_xform = function(fun) + fun.table = true + fun.name = vim.split(fun.name, '.', { plain = true })[2] end, }, } @@ -600,7 +619,7 @@ local function render_fun_header(fun, cfg) cfg.fn_helptag_fmt = fn_helptag_fmt_common end - local tag = cfg.fn_helptag_fmt(fun) + local tag = '*' .. cfg.fn_helptag_fmt(fun) .. '*' if #proto + #tag > TEXT_WIDTH - 8 then table.insert(ret, fmt('%78s\n', tag)) @@ -816,7 +835,7 @@ local function make_section(filename, cfg, section_docs, funs_txt) local sectname = cfg.section_name and cfg.section_name[filename] or mktitle(name) -- section tag: e.g., "*api-autocmd*" - local help_tag = cfg.helptag_fmt(sectname) + local help_tag = '*' .. cfg.helptag_fmt(sectname) .. '*' if funs_txt == '' and #section_docs == 0 then return @@ -845,9 +864,9 @@ local function render_section(section, add_header) }) end - if section.doc and #section.doc > 0 then - table.insert(doc, '\n\n') - vim.list_extend(doc, section.doc) + local sdoc = '\n\n' .. table.concat(section.doc or {}, '\n') + if sdoc:find('[^%s]') then + doc[#doc + 1] = sdoc end if section.funs_txt then @@ -880,6 +899,7 @@ end --- @param cfg nvim.gen_vimdoc.Config local function gen_target(cfg) + print('Target:', cfg.filename) local sections = {} --- @type table expand_files(cfg.files) @@ -891,7 +911,7 @@ local function gen_target(cfg) local all_classes = {} --- First pass so we can collect all classes - for _, f in pairs(cfg.files) do + for _, f in vim.spairs(cfg.files) do local ext = assert(f:match('%.([^.]+)$')) --[[@as 'h'|'c'|'lua']] local parser = assert(parsers[ext]) local classes, funs, briefs = parser(f) @@ -899,13 +919,14 @@ local function gen_target(cfg) all_classes = vim.tbl_extend('error', all_classes, classes) end - for f, r in pairs(file_results) do + for f, r in vim.spairs(file_results) do local classes, funs, briefs = r[1], r[2], r[3] local briefs_txt = {} --- @type string[] for _, b in ipairs(briefs) do briefs_txt[#briefs_txt + 1] = md_to_vimdoc(b, 0, 0, TEXT_WIDTH) end + print(' Processing file:', f) local funs_txt = render_funs(funs, all_classes, cfg) if next(classes) then local classes_txt = render_classes(classes) @@ -923,8 +944,9 @@ local function gen_target(cfg) for _, f in ipairs(cfg.section_order) do local section = sections[f] if section then + print(string.format(" Rendering section: '%s'", section.title)) local add_sep_and_header = not vim.tbl_contains(cfg.append_only or {}, f) - table.insert(docs, render_section(section, add_sep_and_header)) + docs[#docs + 1] = render_section(section, add_sep_and_header) end end @@ -945,7 +967,7 @@ local function gen_target(cfg) end local function run() - for _, cfg in pairs(config) do + for _, cfg in vim.spairs(config) do gen_target(cfg) end end diff --git a/scripts/text_utils.lua b/scripts/text_utils.lua index 937408c546..75b3bfedd5 100644 --- a/scripts/text_utils.lua +++ b/scripts/text_utils.lua @@ -318,7 +318,7 @@ local function align_tags(text_width) --- @param line string --- @return string return function(line) - local tag_pat = '%s+(%*[^ ]+%*)%s*$' + local tag_pat = '%s*(%*.+%*)%s*$' local tags = {} for m in line:gmatch(tag_pat) do table.insert(tags, m) @@ -327,7 +327,9 @@ local function align_tags(text_width) if #tags > 0 then line = line:gsub(tag_pat, '') local tags_str = ' ' .. table.concat(tags, ' ') - local pad = string.rep(' ', text_width - #line - #tags_str) + --- @type integer + local conceal_offset = select(2, tags_str:gsub('%*', '')) - 2 + local pad = string.rep(' ', text_width - #line - #tags_str + conceal_offset) return line .. pad .. tags_str end @@ -352,7 +354,7 @@ function M.md_to_vimdoc(text, start_indent, indent, text_width, is_list) local s = table.concat(lines, '\n') -- Reduce whitespace in code-blocks - s = s:gsub('\n+%s*>([a-z]+)\n?\n', ' >%1\n') + s = s:gsub('\n+%s*>([a-z]+)\n', ' >%1\n') s = s:gsub('\n+%s*>\n?\n', ' >\n') return s -- cgit From 14e4b6bbd8640675d7393bdeb3e93d74ab875ff1 Mon Sep 17 00:00:00 2001 From: Lewis Russell Date: Sat, 16 Mar 2024 17:11:42 +0000 Subject: refactor(lua): type annotations --- scripts/gen_vimdoc.lua | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'scripts') diff --git a/scripts/gen_vimdoc.lua b/scripts/gen_vimdoc.lua index b3b211d5a6..cc2dc99237 100755 --- a/scripts/gen_vimdoc.lua +++ b/scripts/gen_vimdoc.lua @@ -488,10 +488,12 @@ local function inline_type(obj, classes) local desc_append = {} for _, f in ipairs(cls.fields) do - local fdesc, default = get_default(f.desc) - local fty = render_type(f.type, nil, default) - local fnm = fmt_field_name(f.name) - table.insert(desc_append, table.concat({ '-', fnm, fty, fdesc }, ' ')) + if not f.access then + local fdesc, default = get_default(f.desc) + local fty = render_type(f.type, nil, default) + local fnm = fmt_field_name(f.name) + table.insert(desc_append, table.concat({ '-', fnm, fty, fdesc }, ' ')) + end end desc = desc .. '\n' .. table.concat(desc_append, '\n') -- cgit From a142670360764fa9bec1f583a93eebeebe9054a2 Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Tue, 26 Mar 2024 14:25:01 +0800 Subject: feat(tui): support undercurl in WezTerm (#28037) Also fix some typos in windows.ti while at it. Close #21699 --- scripts/windows.ti | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'scripts') diff --git a/scripts/windows.ti b/scripts/windows.ti index 34028b8e00..a4916a9830 100644 --- a/scripts/windows.ti +++ b/scripts/windows.ti @@ -25,7 +25,7 @@ win32con|ANSI emulation for libuv on legacy console, Se=\E[0 q, Ss=\E[%p1%d q, use=cygwin, use=libuv+exkey, -conemu|ANIS X3.64 and Xterm 256 colors for ConEmu with libuv, +conemu|ANSI X3.64 and Xterm 256 colors for ConEmu with libuv, ccc@, mc5i@, xenl@, acsc@, rmacs@, smacs@, blink@, cbt@, cvvis@, cnorm=\E[?25h, cud1=\E[B, dim@, flash@, hts@, initc@, invis@, is2@, kf46@, kf47@, kf48@, kf49@, kf50@, kf51@, kf52@, kf53@, kf54@, @@ -47,7 +47,7 @@ conemu|ANIS X3.64 and Xterm 256 colors for ConEmu with libuv, kUP3@, kUP4@, kUP5@, kUP6@, kUP7@, rmxx@, smxx@, xm@, use=libuv+basekey, use=libuv+exkey, use=xterm+256color, use=xterm-new, -vtpcon|ANIS emulation for console virtual terminal sequence with libuv, +vtpcon|ANSI emulation for console virtual terminal sequence with libuv, ccc@, mc5i@, xenl@, blink@, acsc=jjkkllmmnnqqttuuvvwwxx, cvvis@, cud1=\E[B, dim@, flash@, initc=\E]4;%p1%d;rgb\:%p2%{255}%*%{1000}%/%2.2X/%p3%{255}%*%{1000}%/%2.2X/%p4%{255}%*%{1000}%/%2.2X\E, -- cgit From 7d971500847089ec8ade926a7f84d6bb3a51c8b0 Mon Sep 17 00:00:00 2001 From: Lewis Russell Date: Mon, 25 Mar 2024 22:06:31 +0000 Subject: fix(treesitter): return correct match table in iter_captures() --- scripts/luacats_parser.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'scripts') diff --git a/scripts/luacats_parser.lua b/scripts/luacats_parser.lua index cd671fb9dc..cb301b32e4 100644 --- a/scripts/luacats_parser.lua +++ b/scripts/luacats_parser.lua @@ -281,8 +281,8 @@ local function filter_decl(line) -- M.fun = vim._memoize(function(...) -- -> -- function M.fun(...) - line = line:gsub('^local (.+) = .*_memoize%([^,]+, function%((.*)%)$', 'local function %1(%2)') - line = line:gsub('^(.+) = .*_memoize%([^,]+, function%((.*)%)$', 'function %1(%2)') + line = line:gsub('^local (.+) = memoize%([^,]+, function%((.*)%)$', 'local function %1(%2)') + line = line:gsub('^(.+) = memoize%([^,]+, function%((.*)%)$', 'function %1(%2)') return line end -- cgit From 981301d11f83f5e9b7425cd383e59bbe0d7afdd5 Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Thu, 28 Mar 2024 10:23:07 +0800 Subject: build(terminfo): include user capabilities in comments (#28066) Add -x flag to infocmp, so that comments match the content. --- scripts/update_terminfo.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/update_terminfo.sh b/scripts/update_terminfo.sh index e12365ba8f..34525dec32 100755 --- a/scripts/update_terminfo.sh +++ b/scripts/update_terminfo.sh @@ -77,7 +77,7 @@ for term in $sorted_terms; do continue fi printf '\n' - infocmp -L -1 -A "$db" "$term" | sed -e '1d' -e 's#^#// #' | tr '\t' ' ' + infocmp -L -x -1 -A "$db" "$term" | sed -e '1d' -e 's#^#// #' | tr '\t' ' ' printf 'static const int8_t %s[] = {\n' "${entries[$term]}" printf ' ' od -v -t d1 < "$path" | cut -c9- | xargs | tr ' ' ',' -- cgit From 978962f9a00ce75216d2c36b79397ef3d2b54096 Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Mon, 8 Apr 2024 17:46:41 +0800 Subject: build(release.sh): regenerate docs after changing NVIM_API_PRERELEASE (#28229) After #25574, the value of NVIM_API_PRERELEASE can affect docs, so docs need to be regenerated after changing NVIM_API_PRERELEASE. --- scripts/release.sh | 2 ++ 1 file changed, 2 insertions(+) (limited to 'scripts') diff --git a/scripts/release.sh b/scripts/release.sh index 4321d96f62..f798b81d6a 100755 --- a/scripts/release.sh +++ b/scripts/release.sh @@ -61,6 +61,8 @@ _do_release_commit() { $__sed -i.bk 's/(NVIM_API_PRERELEASE) true/\1 false/' CMakeLists.txt build/bin/nvim --api-info > "test/functional/fixtures/api_level_$__API_LEVEL.mpack" git add "test/functional/fixtures/api_level_${__API_LEVEL}.mpack" + build/bin/nvim -u NONE -l scripts/gen_vimdoc.lua + git add -u -- runtime/doc/ fi $__sed -i.bk 's,(),\1\ -- cgit From 7035125b2b26aa68fcfb7cda39377ac79926a0f9 Mon Sep 17 00:00:00 2001 From: dundargoc Date: Mon, 8 Apr 2024 11:03:20 +0200 Subject: test: improve test conventions Work on https://github.com/neovim/neovim/issues/27004. --- scripts/legacy2luatest.pl | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'scripts') diff --git a/scripts/legacy2luatest.pl b/scripts/legacy2luatest.pl index 8155353fc7..84a8889c82 100755 --- a/scripts/legacy2luatest.pl +++ b/scripts/legacy2luatest.pl @@ -282,9 +282,9 @@ open my $spec_file_handle, ">", $spec_file; print $spec_file_handle <<"EOS"; @{[join "\n", @{$description_lines}]} -local helpers = require('test.functional.helpers') -local feed, insert, source = helpers.feed, helpers.insert, helpers.source -local clear, execute, expect = helpers.clear, helpers.execute, helpers.expect +local t = require('test.functional.testutil') +local feed, insert, source = t.feed, t.insert, t.source +local clear, execute, expect = t.clear, t.execute, t.expect describe('$test_name', function() before_each(clear) -- cgit From 9912a4c81b0856200f44a38e99d38eae44cef5c9 Mon Sep 17 00:00:00 2001 From: "Justin M. Keyes" Date: Mon, 22 Apr 2024 00:58:48 +0200 Subject: refactor(lua): deprecate tbl_flatten Problem: Besides being redundant with vim.iter():flatten(), `tbl_flatten` has these problems: - Has `tbl_` prefix but only accepts lists. - Discards some results! Compare the following: - iter.flatten(): ``` vim.iter({1, { { a = 2 } }, { 3 } }):flatten():totable() ``` - tbl_flatten: ``` vim.tbl_flatten({1, { { a = 2 } }, { 3 } }) ``` Solution: Deprecate tbl_flatten. Note: iter:flatten() currently fails ("flatten() requires a list-like table") on this code from gen_lsp.lua: local anonym = vim.iter({ -- remove nil anonymous_num > 1 and '' or nil, '---@class ' .. anonymous_classname, }):flatten():totable() Should we enhance :flatten() to work for arrays? --- scripts/gen_lsp.lua | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'scripts') diff --git a/scripts/gen_lsp.lua b/scripts/gen_lsp.lua index 19fad7bab4..04d19f22e6 100644 --- a/scripts/gen_lsp.lua +++ b/scripts/gen_lsp.lua @@ -259,10 +259,13 @@ function M.gen(opt) if prefix then anonymous_classname = anonymous_classname .. '.' .. prefix end - local anonym = vim.tbl_flatten { -- remove nil - anonymous_num > 1 and '' or nil, - '---@class ' .. anonymous_classname, - } + local anonym = vim + .iter({ + (anonymous_num > 1 and { '' } or {}), + { '---@class ' .. anonymous_classname }, + }) + :flatten() + :totable() --- @class vim._gen_lsp.StructureLiteral translated to anonymous @class. --- @field deprecated? string -- cgit From 052498ed42780a76daea589d063cd8947a894673 Mon Sep 17 00:00:00 2001 From: dundargoc Date: Sat, 20 Apr 2024 17:44:13 +0200 Subject: test: improve test conventions Specifically, functions that are run in the context of the test runner are put in module `test/testutil.lua` while the functions that are run in the context of the test session are put in `test/functional/testnvim.lua`. Closes https://github.com/neovim/neovim/issues/27004. --- scripts/legacy2luatest.pl | 300 ---------------------------------------------- 1 file changed, 300 deletions(-) delete mode 100755 scripts/legacy2luatest.pl (limited to 'scripts') diff --git a/scripts/legacy2luatest.pl b/scripts/legacy2luatest.pl deleted file mode 100755 index 84a8889c82..0000000000 --- a/scripts/legacy2luatest.pl +++ /dev/null @@ -1,300 +0,0 @@ -#!/usr/bin/env perl - -use strict; -use warnings; -use 5.010; -use autodie; - -use File::Basename; -use File::Spec::Functions; - -sub read_in_file { - my $in_file = $_[0]; - - # Will contain lines before first STARTTEST - # as Lua comments. - my @description_lines = (); - - # Will contain alternating blocks of lines of textual input - # (text between ENDTEST and EOF/next STARTTEST) and test commands - # (commands between STARTTEST and ENDTEST) as Lua code. - my @test_body_lines = (); - - # Will contain current command block, i.e. lines - # between STARTTEST and ENDTEST. - my @command_lines = (); - - # Will contain current input block, i.e. lines - # between ENDTEST and STARTTEST. - my @input_lines = (); - - open my $in_file_handle, '<', $in_file; - - use constant EMIT_DESCRIPTION => 0; - use constant EMIT_COMMAND => 1; - use constant EMIT_INPUT => 2; - - # Push lines from current input and - # command blocks into @test_body_lines - # in the correct order. - sub end_input { - my $input_lines = $_[0]; - my $command_lines = $_[1]; - my $test_body_lines = $_[2]; - - # If there are input lines, wrap with an `insert` - # command and add before the previous command block. - if (@{$input_lines}) { - my $last_input_line = pop @{$input_lines}; - unshift @{$command_lines}, ''; - unshift @{$command_lines}, $last_input_line . ']=])'; - unshift @{$command_lines}, @{$input_lines}; - unshift @{$command_lines}, "insert([=["; - - @{$input_lines} = (); - } - - # Output remaining command lines. - push @{$test_body_lines}, @{$command_lines}; - @{$command_lines} = (); - } - - sub format_comment { - # Handle empty comments. - if (/^$/) { - return ''; - } - - # Capitalize first character and emit as Lua comment. - my $comment = '-- ' . ucfirst $_; - - # Add trailing dot if not already there. - $comment .= '.' unless $comment =~ /\.$/; - - return $comment; - } - - my %states = ( - # Add test description to @description_lines. - EMIT_DESCRIPTION() => sub { - if (/^STARTTEST/) { - return EMIT_COMMAND; - } - - # If not an empty line, emit as Lua comment. - if (!/^$/) { - # Remove modeline - s/vim:.*set f\w+=vim//g; - # Remove trailing ":" - s/\s*:\s*$//g; - push @description_lines, '-- ' . $_; - } - - return EMIT_DESCRIPTION; - }, - # Add test commands to @command_lines. - EMIT_COMMAND() => sub { - if (/^ENDTEST/) { - return EMIT_INPUT; - } - - # If line starts with ':"', emit a comment. - if (/^:"/) { - # Remove Vim comment prefix. - s/^:"\s*//; - - push @command_lines, format_comment $_; - - return EMIT_COMMAND; - } - - # Extract possible inline comment. - if (/^[^"]*"[^"]*$/) { - # Remove command part and prepended whitespace. - s/^(.*?)\s*"\s*//; - - push @command_lines, format_comment $_; - - # Set implicit variable to command without comment. - $_ = $1; - } - - # Only continue if remaining command is not empty. - if (!/^:?\s*$/) { - # Replace terminal escape characters with . - s/\e//g; - - my $startstr = "'"; - my $endstr = "'"; - - # If line contains single quotes or backslashes, use double - # square brackets to wrap string. - if (/'/ || /\\/) { - # If the line contains a closing square bracket, - # wrap it with [=[...]=]. - if (/\]/) { - $startstr = '[=['; - $endstr = ']=]'; - } else { - $startstr = '[['; - $endstr = ']]'; - } - } - - # Emit 'feed' if not a search ('/') or ex (':') command. - if (!/^\// && !/^:/) { - # If command does not end with , insert trailing . - my $command = 'feed(' . $startstr . $_; - $command .= '' unless /$/; - $command .= $endstr . ')'; - - push @command_lines, $command; - } else { - # Remove prepending ':'. - s/^://; - push @command_lines, 'execute(' . $startstr . $_ . $endstr . ')'; - } - } - - return EMIT_COMMAND; - }, - # Add input to @input_lines. - EMIT_INPUT() => sub { - if (/^STARTTEST/) { - end_input \@input_lines, \@command_lines, \@test_body_lines; - return EMIT_COMMAND; - } - - # Skip initial lines if they are empty. - if (@input_lines or !/^$/) { - push @input_lines, ' ' . $_; - } - return EMIT_INPUT; - }, - ); - - my $state = EMIT_DESCRIPTION; - - while (<$in_file_handle>) { - # Remove trailing newline character and process line. - chomp; - $state = $states{$state}->($_); - } - - # If not all lines have been processed yet, - # do it now. - end_input \@input_lines, \@command_lines, \@test_body_lines; - - close $in_file_handle; - - return (\@description_lines, \@test_body_lines); -} - -sub read_ok_file { - my $ok_file = $_[0]; - my @assertions = (); - - if (-f $ok_file) { - push @assertions, ''; - push @assertions, "-- Assert buffer contents."; - push @assertions, "expect([=["; - - open my $ok_file_handle, '<', $ok_file; - - while (<$ok_file_handle>) { - # Remove trailing newline character and process line. - chomp; - push @assertions, ' ' . $_; - } - - close $ok_file_handle; - - $assertions[-1] .= "]=])"; - } - - return \@assertions; -} - -my $legacy_testfile = $ARGV[0]; -my $out_dir = $ARGV[1]; - -if ($#ARGV != 1) { - say "Convert a legacy Vim test to a Neovim lua spec."; - say ''; - say "Usage: $0 legacy-testfile output-directory"; - say ''; - say "legacy-testfile: Path to .in or .ok file."; - say "output-directory: Directory where Lua spec will be saved to."; - say ''; - say "Note: Only works reliably for fairly simple tests."; - say " Manual adjustments to generated spec files are required."; - exit 1; -} - -my @legacy_suffixes = ('.in', '.ok'); -my ($base_name, $base_path, $suffix) = fileparse($legacy_testfile, @legacy_suffixes); -my $in_file = catfile($base_path, $base_name . '.in'); -my $ok_file = catfile($base_path, $base_name . '.ok'); - -# Remove leading 'test'. -my $test_name = $base_name; -$test_name =~ s/^test_?//; - -my $spec_file = do { - if ($test_name =~ /^([0-9]+)/) { - catfile($out_dir, sprintf('%03d', $1) . '_spec.lua') - } else { - catfile($out_dir, $test_name . '_spec.lua') - } -}; - -if (! -f $in_file) { - say "Test input file $in_file not found."; - exit 2; -} - -if (! -d $out_dir) { - say "Output directory $out_dir does not exist."; - exit 3; -} - -if (-f $spec_file) { - say "Output file $spec_file already exists."; - print "Overwrite (Y/n)? "; - my $input = ; - chomp($input); - unless ($input =~ /^y|Y/) { - say "Aborting."; - exit 4; - } -} - -# Read .in and .ok files. -my ($description_lines, $test_body_lines) = read_in_file $in_file; -my $assertion_lines = read_ok_file $ok_file; - -# Append assertions to test body. -push @{$test_body_lines}, @{$assertion_lines} if @{$assertion_lines}; - -# Write spec file. -open my $spec_file_handle, ">", $spec_file; - -print $spec_file_handle <<"EOS"; -@{[join "\n", @{$description_lines}]} - -local t = require('test.functional.testutil') -local feed, insert, source = t.feed, t.insert, t.source -local clear, execute, expect = t.clear, t.execute, t.expect - -describe('$test_name', function() - before_each(clear) - - it('is working', function() -@{[join "\n", map { /^$/ ? '' : ' ' . $_ } @{$test_body_lines}]} - end) -end) -EOS - -close $spec_file_handle; - -say "Written to $spec_file." -- cgit From 71cf75f96a67aeb79ac3af6aa829bac81bd2d33d Mon Sep 17 00:00:00 2001 From: "Justin M. Keyes" Date: Tue, 30 Apr 2024 04:30:21 -0700 Subject: docs: misc #24163 - Also delete old perl scripts which are not used since 8+ years ago. fix #23251 fix #27367 ref https://github.com/neovim/neovim/issues/2252#issuecomment-1902662577 Helped-by: Daniel Kongsgaard Co-authored-by: Kevin Pham --- scripts/movedocs.pl | 180 ---------------------------------------------------- 1 file changed, 180 deletions(-) delete mode 100755 scripts/movedocs.pl (limited to 'scripts') diff --git a/scripts/movedocs.pl b/scripts/movedocs.pl deleted file mode 100755 index 923c633f13..0000000000 --- a/scripts/movedocs.pl +++ /dev/null @@ -1,180 +0,0 @@ -#!/usr/bin/perl - -use strict; -use warnings; - -if ($ARGV[0] eq '--help') { - print << "EOF"; -Usage: - - $0 file.h file.c - -Removes documentation attached to function declarations in file.h and adds them -to function definitions found in file.c. - - $0 file.c - -Moves documentation attached to function declaration present in the same file as -the definition. -EOF - exit 0; -} - -my $hfile = shift @ARGV; -my @cfiles = @ARGV; - -my %docs = (); -my $F; - -sub write_lines { - my $file = shift; - my @lines = @_; - - my $F; - - open $F, '>', $file; - print $F (join "", @lines); - close $F; -} - -if (@cfiles) { - open $F, '<', $hfile - or die "Failed to open $hfile."; - - my @hlines = (); - - my $lastdoc = ''; - - while (<$F>) { - if (/^\/\/\/?/) { - $lastdoc .= $_; - } elsif (/^\S.*?(\w+)\(.*(?:,|\);?|FUNC_ATTR_\w+;?)$/) { - die "Documentation for $1 was already defined" if (defined $docs{$1}); - if ($lastdoc ne '') { - $docs{$1} = $lastdoc; - $lastdoc = ''; - } - push @hlines, $_; - } elsif ($lastdoc ne '') { - push @hlines, $lastdoc; - $lastdoc = ''; - push @hlines, $_; - } else { - push @hlines, $_; - } - } - - close $F; - - my %clines_hash = (); - - for my $cfile (@cfiles) { - open $F, '<', $cfile - or die "Failed to open $cfile."; - - my @clines = (); - - while (<$F>) { - if (/^\S.*?(\w+)\(.*[,)]$/ and defined $docs{$1}) { - push @clines, $docs{$1}; - delete $docs{$1}; - } elsif (/^(?!static\s)\S.*?(\w+)\(.*[,)]$/ and not defined $docs{$1}) { - print STDERR "Documentation not defined for $1\n"; - } - push @clines, $_; - } - - close $F; - - $clines_hash{$cfile} = \@clines; - } - - while (my ($func, $value) = each %docs) { - die "Function not found: $func\n"; - } - - write_lines($hfile, @hlines); - while (my ($cfile, $clines) = each %clines_hash) { - write_lines($cfile, @$clines); - } -} else { - open $F, '<', $hfile; - - my @lines; - - my $lastdoc = ''; - my $defstart = ''; - my $funcname; - - sub clear_lastdoc { - if ($lastdoc ne '') { - push @lines, $lastdoc; - $lastdoc = ''; - } - } - - sub record_lastdoc { - my $funcname = shift; - if ($lastdoc ne '') { - $docs{$funcname} = $lastdoc; - $lastdoc = ''; - } - } - - sub add_doc { - my $funcname = shift; - if (defined $docs{$funcname}) { - push @lines, $docs{$funcname}; - delete $docs{$funcname}; - } - } - - sub clear_defstart { - push @lines, $defstart; - $defstart = ''; - } - - while (<$F>) { - if (/\/\*/ .. /\*\// and not /\/\*.*?\*\//) { - push @lines, $_; - } elsif (/^\/\/\/?/) { - $lastdoc .= $_; - } elsif (/^\S.*?(\w+)\(.*(?:,|(\);?))$/) { - if (not $2) { - $defstart .= $_; - $funcname = $1; - } elsif ($2 eq ');') { - record_lastdoc $1; - push @lines, $_; - } elsif ($2 eq ')') { - clear_lastdoc; - add_doc $1; - push @lines, $_; - } - } elsif ($defstart ne '') { - $defstart .= $_; - if (/[{}]/) { - clear_lastdoc; - clear_defstart; - } elsif (/\);$/) { - record_lastdoc $funcname; - clear_defstart; - } elsif (/\)$/) { - clear_lastdoc; - add_doc $funcname; - clear_defstart; - } - } else { - clear_lastdoc; - push @lines, $_; - } - } - - close $F; - - while (my ($func, $value) = each %docs) { - die "Function not found: $func\n"; - } - - write_lines($hfile, @lines); -} -- cgit From dafa51c16d9bdaec5011b591b0ce8dff287624b7 Mon Sep 17 00:00:00 2001 From: "Justin M. Keyes" Date: Tue, 30 Apr 2024 06:06:14 -0700 Subject: docs(api): sort unreleased nvim__ functions last #28580 --- scripts/gen_vimdoc.lua | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/gen_vimdoc.lua b/scripts/gen_vimdoc.lua index cc2dc99237..085b1f5bea 100755 --- a/scripts/gen_vimdoc.lua +++ b/scripts/gen_vimdoc.lua @@ -768,10 +768,17 @@ local function render_funs(funs, classes, cfg) ret[#ret + 1] = render_fun(f, classes, cfg) end - -- Sort via prototype + -- Sort via prototype. Experimental API functions ("nvim__") sort last. table.sort(ret, function(a, b) local a1 = ('\n' .. a):match('\n[a-zA-Z_][^\n]+\n') local b1 = ('\n' .. b):match('\n[a-zA-Z_][^\n]+\n') + + local a1__ = a1:find('^%s*nvim__') and 1 or 0 + local b1__ = b1:find('^%s*nvim__') and 1 or 0 + if a1__ ~= b1__ then + return a1__ < b1__ + end + return a1:lower() < b1:lower() end) -- cgit From cb24a3907c8d24a898d99042f0f16c8919a2e7ab Mon Sep 17 00:00:00 2001 From: "Justin M. Keyes" Date: Tue, 30 Apr 2024 09:37:45 -0700 Subject: docs: format vim_diff.txt for "flow" layout #28584 --- scripts/gen_help_html.lua | 2 ++ 1 file changed, 2 insertions(+) (limited to 'scripts') diff --git a/scripts/gen_help_html.lua b/scripts/gen_help_html.lua index 43040151eb..8a5afad337 100644 --- a/scripts/gen_help_html.lua +++ b/scripts/gen_help_html.lua @@ -66,10 +66,12 @@ local new_layout = { ['lua.txt'] = true, ['luaref.txt'] = true, ['news.txt'] = true, + ['news-0.9.txt'] = true, ['nvim.txt'] = true, ['pi_health.txt'] = true, ['provider.txt'] = true, ['ui.txt'] = true, + ['vim_diff.txt'] = true, } -- TODO: These known invalid |links| require an update to the relevant docs. -- cgit From 01e4a70d668d54a7cefa3ff53ec97e39df516265 Mon Sep 17 00:00:00 2001 From: dundargoc Date: Thu, 2 May 2024 00:15:56 +0200 Subject: build: improve git-cliff CHANGELOG output - Sort sections according to custom preference instead of alphabetically. It is ordered according to "most relevant" to "least relevant" to users. - Sort commits alphabetically - Don't uppercase the first letter of the commit message --- scripts/cliff.toml | 41 ++++++++++++++++++++--------------------- 1 file changed, 20 insertions(+), 21 deletions(-) (limited to 'scripts') diff --git a/scripts/cliff.toml b/scripts/cliff.toml index 3fc10e5d16..ac060b7796 100644 --- a/scripts/cliff.toml +++ b/scripts/cliff.toml @@ -1,4 +1,4 @@ -# configuration file for git-cliff (0.1.0) +# configuration file for git-cliff [changelog] # changelog header @@ -7,7 +7,8 @@ header = """ All notable changes to this project will be documented in this file.\n """ # template for the changelog body -# https://tera.netlify.app/docs/#introduction +# https://github.com/Keats/tera +# https://keats.github.io/tera/docs/ body = """ {% if version %}\ ## [{{ version | trim_start_matches(pat="v") }}] - {{ timestamp | date(format="%Y-%m-%d") }} @@ -15,25 +16,21 @@ body = """ ## [unreleased] {% endif %}\ {% for group, commits in commits | group_by(attribute="group") %} - ### {{ group | upper_first }} - {% for commit in commits%}\ + ### {{ group | striptags | upper_first }} + {% for commit in commits | sort(attribute="message")%}\ {% if not commit.scope %}\ - - {{ commit.message | upper_first }} + - {{ commit.message }} {% endif %}\ {% endfor %}\ {% for group, commits in commits | group_by(attribute="scope") %}\ - {% for commit in commits %}\ - - **{{commit.scope}}**: {{ commit.message | upper_first }} + {% for commit in commits | sort(attribute="message") %}\ + - **{{commit.scope}}**: {{ commit.message }} {% endfor %}\ {% endfor %} {% endfor %}\n """ # remove the leading and trailing whitespace from the template trim = true -# changelog footer -footer = """ - -""" [git] # parse the commits based on https://www.conventionalcommits.org @@ -48,16 +45,18 @@ commit_preprocessors = [ ] # regex for parsing and grouping commits commit_parsers = [ - { message = "!:", group = "Breaking"}, - { message = "^feat", group = "Features"}, - { message = "^fix", group = "Bug Fixes"}, - { message = "^doc", group = "Documentation"}, - { message = "^perf", group = "Performance"}, - { message = "^refactor", group = "Refactor"}, - { message = "^test", group = "Testing"}, - { message = "^chore", group = "Miscellaneous Tasks"}, - { message = "^build", group = "Build System"}, - { message = "^Revert", group = "Reverted Changes"}, + { message = "!:", group = "Breaking"}, + { message = "^feat", group = "Features"}, + { message = "^fix", group = "Bug Fixes"}, + { message = "^perf", group = "Performance"}, + { message = "^build", group = "Build System"}, + { message = "^vim-patch", group = "Vim patches"}, + { message = "^refactor", group = "Refactor" }, + { message = "^ci", group = "CI" }, + { message = "^test", group = "Testing" }, + { message = "^docs", group = "Documentation" }, + { message = "^revert", group = "Reverted Changes" }, + { message = ".*", group = "Other"}, ] # filter out the commits that are not matched by commit parsers filter_commits = true -- cgit From 93940af1d456ec52f39cb2912b5ffb8445d26c98 Mon Sep 17 00:00:00 2001 From: James Trew Date: Thu, 2 May 2024 23:33:22 -0400 Subject: docs(luacats): support backtick captured generic type Problem: While LuaCATS's generics system are still considered WIP by luals, they currently support type captured generics. See "Capture with Backtick" example: https://luals.github.io/wiki/annotations/#generic Solution: Add support for it in the LuaCATS grammar --- scripts/luacats_grammar.lua | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/luacats_grammar.lua b/scripts/luacats_grammar.lua index ca26c70156..29f3bda5aa 100644 --- a/scripts/luacats_grammar.lua +++ b/scripts/luacats_grammar.lua @@ -170,7 +170,7 @@ local grammar = P { ltype = parenOpt(v.ty_union), ty_union = v.ty_opt * rep(Pf('|') * v.ty_opt), - ty = v.ty_fun + ident + v.ty_table + literal + paren(v.ty), + ty = v.ty_fun + ident + v.ty_table + literal + paren(v.ty) + v.ty_generic, ty_param = Pf('<') * comma1(v.ltype) * fill * P('>'), ty_opt = v.ty * opt(v.ty_param) * opt(P('[]')) * opt(P('?')), ty_index = (Pf('[') * (v.ltype + ident + rep1(num)) * fill * P(']')), @@ -179,6 +179,7 @@ local grammar = P { ty_table = Pf('{') * comma1(v.table_elem) * fill * P('}'), fun_param = lname * opt(colon * v.ltype), ty_fun = Pf('fun') * paren(comma(lname * opt(colon * v.ltype))) * opt(colon * comma1(v.ltype)), + ty_generic = P('`') * letter * P('`'), } return grammar --[[@as nvim.luacats.grammar]] -- cgit From 854c362cc88786b45e7c94a124c718dac0a03660 Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Sat, 11 May 2024 17:43:23 +0800 Subject: vim-patch:b23c1fc59650 (#28702) runtime(doc): Add Makefile for the Vim documentation on Windows (vim/vim#13467) * Makefile for the Vim documentation on Windows * Corrected comments https://github.com/vim/vim/commit/b23c1fc596501a8dfc0355ed8084dcbf018f7907 Co-authored-by: Restorer <69863286+RestorerZ@users.noreply.github.com> --- scripts/check_urls.vim | 49 +++++++++++++++++++++++++++++++++++-------------- 1 file changed, 35 insertions(+), 14 deletions(-) (limited to 'scripts') diff --git a/scripts/check_urls.vim b/scripts/check_urls.vim index 3580b79475..e23f87966b 100644 --- a/scripts/check_urls.vim +++ b/scripts/check_urls.vim @@ -6,21 +6,41 @@ " Written by Christian Brabandt. func Test_check_URLs() +"20.10.23, added by Restorer if has("win32") - echoerr "Doesn't work on MS-Windows" - return + let s:outdev = 'nul' + else + let s:outdev = '/dev/null' endif +" Restorer: For Windows users. If "curl" or "weget" is installed on the system +" but not in %PATH%, add the full routes for them to this environment variable. if executable('curl') " Note: does not follow redirects! - let s:command = 'curl --silent --fail --output /dev/null --head ' + let s:command1 = 'curl --silent --fail --output ' ..s:outdev.. ' --head ' + let s:command2 = "" elseif executable('wget') " Note: only allow a couple of redirects - let s:command = 'wget --quiet -S --spider --max-redirect=2 --timeout=5 --tries=2 -O /dev/null ' + let s:command1 = 'wget --quiet -S --spider --max-redirect=2 --timeout=5 --tries=2 -O ' ..s:outdev.. ' ' + let s:command2 = "" + elseif has("win32") "20.10.23, added by Restorer + if executable('powershell') + if 2 == system('powershell -nologo -noprofile "$psversiontable.psversion.major"') + echoerr 'To work in OS Windows requires the program "PowerShell" version 3.0 or higher' + return + endif + let s:command1 = + \ "powershell -nologo -noprofile \"{[Net.ServicePointManager]::SecurityProtocol = 'Tls12, Tls11, Tls, Ssl3'};try{(Invoke-WebRequest -MaximumRedirection 2 -TimeoutSec 5 -Uri " + let s:command2 = ').StatusCode}catch{exit [int]$Error[0].Exception.Status}"' + endif else - echoerr 'Only works when "curl" or "wget" is available' + echoerr 'Only works when "curl" or "wget", or "powershell" is available' return endif + " Do the testing. + set report =999 + set nomore shm +=s + let pat='\(https\?\|ftp\)://[^\t* ]\+' exe 'helpgrep' pat helpclose @@ -36,22 +56,21 @@ func Test_check_URLs() put =urls " remove some more invalid items " empty lines - v/./d + "20.10.23, Restorer: '_' is a little faster, see `:h global` + v/./d _ " remove # anchors %s/#.*$//e " remove trailing stuff (parenthesis, dot, comma, quotes), but only for HTTP " links - g/^h/s#[.,)'"/>][:.]\?$## - g#^[hf]t\?tp:/\(/\?\.*\)$#d - silent! g/ftp://,$/d - silent! g/=$/d + g/^h/s#[.),'"`/>][:.,]\?$## + g#^[hf]t\?tp:/\(/\?\.*\)$#d _ + silent! g/ftp://,$/d _ + silent! g/=$/d _ let a = getline(1,'$') let a = uniq(sort(a)) - %d + %d _ call setline(1, a) - " Do the testing. - set nomore %s/.*/\=TestURL(submatch(0))/ " highlight the failures @@ -61,8 +80,10 @@ endfunc func TestURL(url) " Relies on the return code to determine whether a page is valid echom printf("Testing URL: %d/%d %s", line('.'), line('$'), a:url) - call system(s:command . shellescape(a:url)) + call system(s:command1 .. shellescape(a:url) .. s:command2) return printf("%s %d", a:url, v:shell_error) endfunc call Test_check_URLs() + +" vim: sw=2 sts=2 et -- cgit From 7a03cd1dba0eeac361a518ee5d92ff81405c3690 Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Sat, 11 May 2024 18:14:03 +0800 Subject: vim-patch:1c5728e0c4a9 (#28703) runtime(doc): update and remove some invalid links closes: vim/vim#14748 https://github.com/vim/vim/commit/1c5728e0c4a9df930879f9f0ca108092d5902194 Co-authored-by: Christian Brabandt --- scripts/check_urls.vim | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'scripts') diff --git a/scripts/check_urls.vim b/scripts/check_urls.vim index e23f87966b..b75dc29c48 100644 --- a/scripts/check_urls.vim +++ b/scripts/check_urls.vim @@ -12,11 +12,11 @@ func Test_check_URLs() else let s:outdev = '/dev/null' endif -" Restorer: For Windows users. If "curl" or "weget" is installed on the system -" but not in %PATH%, add the full routes for them to this environment variable. +" Restorer: For Windows users. If "curl" or "wget" is installed on the system +" but not in %PATH%, add the full path to them to %PATH% environment variable. if executable('curl') " Note: does not follow redirects! - let s:command1 = 'curl --silent --fail --output ' ..s:outdev.. ' --head ' + let s:command1 = 'curl --silent --max-time 5 --fail --output ' ..s:outdev.. ' --head ' let s:command2 = "" elseif executable('wget') " Note: only allow a couple of redirects -- cgit From ebba7ae095d9bb800c43188df848ac4f4733d167 Mon Sep 17 00:00:00 2001 From: gusain71 <115005392+gusain71@users.noreply.github.com> Date: Tue, 14 May 2024 13:23:43 +0200 Subject: docs(gen_help_html.lua): wrap legacy help at word-boundary #28678 Problem: On the page: https://neovim.io/doc/user/dev_vimpatch.html The links extend beyond the container and thus end up behind the navigation to the right. Solution: Add these lines to get_help_html.lua: white-space: normal; word-wrap: break-word; --- scripts/gen_help_html.lua | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'scripts') diff --git a/scripts/gen_help_html.lua b/scripts/gen_help_html.lua index 8a5afad337..7051c8dbc3 100644 --- a/scripts/gen_help_html.lua +++ b/scripts/gen_help_html.lua @@ -1088,13 +1088,13 @@ local function gen_css(fname) padding-bottom: 10px; /* Tabs are used for alignment in old docs, so we must match Vim's 8-char expectation. */ tab-size: 8; - white-space: pre; + white-space: normal; font-size: 16px; font-family: ui-monospace,SFMono-Regular,SF Mono,Menlo,Consolas,Liberation Mono,monospace; + word-wrap: break-word; } .old-help-para pre { - /* All text in .old-help-para is formatted as "white-space:pre" so text following
 is
-         already visually separated by the linebreak. */
+      /* Text following 
 is already visually separated by the linebreak. */
       margin-bottom: 0;
     }
 
-- 
cgit 


From ffb4b50e74657b3b15199972371e0cff84f9cd4a Mon Sep 17 00:00:00 2001
From: zeertzjq 
Date: Wed, 15 May 2024 19:39:35 +0800
Subject: docs(lua): restore missing indexing for vim.bo and vim.wo (#28751)

---
 scripts/gen_vimdoc.lua | 6 ++++++
 1 file changed, 6 insertions(+)

(limited to 'scripts')

diff --git a/scripts/gen_vimdoc.lua b/scripts/gen_vimdoc.lua
index 085b1f5bea..6d0fc46145 100755
--- a/scripts/gen_vimdoc.lua
+++ b/scripts/gen_vimdoc.lua
@@ -614,6 +614,12 @@ local function render_fun_header(fun, cfg)
   if fun.classvar then
     nm = fmt('%s:%s', fun.classvar, nm)
   end
+  if nm == 'vim.bo' then
+    nm = 'vim.bo[{bufnr}]'
+  end
+  if nm == 'vim.wo' then
+    nm = 'vim.wo[{winid}][{bufnr}]'
+  end
 
   local proto = fun.table and nm or nm .. '(' .. table.concat(args, ', ') .. ')'
 
-- 
cgit 


From 01b6bff7e9bc751be20ce7bb68e7ebe3037441de Mon Sep 17 00:00:00 2001
From: "Justin M. Keyes" 
Date: Thu, 2 May 2024 15:57:21 +0200
Subject: docs: news

Set dev_xx.txt help files to use "flow" layout.
---
 scripts/cliff.toml        | 14 ++++++++------
 scripts/gen_help_html.lua |  5 +++++
 2 files changed, 13 insertions(+), 6 deletions(-)

(limited to 'scripts')

diff --git a/scripts/cliff.toml b/scripts/cliff.toml
index ac060b7796..ead7d2b821 100644
--- a/scripts/cliff.toml
+++ b/scripts/cliff.toml
@@ -4,27 +4,29 @@
 # changelog header
 header = """
 # Changelog\n
-All notable changes to this project will be documented in this file.\n
+For notable changes, see runtime/doc/news.txt (or `:help news` in Nvim).\n
+Following is a list of fixes/features commits.\n
 """
 # template for the changelog body
 # https://github.com/Keats/tera
 # https://keats.github.io/tera/docs/
 body = """
 {% if version %}\
-    ## [{{ version | trim_start_matches(pat="v") }}] - {{ timestamp | date(format="%Y-%m-%d") }}
+    # [{{ version | trim_start_matches(pat="v") }}] - {{ timestamp | date(format="%Y-%m-%d") }}
 {% else %}\
-    ## [unreleased]
+    # [unreleased]
 {% endif %}\
 {% for group, commits in commits | group_by(attribute="group") %}
-    ### {{ group | striptags | upper_first }}
+    {{ group | striptags | upper_first }}
+    --------------------------------------------------------------------------------
     {% for commit in commits | sort(attribute="message")%}\
         {% if not commit.scope %}\
-            - {{ commit.message }}
+            - {{ commit.id | truncate(length=12, end="") }} {{ commit.message }}
         {% endif %}\
     {% endfor %}\
     {% for group, commits in commits | group_by(attribute="scope") %}\
         {% for commit in commits | sort(attribute="message") %}\
-            - **{{commit.scope}}**: {{ commit.message }}
+            - {{ commit.id | truncate(length=12, end="") }} {{commit.scope}}: {{ commit.message }}
         {% endfor %}\
     {% endfor %}
 {% endfor %}\n
diff --git a/scripts/gen_help_html.lua b/scripts/gen_help_html.lua
index 7051c8dbc3..d65f3aace2 100644
--- a/scripts/gen_help_html.lua
+++ b/scripts/gen_help_html.lua
@@ -63,10 +63,15 @@ local new_layout = {
   ['channel.txt'] = true,
   ['deprecated.txt'] = true,
   ['develop.txt'] = true,
+  ['dev_style.txt'] = true,
+  ['dev_theme.txt'] = true,
+  ['dev_tools.txt'] = true,
+  ['dev_vimpatch.txt'] = true,
   ['lua.txt'] = true,
   ['luaref.txt'] = true,
   ['news.txt'] = true,
   ['news-0.9.txt'] = true,
+  ['news-0.10.txt'] = true,
   ['nvim.txt'] = true,
   ['pi_health.txt'] = true,
   ['provider.txt'] = true,
-- 
cgit 


From 54044e6dce2f2a0f6785481ae179ffcfd5c7acf3 Mon Sep 17 00:00:00 2001
From: "Justin M. Keyes" 
Date: Wed, 15 May 2024 23:28:20 +0200
Subject: fix(release.sh): ze version is too big

---
 scripts/release.sh | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

(limited to 'scripts')

diff --git a/scripts/release.sh b/scripts/release.sh
index f798b81d6a..f63c199fc9 100755
--- a/scripts/release.sh
+++ b/scripts/release.sh
@@ -31,14 +31,14 @@ __DATE=$(date +'%Y-%m-%d')
 __LAST_TAG=$(git describe --abbrev=0)
 [ -z "$__LAST_TAG" ] && { echo 'ERROR: no tag found'; exit 1; }
 __VERSION_MAJOR=$(grep 'set(NVIM_VERSION_MAJOR' CMakeLists.txt\
-  |$__sed 's/.*NVIM_VERSION_MAJOR ([[:digit:]]).*/\1/')
+  |$__sed 's/.*NVIM_VERSION_MAJOR ([[:digit:]]+).*/\1/')
 __VERSION_MINOR=$(grep 'set(NVIM_VERSION_MINOR' CMakeLists.txt\
-  |$__sed 's/.*NVIM_VERSION_MINOR ([[:digit:]]).*/\1/')
+  |$__sed 's/.*NVIM_VERSION_MINOR ([[:digit:]]+).*/\1/')
 __VERSION_PATCH=$(grep 'set(NVIM_VERSION_PATCH' CMakeLists.txt\
-  |$__sed 's/.*NVIM_VERSION_PATCH ([[:digit:]]).*/\1/')
+  |$__sed 's/.*NVIM_VERSION_PATCH ([[:digit:]]+).*/\1/')
 __VERSION="${__VERSION_MAJOR}.${__VERSION_MINOR}.${__VERSION_PATCH}"
 __API_LEVEL=$(grep 'set(NVIM_API_LEVEL ' CMakeLists.txt\
-  |$__sed 's/.*NVIM_API_LEVEL ([[:digit:]]).*/\1/')
+  |$__sed 's/.*NVIM_API_LEVEL ([[:digit:]]+).*/\1/')
 { [ -z "$__VERSION_MAJOR" ] || [ -z "$__VERSION_MINOR" ] || [ -z "$__VERSION_PATCH" ]; } \
   &&  { echo "ERROR: version parse failed: '${__VERSION}'"; exit 1; }
 __RELEASE_MSG="NVIM v${__VERSION}
-- 
cgit 


From 4399c4932d7b0565932a667e051f6861b8293157 Mon Sep 17 00:00:00 2001
From: "Justin M. Keyes" 
Date: Wed, 15 May 2024 23:56:52 +0200
Subject: build(release.sh): use git cliff, drop old script

---
 scripts/cliff.toml              | 22 ++++++++---------
 scripts/git-log-pretty-since.sh | 52 -----------------------------------------
 scripts/release.sh              | 12 ++++------
 3 files changed, 16 insertions(+), 70 deletions(-)
 delete mode 100755 scripts/git-log-pretty-since.sh

(limited to 'scripts')

diff --git a/scripts/cliff.toml b/scripts/cliff.toml
index ead7d2b821..51725cacfc 100644
--- a/scripts/cliff.toml
+++ b/scripts/cliff.toml
@@ -47,18 +47,18 @@ commit_preprocessors = [
 ]
 # regex for parsing and grouping commits
 commit_parsers = [
-    { message = "!:", group = "Breaking"},
-    { message = "^feat", group = "Features"},
-    { message = "^fix", group = "Bug Fixes"},
-    { message = "^perf", group = "Performance"},
-    { message = "^build", group = "Build System"},
-    { message = "^vim-patch", group = "Vim patches"},
-    { message = "^refactor", group = "Refactor" },
+    { message = "!:", group = "BREAKING"},
+    { message = "^feat", group = "FEATURES"},
+    { message = "^fix", group = "FIXES"},
+    { message = "^perf", group = "PERFORMANCE"},
+    { message = "^build", group = "BUILD"},
+    { message = "^vim-patch", group = "VIM PATCHES"},
+    { message = "^refactor", group = "REFACTOR" },
     { message = "^ci", group = "CI" },
-    { message = "^test", group = "Testing" },
-    { message = "^docs", group = "Documentation" },
-    { message = "^revert", group = "Reverted Changes" },
-    { message = ".*", group = "Other"},
+    { message = "^test", group = "TESTING" },
+    { message = "^docs", group = "DOCUMENTATION" },
+    { message = "^revert", group = "REVERTED CHANGES" },
+    { message = ".*", group = "OTHER"},
 ]
 # filter out the commits that are not matched by commit parsers
 filter_commits = true
diff --git a/scripts/git-log-pretty-since.sh b/scripts/git-log-pretty-since.sh
deleted file mode 100755
index 95dcee23f5..0000000000
--- a/scripts/git-log-pretty-since.sh
+++ /dev/null
@@ -1,52 +0,0 @@
-#!/usr/bin/env bash
-
-# Prints a nicely-formatted commit history.
-#   - Commits are grouped below their merge-commit.
-#   - Issue numbers are moved next to the commit-id.
-#
-# Parameters:
-#   $1    "since" commit
-#   $2    "inverse match" regex pattern
-
-set -e
-set -u
-set -o pipefail
-
-__SINCE=$1
-__INVMATCH=$2
-
-is_merge_commit() {
-  git rev-parse "$1" >/dev/null 2>&1 \
-    || { echo "ERROR: invalid commit: $1"; exit 1; }
-  git log "$1"^2 >/dev/null 2>&1 && return 0 || return 1
-}
-
-# Removes parens from issue/ticket/PR numbers.
-#
-# Example:
-#   in:   3340e08becbf foo (#9423)
-#   out:  3340e08becbf foo #9423
-_deparen() {
-  sed 's/(\(\#[0-9]\{3,\}\))/\1/g'
-}
-
-# Cleans up issue/ticket/PR numbers in the commit descriptions.
-#
-# Example:
-#   in:   3340e08becbf foo (#9423)
-#   out:  3340e08becbf #9423 foo
-_format_ticketnums() {
-  nvim -Es +'g/\v(#[0-9]{3,})/norm! ngEldE0ep' +'%p' | _deparen
-}
-
-for commit in $(git log --format='%H' --first-parent "$__SINCE"..HEAD); do
-  if is_merge_commit "${commit}" ; then
-      if [ -z "$__INVMATCH" ] || ! git log --oneline "${commit}^1..${commit}^2" \
-           | >/dev/null 2>&1 grep -E "$__INVMATCH" ; then
-        git log -1 --oneline "${commit}"
-        git log --format='    %h %s' "${commit}^1..${commit}^2"
-      fi
-  else
-    git log -1 --oneline "${commit}"
-  fi
-done | _format_ticketnums
diff --git a/scripts/release.sh b/scripts/release.sh
index f63c199fc9..8e26ecb244 100755
--- a/scripts/release.sh
+++ b/scripts/release.sh
@@ -43,18 +43,16 @@ __API_LEVEL=$(grep 'set(NVIM_API_LEVEL ' CMakeLists.txt\
   &&  { echo "ERROR: version parse failed: '${__VERSION}'"; exit 1; }
 __RELEASE_MSG="NVIM v${__VERSION}
 
-FEATURES:
-
-FIXES:
-
-CHANGES:
-
 "
 __BUMP_MSG="version bump"
 
 echo "Most recent tag: ${__LAST_TAG}"
 echo "Release version: ${__VERSION}"
 
+_git_log_pretty() {
+  git cliff --config scripts/cliff.toml --unreleased || echo 'git cliff failed'
+}
+
 _do_release_commit() {
   $__sed -i.bk 's/(NVIM_VERSION_PRERELEASE) "-dev"/\1 ""/' CMakeLists.txt
   if grep '(NVIM_API_PRERELEASE true)' CMakeLists.txt > /dev/null; then
@@ -73,7 +71,7 @@ _do_release_commit() {
     echo "Building changelog since ${__LAST_TAG}..."
 
     git add CMakeLists.txt
-    (echo "${__RELEASE_MSG}"; ./scripts/git-log-pretty-since.sh "$__LAST_TAG" 'vim-patch:[^[:space:]]') | git commit --edit -F -
+    (echo "${__RELEASE_MSG}"; _git_log_pretty) | git commit --edit -F -
   fi
 
   git tag --sign -a v"${__VERSION}" -m "NVIM v${__VERSION}"
-- 
cgit 


From 9ca81b025990911c2a0dbda92af39ba84983bac3 Mon Sep 17 00:00:00 2001
From: zeertzjq 
Date: Thu, 16 May 2024 07:21:19 +0800
Subject: build(release.sh): set VIMRUNTIME when regenerating docs (#28765)

---
 scripts/release.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

(limited to 'scripts')

diff --git a/scripts/release.sh b/scripts/release.sh
index 8e26ecb244..257fa127c4 100755
--- a/scripts/release.sh
+++ b/scripts/release.sh
@@ -59,7 +59,7 @@ _do_release_commit() {
     $__sed -i.bk 's/(NVIM_API_PRERELEASE) true/\1 false/' CMakeLists.txt
     build/bin/nvim --api-info > "test/functional/fixtures/api_level_$__API_LEVEL.mpack"
     git add "test/functional/fixtures/api_level_${__API_LEVEL}.mpack"
-    build/bin/nvim -u NONE -l scripts/gen_vimdoc.lua
+    VIMRUNTIME=./runtime build/bin/nvim -u NONE -l scripts/gen_vimdoc.lua
     git add -u -- runtime/doc/
   fi
 
-- 
cgit 


From 174da7fe687bd3bf2f6874620e708db24160c4d7 Mon Sep 17 00:00:00 2001
From: Jongwook Choi 
Date: Tue, 14 May 2024 23:34:14 -0400
Subject: docs(gen_help_html.lua): fix broken pre text, and handle linewrap

Problem:

- Since #28678, pre-formatted text in the online documentation do not
  render whitespaces correctly: should be pre-like text, but shown like
  normal paragraph (see #28754).

- Code blocks with long lines should not be wrapped (e.g. see
  |dev-vimpatch-list-management|).

Solution:

- Use `white-space: pre-wrap`. Compared to `white-space: pre`, this
  option will make long lines including a very long URL wrapped.
  This properly fixes #28754 and #28678.

- Use horizontal scrollbar for the code blocks that are horizontally too
  long, instead of wrapping text. This will make the code easy to read
  while the pre-text block not interfering with the navigation bar.
---
 scripts/gen_help_html.lua | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

(limited to 'scripts')

diff --git a/scripts/gen_help_html.lua b/scripts/gen_help_html.lua
index d65f3aace2..7432f5ecc4 100644
--- a/scripts/gen_help_html.lua
+++ b/scripts/gen_help_html.lua
@@ -1093,14 +1093,19 @@ local function gen_css(fname)
       padding-bottom: 10px;
       /* Tabs are used for alignment in old docs, so we must match Vim's 8-char expectation. */
       tab-size: 8;
-      white-space: normal;
+      white-space: pre-wrap;
       font-size: 16px;
       font-family: ui-monospace,SFMono-Regular,SF Mono,Menlo,Consolas,Liberation Mono,monospace;
       word-wrap: break-word;
     }
-    .old-help-para pre {
+    .old-help-para pre, .old-help-para pre:hover {
       /* Text following 
 is already visually separated by the linebreak. */
       margin-bottom: 0;
+      /* Long lines that exceed the textwidth should not be wrapped (no "pre-wrap").
+         Since text may overflow horizontally, we make the contents to be scrollable
+         (only if necessary) to prevent overlapping with the navigation bar at the right. */
+      white-space: pre;
+      overflow-x: auto;
     }
 
     /* TODO: should this rule be deleted? help tags are rendered as  or , not  */
-- 
cgit 


From 668b5fc155af0289c21eabb304c711634472dea8 Mon Sep 17 00:00:00 2001
From: "Justin M. Keyes" 
Date: Thu, 16 May 2024 01:53:33 -0700
Subject: docs: nvim.appdata.xml, set faq to "flow" layout #28769

---
 scripts/gen_help_html.lua | 1 +
 1 file changed, 1 insertion(+)

(limited to 'scripts')

diff --git a/scripts/gen_help_html.lua b/scripts/gen_help_html.lua
index 7432f5ecc4..9f8b0f18ca 100644
--- a/scripts/gen_help_html.lua
+++ b/scripts/gen_help_html.lua
@@ -67,6 +67,7 @@ local new_layout = {
   ['dev_theme.txt'] = true,
   ['dev_tools.txt'] = true,
   ['dev_vimpatch.txt'] = true,
+  ['faq.txt'] = true,
   ['lua.txt'] = true,
   ['luaref.txt'] = true,
   ['news.txt'] = true,
-- 
cgit 


From 31dc6279693886a628119cd6c779e580faab32fd Mon Sep 17 00:00:00 2001
From: "Justin M. Keyes" 
Date: Thu, 16 May 2024 06:28:27 -0700
Subject: docs: news #28773

---
 scripts/gen_help_html.lua | 1 +
 1 file changed, 1 insertion(+)

(limited to 'scripts')

diff --git a/scripts/gen_help_html.lua b/scripts/gen_help_html.lua
index 9f8b0f18ca..b33a94dca5 100644
--- a/scripts/gen_help_html.lua
+++ b/scripts/gen_help_html.lua
@@ -50,6 +50,7 @@ local spell_dict = {
 local spell_ignore_files = {
   ['backers.txt'] = true,
   ['news.txt'] = { 'tree-sitter' }, -- in news, may refer to the upstream "tree-sitter" library
+  ['news-0.10.txt'] = { 'tree-sitter' },
 }
 local language = nil
 
-- 
cgit 


From 878dcf19807ad880fadac200b65619e237492460 Mon Sep 17 00:00:00 2001
From: Jongwook Choi 
Date: Wed, 15 May 2024 21:53:14 -0400
Subject: docs(gen_help_html.lua): handle modeline and note nodes

Problem:

'modeline' and 'note' are unhandled in the online HTML documentation.

Some (not all) modelines are parsed by the vimdoc parser as a node of
type 'modeline'.

Solution:

- Ignore 'modeline' in HTML rendering.
- Render 'note' text in boldface.
---
 scripts/gen_help_html.lua | 4 ++++
 1 file changed, 4 insertions(+)

(limited to 'scripts')

diff --git a/scripts/gen_help_html.lua b/scripts/gen_help_html.lua
index b33a94dca5..b712cf1475 100644
--- a/scripts/gen_help_html.lua
+++ b/scripts/gen_help_html.lua
@@ -532,6 +532,8 @@ local function visit_node(root, level, lang_tree, headings, opt, stats)
     return ('%s%s%s'):format(ws(), fixed_url, fixed_url, removed_chars)
   elseif node_name == 'word' or node_name == 'uppercase_name' then
     return text
+  elseif node_name == 'note' then
+    return ('%s'):format(text)
   elseif node_name == 'h1' or node_name == 'h2' or node_name == 'h3' then
     if is_noise(text, stats.noise_lines) then
       return '' -- Discard common "noise" lines.
@@ -694,6 +696,8 @@ local function visit_node(root, level, lang_tree, headings, opt, stats)
       return string.format('%s', s)
     end
     return s
+  elseif node_name == 'modeline' then
+    return ''
   elseif node_name == 'ERROR' then
     if ignore_parse_error(opt.fname, trimmed) then
       return text
-- 
cgit 


From 7aaa4a51b76fd136b5373acf8c5a0c7c278d8b5c Mon Sep 17 00:00:00 2001
From: Jongwook Choi 
Date: Tue, 21 May 2024 12:10:39 -0400
Subject: build(vim-patch.sh): include commit subject #28767

Problem: vim-patch commits lack an informative title and summary in the
very first line of the commit message when the vim-revision is a Git SHA
hash, unlike when is a Vim version. This makes it difficult to discern
at a glance what changes are introduced by such vim-patch commits (in
git log, PR title, changelog generated by git-cliff, etc.).

BEFORE:

    vim-patch:abcdef123456

    runtime(vim): improve performance

    
    ...

Solution: Repeat the title of the upstream commit message, to improve
the clarity and visibility of the commit message.

AFTER:

    vim-patch:abcdef123456: runtime(vim): improve performance

    
    ...

Note: the `vim-patch:` token is still needed by `vim-patch.sh`
(but not necessarily in the very first line of the commit message) to
determine which vim patches have been applied. `` is internally
normalized to 7 hex digits.
---
 scripts/vim-patch.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

(limited to 'scripts')

diff --git a/scripts/vim-patch.sh b/scripts/vim-patch.sh
index 45dd7f5fee..e8758c064f 100755
--- a/scripts/vim-patch.sh
+++ b/scripts/vim-patch.sh
@@ -122,7 +122,7 @@ commit_message() {
   if [[ "${vim_message}" == "vim-patch:${vim_version}:"* ]]; then
     printf '%s\n\n%s\n\n%s' "${vim_message}" "${vim_commit_url}" "${vim_coauthors}"
   else
-    printf 'vim-patch:%s\n\n%s\n\n%s\n\n%s' "$vim_version" "$vim_message" "$vim_commit_url" "$vim_coauthors"
+    printf 'vim-patch:%s: %s\n\n%s\n\n%s' "${vim_version:0:7}" "${vim_message}" "${vim_commit_url}" "${vim_coauthors}"
   fi
 }
 
-- 
cgit 


From e8f7025de1d8b7c8bbe747736e4c46dcd6e73133 Mon Sep 17 00:00:00 2001
From: dundargoc 
Date: Wed, 22 May 2024 16:07:45 +0200
Subject: docs: move vim.health documentation to lua.txt

`vim.health` is not a "plugin" but part of our Lua API and the
documentation should reflect that. This also helps make the
documentation maintenance easier as it is now generated.
---
 scripts/gen_help_html.lua | 5 ++---
 scripts/gen_vimdoc.lua    | 2 ++
 2 files changed, 4 insertions(+), 3 deletions(-)

(limited to 'scripts')

diff --git a/scripts/gen_help_html.lua b/scripts/gen_help_html.lua
index b712cf1475..2a8f8308ac 100644
--- a/scripts/gen_help_html.lua
+++ b/scripts/gen_help_html.lua
@@ -75,7 +75,6 @@ local new_layout = {
   ['news-0.9.txt'] = true,
   ['news-0.10.txt'] = true,
   ['nvim.txt'] = true,
-  ['pi_health.txt'] = true,
   ['provider.txt'] = true,
   ['ui.txt'] = true,
   ['vim_diff.txt'] = true,
@@ -1440,9 +1439,9 @@ function M.test_gen(help_dir)
     help_dir,
     tmpdir,
     -- Because gen() is slow (~30s), this test is limited to a few files.
-    { 'pi_health.txt', 'help.txt', 'index.txt', 'nvim.txt' }
+    { 'help.txt', 'index.txt', 'nvim.txt' }
   )
-  eq(4, #rv.helpfiles)
+  eq(3, #rv.helpfiles)
   eq(0, rv.err_count, 'parse errors in :help docs')
   eq({}, rv.invalid_links, 'invalid tags in :help docs')
 end
diff --git a/scripts/gen_vimdoc.lua b/scripts/gen_vimdoc.lua
index 6d0fc46145..eea5688621 100755
--- a/scripts/gen_vimdoc.lua
+++ b/scripts/gen_vimdoc.lua
@@ -162,6 +162,7 @@ local config = {
       'snippet.lua',
       'text.lua',
       'tohtml.lua',
+      'health.lua',
     },
     files = {
       'runtime/lua/vim/iter.lua',
@@ -181,6 +182,7 @@ local config = {
       'runtime/lua/vim/snippet.lua',
       'runtime/lua/vim/text.lua',
       'runtime/lua/vim/glob.lua',
+      'runtime/lua/vim/health.lua',
       'runtime/lua/vim/_meta/builtin.lua',
       'runtime/lua/vim/_meta/diff.lua',
       'runtime/lua/vim/_meta/mpack.lua',
-- 
cgit 


From c614969570ac13cfc1ff6642fcaf56ebce6d40be Mon Sep 17 00:00:00 2001
From: Saien Govender <35043617+saitheninja@users.noreply.github.com>
Date: Thu, 23 May 2024 15:20:29 +0200
Subject: build(docs): update CSS #28896

Problem:
Not using minified version of bootstrap.
Don't need to load normalize with new version of bootstrap.
See https://github.com/neovim/neovim.github.io/pull/350

Solution:
Update link to bootstrap file.
Remove link to normalize.
---
 scripts/gen_help_html.lua | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

(limited to 'scripts')

diff --git a/scripts/gen_help_html.lua b/scripts/gen_help_html.lua
index 2a8f8308ac..b61f01f124 100644
--- a/scripts/gen_help_html.lua
+++ b/scripts/gen_help_html.lua
@@ -836,8 +836,7 @@ local function gen_one(fname, to_fname, old, commit, parser_path)
     
     
 
-    
-    
+    
     
     
     
-- 
cgit 


From 6dc62c2e2b413a9bbaf0746660c5638936303249 Mon Sep 17 00:00:00 2001
From: dundargoc 
Date: Thu, 23 May 2024 11:40:51 +0200
Subject: docs: extract health to its own file

---
 scripts/gen_help_html.lua |  1 -
 scripts/gen_vimdoc.lua    | 17 +++++++++++++++--
 2 files changed, 15 insertions(+), 3 deletions(-)

(limited to 'scripts')

diff --git a/scripts/gen_help_html.lua b/scripts/gen_help_html.lua
index b61f01f124..cdfb85bde6 100644
--- a/scripts/gen_help_html.lua
+++ b/scripts/gen_help_html.lua
@@ -1440,7 +1440,6 @@ function M.test_gen(help_dir)
     -- Because gen() is slow (~30s), this test is limited to a few files.
     { 'help.txt', 'index.txt', 'nvim.txt' }
   )
-  eq(3, #rv.helpfiles)
   eq(0, rv.err_count, 'parse errors in :help docs')
   eq({}, rv.invalid_links, 'invalid tags in :help docs')
 end
diff --git a/scripts/gen_vimdoc.lua b/scripts/gen_vimdoc.lua
index eea5688621..9c6225efc3 100755
--- a/scripts/gen_vimdoc.lua
+++ b/scripts/gen_vimdoc.lua
@@ -162,7 +162,6 @@ local config = {
       'snippet.lua',
       'text.lua',
       'tohtml.lua',
-      'health.lua',
     },
     files = {
       'runtime/lua/vim/iter.lua',
@@ -182,7 +181,6 @@ local config = {
       'runtime/lua/vim/snippet.lua',
       'runtime/lua/vim/text.lua',
       'runtime/lua/vim/glob.lua',
-      'runtime/lua/vim/health.lua',
       'runtime/lua/vim/_meta/builtin.lua',
       'runtime/lua/vim/_meta/diff.lua',
       'runtime/lua/vim/_meta/mpack.lua',
@@ -363,6 +361,21 @@ local config = {
       fun.name = vim.split(fun.name, '.', { plain = true })[2]
     end,
   },
+  health = {
+    filename = 'health.txt',
+    files = {
+      'runtime/lua/vim/health.lua',
+    },
+    section_order = {
+      'health.lua',
+    },
+    section_fmt = function(_name)
+      return 'Checkhealth'
+    end,
+    helptag_fmt = function(name)
+      return name:lower()
+    end,
+  },
 }
 
 --- @param ty string
-- 
cgit