From d2975d58cb3f5af924398e8a45205309d5a21796 Mon Sep 17 00:00:00 2001 From: ii14 Date: Mon, 8 Aug 2022 20:24:50 +0200 Subject: docs: change gen_vimdoc indentation to 4 spaces --- scripts/gen_vimdoc.py | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) (limited to 'scripts') diff --git a/scripts/gen_vimdoc.py b/scripts/gen_vimdoc.py index c17742ddaf..bca3dd816f 100755 --- a/scripts/gen_vimdoc.py +++ b/scripts/gen_vimdoc.py @@ -26,7 +26,7 @@ Each function :help block is formatted as follows: - Max width of 78 columns (`text_width`). - Indent with spaces (not tabs). - - Indent of 16 columns for body text. + - Indent of 4 columns for body text (`indentation`). - Function signature and helptag (right-aligned) on the same line. - Signature and helptag must have a minimum of 8 spaces between them. - If the signature is too long, it is placed on the line after the helptag. @@ -80,6 +80,7 @@ LOG_LEVELS = { } text_width = 78 +indentation = 4 script_path = os.path.abspath(__file__) base_dir = os.path.dirname(os.path.dirname(script_path)) out_dir = os.path.join(base_dir, 'tmp-{target}-doc') @@ -456,7 +457,7 @@ def max_name(names): return max(len(name) for name in names) -def update_params_map(parent, ret_map, width=62): +def update_params_map(parent, ret_map, width=text_width - indentation): """Updates `ret_map` with name:desc key-value pairs extracted from Doxygen XML node `parent`. """ @@ -483,7 +484,8 @@ def update_params_map(parent, ret_map, width=62): return ret_map -def render_node(n, text, prefix='', indent='', width=62, fmt_vimhelp=False): +def render_node(n, text, prefix='', indent='', width=text_width - indentation, + fmt_vimhelp=False): """Renders a node as Vim help text, recursively traversing all descendants.""" def ind(s): @@ -562,7 +564,7 @@ def render_node(n, text, prefix='', indent='', width=62, fmt_vimhelp=False): return text -def para_as_map(parent, indent='', width=62, fmt_vimhelp=False): +def para_as_map(parent, indent='', width=text_width - indentation, fmt_vimhelp=False): """Extracts a Doxygen XML node to a map. Keys: @@ -656,7 +658,8 @@ def para_as_map(parent, indent='', width=62, fmt_vimhelp=False): return chunks, xrefs -def fmt_node_as_vimhelp(parent, width=62, indent='', fmt_vimhelp=False): +def fmt_node_as_vimhelp(parent, width=text_width - indentation, indent='', + fmt_vimhelp=False): """Renders (nested) Doxygen nodes as Vim :help text. NB: Blank lines in a docstring manifest as tags. @@ -838,7 +841,8 @@ def extract_from_xml(filename, target, width, fmt_vimhelp): log.debug( textwrap.indent( re.sub(r'\n\s*\n+', '\n', - desc.toprettyxml(indent=' ', newl='\n')), ' ' * 16)) + desc.toprettyxml(indent=' ', newl='\n')), + ' ' * indentation)) fn = { 'annotations': list(annotations), @@ -918,7 +922,7 @@ def fmt_doxygen_xml_as_vimhelp(filename, target): doc += '\n<' func_doc = fn['signature'] + '\n' - func_doc += textwrap.indent(clean_lines(doc), ' ' * 16) + func_doc += textwrap.indent(clean_lines(doc), ' ' * indentation) # Verbatim handling. func_doc = re.sub(r'^\s+([<>])$', r'\1', func_doc, flags=re.M) @@ -1114,7 +1118,7 @@ def main(config, args): docs += '\n\n\n' docs = docs.rstrip() + '\n\n' - docs += ' vim:tw=78:ts=8:ft=help:norl:\n' + docs += f' vim:tw=78:ts=8:sw={indentation}:sts={indentation}:et:ft=help:norl:\n' doc_file = os.path.join(base_dir, 'runtime', 'doc', CONFIG[target]['filename']) -- cgit From c7ca94ba7f7a76caf51ed62b521f04c97c6aeed5 Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Fri, 12 Aug 2022 12:58:52 +0800 Subject: vim-patch:8.1.1684: profiling functionality is spread out Problem: Profiling functionality is spread out. Solution: Put profiling functionality in profiling.c. (Yegappan Lakshmanan, closes vim/vim#4666) https://github.com/vim/vim/commit/fa55cfc69d2b14761e2a8bd85bc1e0d82df770aa Move proftime_T to types.h for now to avoid recursive #include. --- scripts/vim-patch.sh | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'scripts') diff --git a/scripts/vim-patch.sh b/scripts/vim-patch.sh index 3825d9f0ea..505a88c55c 100755 --- a/scripts/vim-patch.sh +++ b/scripts/vim-patch.sh @@ -241,6 +241,10 @@ preprocess_patch() { LC_ALL=C sed -e 's/\( [ab]\/src\/nvim\)\/map\(\.[ch]\)/\1\/mapping\2/g' \ "$file" > "$file".tmp && mv "$file".tmp "$file" + # Rename profiler.c to profile.c + LC_ALL=C sed -e 's/\( [ab]\/src\/nvim\)\/profiler\(\.[ch]\)/\1\/profile\2/g' \ + "$file" > "$file".tmp && mv "$file".tmp "$file" + # Rename session.c to ex_session.c LC_ALL=C sed -e 's/\( [ab]\/src\/nvim\)\/session\(\.[ch]\)/\1\/ex_session\2/g' \ "$file" > "$file".tmp && mv "$file".tmp "$file" -- cgit From 103f10d901423637a80a887a58949bc582b44cae Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Fri, 12 Aug 2022 15:41:43 +0800 Subject: refactor: move code dealing with script files to runtime.c (#19734) vim-patch:8.1.1927: code for dealing with script files is spread out Problem: Code for dealing with script files is spread out. Solution: Move the code to scriptfile.c. (Yegappan Lakshmanan, closes vim/vim#4861) https://github.com/vim/vim/commit/307c5a5bb77c3728dfab06c30e9f786309c63f74 --- scripts/vim-patch.sh | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'scripts') diff --git a/scripts/vim-patch.sh b/scripts/vim-patch.sh index 505a88c55c..ad1973603e 100755 --- a/scripts/vim-patch.sh +++ b/scripts/vim-patch.sh @@ -245,6 +245,10 @@ preprocess_patch() { LC_ALL=C sed -e 's/\( [ab]\/src\/nvim\)\/profiler\(\.[ch]\)/\1\/profile\2/g' \ "$file" > "$file".tmp && mv "$file".tmp "$file" + # Rename scriptfile.c to runtime.c + LC_ALL=C sed -e 's/\( [ab]\/src\/nvim\)\/scriptfile\(\.[ch]\)/\1\/runtime\2/g' \ + "$file" > "$file".tmp && mv "$file".tmp "$file" + # Rename session.c to ex_session.c LC_ALL=C sed -e 's/\( [ab]\/src\/nvim\)\/session\(\.[ch]\)/\1\/ex_session\2/g' \ "$file" > "$file".tmp && mv "$file".tmp "$file" -- cgit From 0c0a426e40692eabb3e1800cc93135eb70a28334 Mon Sep 17 00:00:00 2001 From: Lewis Russell Date: Tue, 23 Aug 2022 14:18:05 +0100 Subject: doc(CONTRIBUTING): update #19891 - add section for managing includes via IWYU - recommend clangd over ctags - tidy up links - remove ./scripts/check-includes.py --- scripts/check-includes.py | 64 ----------------------------------------------- 1 file changed, 64 deletions(-) delete mode 100755 scripts/check-includes.py (limited to 'scripts') diff --git a/scripts/check-includes.py b/scripts/check-includes.py deleted file mode 100755 index ed1fe407c5..0000000000 --- a/scripts/check-includes.py +++ /dev/null @@ -1,64 +0,0 @@ -#!/usr/bin/env python - -import sys -import re -import os - -from subprocess import Popen, PIPE -from argparse import ArgumentParser - - -GENERATED_INCLUDE_RE = re.compile( - r'^\s*#\s*include\s*"([/a-z_0-9.]+\.generated\.h)"(\s+//.*)?$') - - -def main(argv): - argparser = ArgumentParser() - argparser.add_argument('--generated-includes-dir', action='append', - help='Directory where generated includes are located.') - argparser.add_argument('--file', type=open, help='File to check.') - argparser.add_argument('iwyu_args', nargs='*', - help='IWYU arguments, must go after --.') - args = argparser.parse_args(argv) - - with args.file: - iwyu = Popen(['include-what-you-use', '-xc'] + args.iwyu_args + ['/dev/stdin'], - stdin=PIPE, stdout=PIPE, stderr=PIPE) - - for line in args.file: - match = GENERATED_INCLUDE_RE.match(line) - if match: - for d in args.generated_includes_dir: - try: - f = open(os.path.join(d, match.group(1))) - except IOError: - continue - else: - with f: - for generated_line in f: - iwyu.stdin.write(generated_line) - break - else: - raise IOError('Failed to find {0}'.format(match.group(1))) - else: - iwyu.stdin.write(line) - - iwyu.stdin.close() - - out = iwyu.stdout.read() - err = iwyu.stderr.read() - - ret = iwyu.wait() - - if ret != 2: - print('IWYU failed with exit code {0}:'.format(ret)) - print('{0} stdout {0}'.format('=' * ((80 - len(' stdout ')) // 2))) - print(out) - print('{0} stderr {0}'.format('=' * ((80 - len(' stderr ')) // 2))) - print(err) - return 1 - return 0 - - -if __name__ == '__main__': - raise SystemExit(main(sys.argv[1:])) -- cgit From c0d60526541a3cf977ae623471ae4a347b492af1 Mon Sep 17 00:00:00 2001 From: bfredl Date: Tue, 23 Aug 2022 09:33:08 +0200 Subject: perf(api): allow to use an arena for return values --- scripts/gen_vimdoc.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/gen_vimdoc.py b/scripts/gen_vimdoc.py index bca3dd816f..23ed0e3f08 100755 --- a/scripts/gen_vimdoc.py +++ b/scripts/gen_vimdoc.py @@ -801,7 +801,7 @@ def extract_from_xml(filename, target, width, fmt_vimhelp): prefix = '%s(' % name suffix = '%s)' % ', '.join('{%s}' % a[1] for a in params - if a[0] not in ('void', 'Error')) + if a[0] not in ('void', 'Error', 'Arena')) if not fmt_vimhelp: c_decl = '%s %s(%s);' % (return_type, name, ', '.join(c_args)) -- cgit