diff options
Diffstat (limited to 'src')
-rwxr-xr-x | src/clint.py | 13 | ||||
-rw-r--r-- | src/nvim/generators/gen_eval.lua | 2 | ||||
-rw-r--r-- | src/nvim/os/process.c | 19 | ||||
-rw-r--r-- | src/nvim/testdir/runnvim.vim | 5 | ||||
-rw-r--r-- | src/nvim/testdir/test_compiler.vim | 6 | ||||
-rw-r--r-- | src/nvim/testdir/test_makeencoding.py | 4 |
6 files changed, 22 insertions, 27 deletions
diff --git a/src/clint.py b/src/clint.py index 3994ffbb14..675b67ccef 100755 --- a/src/clint.py +++ b/src/clint.py @@ -2610,9 +2610,13 @@ def CheckBraces(filename, clean_lines, linenum, error): 'Brace starting function body must be placed on its own line') else: func_start_linenum = end_linenum + 1 - while not clean_lines.lines[func_start_linenum] == '{': - attrline = Match(r'^((?!# *define).*?)(?:FUNC_ATTR|FUNC_API|REAL_FATTR)_\w+(?:\(\d+(, \d+)*\))?', - clean_lines.lines[func_start_linenum]) + while not clean_lines.lines[func_start_linenum] == "{": + attrline = Match( + r'^((?!# *define).*?)' + r'(?:FUNC_ATTR|FUNC_API|REAL_FATTR)_\w+' + r'(?:\(\d+(, \d+)*\))?', + clean_lines.lines[func_start_linenum], + ) if attrline: if len(attrline.group(1)) != 2: error(filename, func_start_linenum, @@ -3182,7 +3186,8 @@ def CheckLanguage(filename, clean_lines, linenum, file_extension, r'|li_(?:next|prev|tv))\b', line) if match: error(filename, linenum, 'runtime/deprecated', 4, - 'Accessing list_T internals directly is prohibited (hint: see commit d46e37cb4c71)') + 'Accessing list_T internals directly is prohibited ' + '(hint: see commit d46e37cb4c71)') # Check for suspicious usage of "if" like # } if (a == b) { diff --git a/src/nvim/generators/gen_eval.lua b/src/nvim/generators/gen_eval.lua index fa01935fd4..2c6f8f2603 100644 --- a/src/nvim/generators/gen_eval.lua +++ b/src/nvim/generators/gen_eval.lua @@ -8,7 +8,7 @@ local funcs_file = arg[4] if nvimsrcdir == '--help' then print([[ Usage: - lua geneval.lua src/nvim build/src/nvim/auto + lua gen_eval.lua src/nvim build/src/nvim/auto Will generate build/src/nvim/auto/funcs.generated.h with definition of functions static const array. diff --git a/src/nvim/os/process.c b/src/nvim/os/process.c index a1020be215..c7b473a012 100644 --- a/src/nvim/os/process.c +++ b/src/nvim/os/process.c @@ -89,21 +89,12 @@ bool os_proc_tree_kill(int pid, int sig) bool os_proc_tree_kill(int pid, int sig) { assert(sig == SIGTERM || sig == SIGKILL); - int pgid = getpgid(pid); - if (pgid > 0) { // Ignore error. Never kill self (pid=0). - if (pgid == pid) { - ILOG("sending %s to process group: -%d", - sig == SIGTERM ? "SIGTERM" : "SIGKILL", pgid); - int rv = uv_kill(-pgid, sig); - return rv == 0; - } else { - // Should never happen, because process_spawn() did setsid() in the child. - ELOG("pgid %d != pid %d", pgid, pid); - } - } else { - ELOG("getpgid(%d) returned %d", pid, pgid); + if (pid == 0) { + // Never kill self (pid=0). + return false; } - return false; + ILOG("sending %s to PID %d", sig == SIGTERM ? "SIGTERM" : "SIGKILL", -pid); + return uv_kill(-pid, sig) == 0; } #endif diff --git a/src/nvim/testdir/runnvim.vim b/src/nvim/testdir/runnvim.vim index 396a3a6477..52e05cfbeb 100644 --- a/src/nvim/testdir/runnvim.vim +++ b/src/nvim/testdir/runnvim.vim @@ -20,7 +20,7 @@ function Main() let results = jobwait([job], 5 * 60 * 1000) " TODO(ZyX-I): Get colors let screen = getline(1, '$') - bwipeout! + bwipeout! " kills the job always. let stringified_events = map(s:logger.d_events, \'v:val[0] . ": " . ' . \'join(map(v:val[1], '. @@ -43,9 +43,6 @@ function Main() \]) write if results[0] != 0 - if results[0] != -1 - call jobstop(job) - endif cquit else qall diff --git a/src/nvim/testdir/test_compiler.vim b/src/nvim/testdir/test_compiler.vim index 4600a28da5..46c14d8bc3 100644 --- a/src/nvim/testdir/test_compiler.vim +++ b/src/nvim/testdir/test_compiler.vim @@ -33,9 +33,9 @@ endfunc func Test_compiler_without_arg() let a=split(execute('compiler')) - call assert_match(expand('^.*runtime/compiler/ant.vim$'), a[0]) - call assert_match(expand('^.*runtime/compiler/bcc.vim$'), a[1]) - call assert_match(expand('^.*runtime/compiler/xmlwf.vim$'), a[-1]) + call assert_match('^.*runtime/compiler/ant.vim$', a[0]) + call assert_match('^.*runtime/compiler/bcc.vim$', a[1]) + call assert_match('^.*runtime/compiler/xmlwf.vim$', a[-1]) endfunc func Test_compiler_completion() diff --git a/src/nvim/testdir/test_makeencoding.py b/src/nvim/testdir/test_makeencoding.py index 041edadc0a..f6dc0f8d1c 100644 --- a/src/nvim/testdir/test_makeencoding.py +++ b/src/nvim/testdir/test_makeencoding.py @@ -8,6 +8,7 @@ import locale import io import sys + def set_output_encoding(enc=None): """Set the encoding of stdout and stderr @@ -20,7 +21,7 @@ def set_output_encoding(enc=None): def get_text_writer(fo, **kwargs): kw = dict(kwargs) - kw.setdefault('errors', 'backslashreplace') # use \uXXXX style + kw.setdefault('errors', 'backslashreplace') # use \uXXXX style kw.setdefault('closefd', False) if sys.version_info[0] < 3: @@ -29,6 +30,7 @@ def set_output_encoding(enc=None): writer = io.open(fo.fileno(), mode='w', newline='', **kw) write = writer.write # save the original write() function enc = locale.getpreferredencoding() + def convwrite(s): if isinstance(s, bytes): write(s.decode(enc)) # convert to unistr |