diff options
56 files changed, 688 insertions, 569 deletions
@@ -3316,7 +3316,7 @@ def ProcessFile(filename, vlevel, extra_check_functions=[]): _SetVerboseLevel(vlevel) try: - # Support the UNIX convention of using "-" for stdin. Note that + # Support the Unix convention of using "-" for stdin. Note that # we are not opening the file with universal newline support # (which codecs doesn't support anyway), so the resulting lines do # contain trailing '\r' characters if we are reading a file that diff --git a/config/CMakeLists.txt b/config/CMakeLists.txt index 48ecc9cc33..81b1fd64e3 100644 --- a/config/CMakeLists.txt +++ b/config/CMakeLists.txt @@ -15,7 +15,6 @@ check_type_size("void *" SIZEOF_VOID_PTR) check_symbol_exists(_NSGetEnviron crt_externs.h HAVE__NSGETENVIRON) # Headers -check_include_files(fcntl.h HAVE_FCNTL_H) check_include_files(iconv.h HAVE_ICONV_H) check_include_files(langinfo.h HAVE_LANGINFO_H) check_include_files(locale.h HAVE_LOCALE_H) @@ -24,7 +23,7 @@ check_include_files(strings.h HAVE_STRINGS_H) check_include_files(sys/wait.h HAVE_SYS_WAIT_H) if(NOT HAVE_SYS_WAIT_H AND UNIX) # See if_cscope.c - message(SEND_ERROR "header sys/wait.h is required for UNIX") + message(SEND_ERROR "header sys/wait.h is required for Unix") endif() check_include_files(sys/utsname.h HAVE_SYS_UTSNAME_H) check_include_files(utime.h HAVE_UTIME_H) diff --git a/config/config.h.in b/config/config.h.in index 84a90301ff..1eafc8cb95 100644 --- a/config/config.h.in +++ b/config/config.h.in @@ -13,7 +13,6 @@ #endif #cmakedefine HAVE__NSGETENVIRON -#cmakedefine HAVE_FCNTL_H #cmakedefine HAVE_FD_CLOEXEC #cmakedefine HAVE_FSEEKO #cmakedefine HAVE_GETPWENT diff --git a/contrib/YouCompleteMe/ycm_extra_conf.py b/contrib/YouCompleteMe/ycm_extra_conf.py index 12ad080143..7c54677c8f 100644 --- a/contrib/YouCompleteMe/ycm_extra_conf.py +++ b/contrib/YouCompleteMe/ycm_extra_conf.py @@ -9,7 +9,7 @@ def DirectoryOfThisScript(): def GetDatabase(): compilation_database_folder = os.path.join(DirectoryOfThisScript(), - '..', '..', 'build') + '..', 'build') if os.path.exists(compilation_database_folder): return ycm_core.CompilationDatabase(compilation_database_folder) return None diff --git a/man/nvim.1 b/man/nvim.1 index 968da04d52..f9c4e24d0b 100644 --- a/man/nvim.1 +++ b/man/nvim.1 @@ -75,7 +75,7 @@ Can be used to edit files starting with a hyphen .Pq Sq - . .It Fl -literal Interpret filenames literally, that is, do not expand wildcards. -Has no effect on UNIX-like systems, where the shell expands wildcards. +Has no effect on Unix-like systems, where the shell expands wildcards. .It Fl e Ex mode. See diff --git a/runtime/autoload/phpcomplete.vim b/runtime/autoload/phpcomplete.vim index 5ddad88873..dbc40fdf36 100644 --- a/runtime/autoload/phpcomplete.vim +++ b/runtime/autoload/phpcomplete.vim @@ -3,7 +3,7 @@ " Maintainer: Dávid Szabó ( complex857 AT gmail DOT com ) " Previous Maintainer: Mikolaj Machowski ( mikmach AT wp DOT pl ) " URL: https://github.com/shawncplus/phpcomplete.vim -" Last Change: 2014 Dec 01 +" Last Change: 2015 Feb 28 " " OPTIONS: " @@ -145,7 +145,7 @@ function! phpcomplete#CompletePHP(findstart, base) " {{{ let [current_namespace, imports] = phpcomplete#GetCurrentNameSpace(getline(0, line('.'))) - if context =~? '^use\s' + if context =~? '^use\s' || context ==? 'use' return phpcomplete#CompleteUse(a:base) endif @@ -189,7 +189,7 @@ function! phpcomplete#CompletePHP(findstart, base) " {{{ " }}} elseif context =~? 'implements' return phpcomplete#CompleteClassName(a:base, ['i'], current_namespace, imports) - elseif context =~? 'extends\s\+.\+$' + elseif context =~? 'extends\s\+.\+$' && a:base == '' return ['implements'] elseif context =~? 'extends' let kinds = context =~? 'class\s' ? ['c'] : ['i'] @@ -244,12 +244,13 @@ function! phpcomplete#CompleteUse(base) " {{{ if has_key(tag, 'namespace') let patched_ctags_detected = 1 endif + if tag.kind ==? 'n' && tag.name =~? '^'.namespace_match_pattern let patched_ctags_detected = 1 call add(namespaced_matches, {'word': tag.name, 'kind': 'n', 'menu': tag.filename, 'info': tag.filename }) - elseif has_key(tag, 'namespace') && (tag.kind ==? 'c' || tag.kind ==? 'i') && tag.namespace ==? namespace_for_class + elseif has_key(tag, 'namespace') && (tag.kind ==? 'c' || tag.kind ==? 'i' || tag.kind ==? 't') && tag.namespace ==? namespace_for_class call add(namespaced_matches, {'word': namespace_for_class.'\'.tag.name, 'kind': tag.kind, 'menu': tag.filename, 'info': tag.filename }) - elseif (tag.kind ==? 'c' || tag.kind ==? 'i') + elseif (tag.kind ==? 'c' || tag.kind ==? 'i' || tag.kind ==? 't') call add(no_namespace_matches, {'word': namespace_for_class.'\'.tag.name, 'kind': tag.kind, 'menu': tag.filename, 'info': tag.filename }) endif endfor @@ -272,6 +273,10 @@ function! phpcomplete#CompleteUse(base) " {{{ endfor endif + for comp in res + let comp.word = substitute(comp.word, '^\\', '', '') + endfor + return res endfunction " }}} @@ -326,6 +331,7 @@ function! phpcomplete#CompleteGeneral(base, current_namespace, imports) " {{{ let ext_functions = {} let ext_constants = {} let ext_classes = {} + let ext_traits = {} let ext_interfaces = {} let ext_namespaces = {} @@ -420,7 +426,7 @@ function! phpcomplete#CompleteGeneral(base, current_namespace, imports) " {{{ endif endif endif - elseif tag.kind ==? 'c' || tag.kind ==? 'i' + elseif tag.kind ==? 'c' || tag.kind ==? 'i' || tag.kind ==? 't' let info = ' - '.tag.filename let key = '' @@ -441,6 +447,8 @@ function! phpcomplete#CompleteGeneral(base, current_namespace, imports) " {{{ let ext_classes[key] = info elseif tag.kind ==? 'i' let ext_interfaces[key] = info + elseif tag.kind ==? 't' + let ext_traits[key] = info endif endif endif @@ -463,7 +471,7 @@ function! phpcomplete#CompleteGeneral(base, current_namespace, imports) " {{{ endfor for [interfacename, info] in items(g:php_builtin_interfacenames) if interfacename =~? '^'.base - let builtin_interfaces[leading_slash.interfacename] = info + let builtin_interfaces[leading_slash.g:php_builtin_interfaces[tolower(interfacename)].name] = info endif endfor endif @@ -511,6 +519,8 @@ function! phpcomplete#CompleteGeneral(base, current_namespace, imports) " {{{ else let ext_interfaces[imported_name] = ' '.import.name.' - '.import.filename endif + elseif import.kind ==? 't' + let ext_traits[imported_name] = ' '.import.name.' - '.import.filename endif " no builtin interfaces @@ -540,6 +550,9 @@ function! phpcomplete#CompleteGeneral(base, current_namespace, imports) " {{{ " Add external interfaces call extend(all_values, ext_interfaces) + " Add external traits + call extend(all_values, ext_traits) + " Add built-in classes call extend(all_values, builtin_classnames) @@ -566,6 +579,8 @@ function! phpcomplete#CompleteGeneral(base, current_namespace, imports) " {{{ elseif has_key(ext_interfaces, i) || has_key(builtin_interfaces, i) let info = has_key(ext_interfaces, i) ? ext_interfaces[i] : builtin_interfaces[i].' - builtin' let final_list += [{'word':i, 'kind': 'i', 'menu': info, 'info': i.info}] + elseif has_key(ext_traits, i) + let final_list += [{'word':i, 'kind': 't', 'menu': ext_traits[i], 'info': ext_traits[i]}] elseif has_key(int_constants, i) || has_key(builtin_constants, i) let info = has_key(int_constants, i) ? int_constants[i] : ' - builtin' let final_list += [{'word':i, 'kind': 'd', 'menu': info, 'info': i.info}] @@ -784,7 +799,7 @@ function! phpcomplete#CompleteClassName(base, kinds, current_namespace, imports) let tags = [] if len(tag_match_pattern) >= g:phpcomplete_min_num_of_chars_for_namespace_completion - let tags = phpcomplete#GetTaglist('^'.tag_match_pattern) + let tags = phpcomplete#GetTaglist('^\c'.tag_match_pattern) endif if len(tags) @@ -861,6 +876,39 @@ function! phpcomplete#CompareCompletionRow(i1, i2) " {{{ endfunction " }}} +function! s:getNextCharWithPos(filelines, current_pos) " {{{ + let line_no = a:current_pos[0] + let col_no = a:current_pos[1] + let last_line = a:filelines[len(a:filelines) - 1] + let end_pos = [len(a:filelines) - 1, strlen(last_line) - 1] + if line_no > end_pos[0] || line_no == end_pos[0] && col_no > end_pos[1] + return ['EOF', 'EOF'] + endif + + " we've not reached the end of the current line break + if col_no + 1 < strlen(a:filelines[line_no]) + let col_no += 1 + else + " we've reached the end of the current line, jump to the next + " non-blank line (blank lines have no position where we can read from, + " not even a whitespace. The newline char does not positionable by vim + let line_no += 1 + while strlen(a:filelines[line_no]) == 0 + let line_no += 1 + endwhile + + let col_no = 0 + endif + + " return 'EOF' string to signal end of file, normal results only one char + " in length + if line_no == end_pos[0] && col_no > end_pos[1] + return ['EOF', 'EOF'] + endif + + return [[line_no, col_no], a:filelines[line_no][col_no]] +endfunction " }}} + function! phpcomplete#EvaluateModifiers(modifiers, required_modifiers, prohibited_modifiers) " {{{ " if theres no modifier, and no modifier is allowed and no modifier is required if len(a:modifiers) == 0 && len(a:required_modifiers) == 0 @@ -1602,26 +1650,26 @@ function! phpcomplete#GetClassName(start_line, context, current_namespace, impor endif endif - " in-file lookup for typehinted function arguments - " - the function can have a name or be anonymous (e.g., function qux() { ... } vs. function () { ... }) - " - the type-hinted argument can be anywhere in the arguments list. - if line =~? 'function\(\s\+'.function_name_pattern.'\)\?\s*(.\{-}'.class_name_pattern.'\s\+'.object && !object_is_array - let f_args = matchstr(line, '\cfunction\(\s\+'.function_name_pattern.'\)\?\s*(\zs.\{-}\ze)') - let args = split(f_args, '\s*\zs,\ze\s*') - for arg in args - if arg =~# object.'\(,\|$\)' - let classname_candidate = matchstr(arg, '\s*\zs'.class_name_pattern.'\ze\s\+'.object) - let [classname_candidate, class_candidate_namespace] = phpcomplete#ExpandClassName(classname_candidate, a:current_namespace, a:imports) + " function declaration line + if line =~? 'function\(\s\+'.function_name_pattern.'\)\?\s*(' + let function_lines = join(reverse(lines), " ") + " search for type hinted arguments + if function_lines =~? 'function\(\s\+'.function_name_pattern.'\)\?\s*(.\{-}'.class_name_pattern.'\s\+'.object && !object_is_array + let f_args = matchstr(function_lines, '\cfunction\(\s\+'.function_name_pattern.'\)\?\s*(\zs.\{-}\ze)') + let args = split(f_args, '\s*\zs,\ze\s*') + for arg in args + if arg =~# object.'\(,\|$\)' + let classname_candidate = matchstr(arg, '\s*\zs'.class_name_pattern.'\ze\s\+'.object) + let [classname_candidate, class_candidate_namespace] = phpcomplete#ExpandClassName(classname_candidate, a:current_namespace, a:imports) + break + endif + endfor + if classname_candidate != '' break endif - endfor - if classname_candidate != '' - break endif - endif - " if we see a function declaration, try loading the docblock for it and look for matching @params - if line =~? 'function\(\s\+'.function_name_pattern.'\)\?\s*(.\{-}'.object + " search for docblock for the function let match_line = substitute(line, '\\', '\\\\', 'g') let sccontent = getline(0, a:start_line - i) let doc_str = phpcomplete#GetDocBlock(sccontent, match_line) @@ -1641,13 +1689,14 @@ function! phpcomplete#GetClassName(start_line, context, current_namespace, impor endif " assignment for the variable in question with a variable on the right hand side - if line =~# '^\s*'.object.'\s*=&\?\s*'.variable_name_pattern + if line =~# '^\s*'.object.'\s*=&\?\s\+\(clone\)\?\s*'.variable_name_pattern " try to find the next non-comment or string ";" char - let start_col = match(line, '^\s*'.object.'\C\s*=\zs&\?\s*'.variable_name_pattern) + let start_col = match(line, '^\s*'.object.'\C\s*=\zs&\?\s\+\(clone\)\?\s*'.variable_name_pattern) let filelines = reverse(lines) let [pos, char] = s:getNextCharWithPos(filelines, [a:start_line - i - 1, start_col]) let chars_read = 1 + let last_pos = pos " read while end of the file while char != 'EOF' && chars_read < 1000 let last_pos = pos @@ -1689,6 +1738,7 @@ function! phpcomplete#GetClassName(start_line, context, current_namespace, impor let filelines = reverse(lines) let [pos, char] = s:getNextCharWithPos(filelines, [a:start_line - i - 1, start_col]) let chars_read = 1 + let last_pos = pos " read while end of the file while char != 'EOF' && chars_read < 1000 let last_pos = pos @@ -1819,7 +1869,7 @@ function! phpcomplete#GetClassLocation(classname, namespace) " {{{ let i = 1 while i < line('.') let line = getline(line('.')-i) - if line =~? '^\s*\(abstract\s\+\|final\s\+\)*\s*class\s*'.a:classname.'\(\s\+\|$\)' && tolower(current_namespace) == search_namespace + if line =~? '^\s*\(abstract\s\+\|final\s\+\)*\s*\(class\|interface\|trait\)\s*'.a:classname.'\(\s\+\|$\)' && tolower(current_namespace) == search_namespace return expand('%:p') else let i += 1 @@ -1831,7 +1881,9 @@ function! phpcomplete#GetClassLocation(classname, namespace) " {{{ let no_namespace_candidate = '' let tags = phpcomplete#GetTaglist('^'.a:classname.'$') for tag in tags - if tag.kind == 'c' || tag.kind == 'i' + " We'll allow interfaces and traits to be handled classes since you + " can't have colliding names with different kinds anyway + if tag.kind == 'c' || tag.kind == 'i' || tag.kind == 't' if !has_key(tag, 'namespace') let no_namespace_candidate = tag.filename else @@ -1979,9 +2031,9 @@ function! phpcomplete#GetClassContentsStructure(file_path, file_lines, class_nam " remember the window we started at let phpcomplete_original_window = winnr() - silent! below 1new + silent! tab 1new silent! 0put =cfile - call search('\(class\|interface\)\_s\+'.a:class_name.'\(\>\|$\)') + call search('\c\(class\|interface\|trait\)\_s\+'.a:class_name.'\(\>\|$\)') let cfline = line('.') call search('{') let endline = line('.') @@ -1994,8 +2046,48 @@ function! phpcomplete#GetClassContentsStructure(file_path, file_lines, class_nam let extends_class = '' endif call searchpair('{', '', '}', 'W') - let classcontent = join(getline(cfline, line('.')), "\n") + let class_closing_bracket_line = line('.') + let classcontent = join(getline(cfline, class_closing_bracket_line), "\n") + + let used_traits = [] + " move back to the line next to the class's definition + call cursor(endline + 1, 1) + let keep_searching = 1 + while keep_searching != 0 + " try to grab "use..." keywords + let [lnum, col] = searchpos('\c^\s\+use\s\+'.class_name_pattern, 'cW', class_closing_bracket_line) + let syn_name = synIDattr(synID(lnum, col, 0), "name") + if syn_name =~? 'string\|comment' + call cursor(lnum + 1, 1) + continue + endif + + let trait_line = getline(lnum) + if trait_line !~? ';' + " try to find the next line containing ';' + let l = lnum + let search_line = trait_line + + " add lines from the file until theres no ';' in them + while search_line !~? ';' && l > 0 + " file lines are reversed so we need to go backwards + let l += 1 + let search_line = getline(l) + let trait_line .= ' '.substitute(search_line, '\(^\s\+\|\s\+$\)', '', 'g') + endwhile + endif + let use_expression = matchstr(trait_line, '^\s*use\s\+\zs.\{-}\ze;') + let use_parts = map(split(use_expression, '\s*,\s*'), 'substitute(v:val, "\\s+", " ", "g")') + let used_traits += map(use_parts, 'substitute(v:val, "\\s", "", "g")') + call cursor(lnum + 1, 1) + + if [lnum, col] == [0, 0] + let keep_searching = 0 + endif + endwhile + silent! bw! % + let [current_namespace, imports] = phpcomplete#GetCurrentNameSpace(a:file_lines[0:cfline]) " go back to original window exe phpcomplete_original_window.'wincmd w' @@ -2008,21 +2100,27 @@ function! phpcomplete#GetClassContentsStructure(file_path, file_lines, class_nam \ 'mtime': getftime(full_file_path), \ }) + let all_extends = used_traits if extends_class != '' - let [extends_class, namespace] = phpcomplete#ExpandClassName(extends_class, current_namespace, imports) - if namespace == '' - let namespace = '\' - endif - let classlocation = phpcomplete#GetClassLocation(extends_class, namespace) - if classlocation == "VIMPHP_BUILTINOBJECT" - let result += [phpcomplete#GenerateBuiltinClassStub(g:php_builtin_classes[tolower(extends_class)])] - elseif classlocation != '' && filereadable(classlocation) - let full_file_path = fnamemodify(classlocation, ':p') - let result += phpcomplete#GetClassContentsStructure(full_file_path, readfile(full_file_path), extends_class) - elseif tolower(current_namespace) == tolower(namespace) - " try to find the declaration in the same file. - let result += phpcomplete#GetClassContentsStructure(full_file_path, a:file_lines, extends_class) - endif + call add(all_extends, extends_class) + endif + if len(all_extends) > 0 + for class in all_extends + let [class, namespace] = phpcomplete#ExpandClassName(class, current_namespace, imports) + if namespace == '' + let namespace = '\' + endif + let classlocation = phpcomplete#GetClassLocation(class, namespace) + if classlocation == "VIMPHP_BUILTINOBJECT" + let result += [phpcomplete#GenerateBuiltinClassStub(g:php_builtin_classes[tolower(class)])] + elseif classlocation != '' && filereadable(classlocation) + let full_file_path = fnamemodify(classlocation, ':p') + let result += phpcomplete#GetClassContentsStructure(full_file_path, readfile(full_file_path), class) + elseif tolower(current_namespace) == tolower(namespace) + " try to find the declaration in the same file. + let result += phpcomplete#GetClassContentsStructure(full_file_path, a:file_lines, class) + endif + endfor endif return result @@ -2270,19 +2368,40 @@ endfunction! " }}} function! phpcomplete#GetCurrentNameSpace(file_lines) " {{{ + let original_window = winnr() + + silent! tab 1new + silent! 0put =a:file_lines + normal! G + + " clear out classes, functions and other blocks + while 1 + let block_start_pos = searchpos('\c\(class\|trait\|function\|interface\)\s\+\_.\{-}\zs{', 'Web') + if block_start_pos == [0, 0] + break + endif + let block_end_pos = searchpairpos('{', '', '}\|\%$', 'W', 'synIDattr(synID(line("."), col("."), 0), "name") =~? "string\\|comment"') + silent! exec block_start_pos[0].','.block_end_pos[0].'d' + endwhile + normal! G + + " grab the remains + let file_lines = reverse(getline(1, line('.') - 1)) + + silent! bw! % + exe original_window.'wincmd w' + let namespace_name_pattern = '[a-zA-Z_\x7f-\xff\\][a-zA-Z_0-9\x7f-\xff\\]*' - let file_lines = reverse(copy(a:file_lines)) let i = 0 let file_length = len(file_lines) let imports = {} - let current_namespace = '\' while i < file_length let line = file_lines[i] if line =~? '^\s*namespace\s*'.namespace_name_pattern - let current_namespace = matchstr(line, '^\s*namespace\s*\zs'.namespace_name_pattern.'\ze') + let current_namespace = matchstr(line, '\c^\s*namespace\s*\zs'.namespace_name_pattern.'\ze') break endif @@ -2303,11 +2422,11 @@ function! phpcomplete#GetCurrentNameSpace(file_lines) " {{{ let use_line .= ' '.substitute(search_line, '\(^\s\+\|\s\+$\)', '', 'g') endwhile endif - let use_expression = matchstr(use_line, '^\s*use\s\+\zs.\{-}\ze;') + let use_expression = matchstr(use_line, '^\c\s*use\s\+\zs.\{-}\ze;') let use_parts = map(split(use_expression, '\s*,\s*'), 'substitute(v:val, "\\s+", " ", "g")') for part in use_parts if part =~? '\s\+as\s\+' - let [object, name] = split(part, '\s\+as\s\+') + let [object, name] = split(part, '\s\+as\s\+\c') let object = substitute(object, '^\\', '', '') let name = substitute(name, '^\\', '', '') else @@ -2343,7 +2462,7 @@ function! phpcomplete#GetCurrentNameSpace(file_lines) " {{{ break endif " if the name matches with the extracted classname and namespace - if (tag.kind == 'c' || tag.kind == 'i') && tag.name == classname + if (tag.kind == 'c' || tag.kind == 'i' || tag.kind == 't') && tag.name == classname if has_key(tag, 'namespace') let patched_ctags_detected = 1 if tag.namespace == namespace_for_classes @@ -2386,7 +2505,7 @@ function! phpcomplete#GetCurrentNameSpace(file_lines) " {{{ let tags = phpcomplete#GetTaglist('^'.import['name'].'$') for tag in tags " search for the first matchin namespace, class, interface with no namespace - if !has_key(tag, 'namespace') && (tag.kind == 'n' || tag.kind == 'c' || tag.kind == 'i') + if !has_key(tag, 'namespace') && (tag.kind == 'n' || tag.kind == 'c' || tag.kind == 'i' || tag.kind == 't') call extend(import, tag) let import['builtin'] = 0 break diff --git a/runtime/doc/autocmd.txt b/runtime/doc/autocmd.txt index ffba29efc7..140a2f2e66 100644 --- a/runtime/doc/autocmd.txt +++ b/runtime/doc/autocmd.txt @@ -1041,7 +1041,7 @@ The pattern is interpreted like mostly used in file names: [^ch] match any character but 'c' and 'h' Note that for all systems the '/' character is used for path separator (even -MS-DOS). This was done because the backslash is difficult to use in a pattern +Windows). This was done because the backslash is difficult to use in a pattern and to make the autocommands portable across different systems. *autocmd-changes* diff --git a/runtime/doc/cmdline.txt b/runtime/doc/cmdline.txt index 7e8c788626..ae808a4a9b 100644 --- a/runtime/doc/cmdline.txt +++ b/runtime/doc/cmdline.txt @@ -379,7 +379,7 @@ CTRL-N After using 'wildchar' which got multiple matches, go to next <S-Tab> *c_CTRL-P* *c_<S-Tab>* CTRL-P After using 'wildchar' which got multiple matches, go to previous match. Otherwise recall older command-line from - history. <S-Tab> only works with the GUI and with MS-DOS. + history. <S-Tab> only works with the GUI. *c_CTRL-A* CTRL-A All names that match the pattern in front of the cursor are inserted. @@ -819,7 +819,7 @@ These modifiers can be given, in this order: separator is removed. Thus ":p:h" on a directory name results on the directory name itself (without trailing slash). When the file name is an absolute path (starts with "/" for - Unix; "x:\" for MS-DOS and WIN32), that part is not removed. + Unix; "x:\" for Windows), that part is not removed. When there is no head (path is relative to current directory) the result is empty. :t Tail of the file name (last component of the name). Must @@ -918,8 +918,8 @@ option contains "sh", this is done twice, to avoid the shell trying to expand the "!". *filename-backslash* -For filesystems that use a backslash as directory separator (MS-DOS and -Windows), it's a bit difficult to recognize a backslash that is used +For filesystems that use a backslash as directory separator (Windows +filesystems), it's a bit difficult to recognize a backslash that is used to escape the special meaning of the next character. The general rule is: If the backslash is followed by a normal file name character, it does not have a special meaning. Therefore "\file\foo" is a valid file name, you don't have diff --git a/runtime/doc/editing.txt b/runtime/doc/editing.txt index 42c674d5ce..bcb89f6527 100644 --- a/runtime/doc/editing.txt +++ b/runtime/doc/editing.txt @@ -130,9 +130,7 @@ You can use this file if you discover that you need the original file. See also the 'patchmode' option. The name of the backup file is normally the same as the original file with 'backupext' appended. The default "~" is a bit strange to avoid accidentally overwriting existing files. If you prefer ".bak" -change the 'backupext' option. Extra dots are replaced with '_' on MS-DOS -machines, when Vim has detected that an MS-DOS-like filesystem is being used -(e.g., messydos or crossdos). The backup file can be placed in another +change the 'backupext' option. The backup file can be placed in another directory by setting 'backupdir'. When you started editing without giving a file name, "No File" is displayed in @@ -471,9 +469,9 @@ The 'fileformat' option sets the <EOL> style for a file: "mac" <CR> Mac format *Mac-format* When reading a file, the mentioned characters are interpreted as the <EOL>. -In DOS format (default for MS-DOS and Win32), <CR><NL> and <NL> are both -interpreted as the <EOL>. Note that when writing the file in DOS format, -<CR> characters will be added for each single <NL>. Also see |file-read|. +In DOS format (default for Windows), <CR><NL> and <NL> are both interpreted as +the <EOL>. Note that when writing the file in DOS format, <CR> characters will +be added for each single <NL>. Also see |file-read|. When writing a file, the mentioned characters are used for <EOL>. For DOS format <CR><NL> is used. Also see |DOS-format-write|. @@ -494,13 +492,13 @@ If you start editing a new file and the 'fileformats' option is not empty (which is the default), Vim will try to detect whether the lines in the file are separated by the specified formats. When set to "unix,dos", Vim will check for lines with a single <NL> (as used on Unix) or by a <CR><NL> pair -(MS-DOS). Only when ALL lines end in <CR><NL>, 'fileformat' is set to "dos", +(Windows). Only when ALL lines end in <CR><NL>, 'fileformat' is set to "dos", otherwise it is set to "unix". When 'fileformats' includes "mac", and no <NL> characters are found in the file, 'fileformat' is set to "mac". -If the 'fileformat' option is set to "dos" on non-MS-DOS systems the message +If the 'fileformat' option is set to "dos" on non-Windows systems the message "[dos format]" is shown to remind you that something unusual is happening. On -MS-DOS systems you get the message "[unix format]" if 'fileformat' is set to +Windows systems you get the message "[unix format]" if 'fileformat' is set to "unix". On all systems but the Macintosh you get the message "[mac format]" if 'fileformat' is set to "mac". @@ -966,10 +964,10 @@ lost the original file. *DOS-format-write* If the 'fileformat' is "dos", <CR> <NL> is used for <EOL>. This is default -for MS-DOS and Win32. On other systems the message "[dos format]" is shown to +for Windows. On other systems the message "[dos format]" is shown to remind you that an unusual <EOL> was used. *Unix-format-write* -If the 'fileformat' is "unix", <NL> is used for <EOL>. On MS-DOS and Win32 +If the 'fileformat' is "unix", <NL> is used for <EOL>. On Windows the message "[unix format]" is shown. *Mac-format-write* If the 'fileformat' is "mac", <CR> is used for <EOL>. On non-Mac systems the @@ -999,11 +997,11 @@ When the file name is actually a device name, Vim will not make a backup (that would be impossible). You need to use "!", since the device already exists. Example for Unix: > :w! /dev/lpt0 -and for MS-DOS or MS-Windows: > +and Windows: > :w! lpt0 For Unix a device is detected when the name doesn't refer to a normal file or a directory. A fifo or named pipe also looks like a device to Vim. -For MS-DOS and MS-Windows the device is detected by its name: +For Windows the device is detected by its name: CON CLOCK$ NUL @@ -1224,7 +1222,7 @@ present in 'cpoptions' and "!" is not used in the command. Does not change the meaning of an already opened file, because its full path name is remembered. Files from the |arglist| may change though! - On MS-DOS this also changes the active drive. + On Windows this also changes the active drive. To change to the directory of the current file: > :cd %:h < diff --git a/runtime/doc/eval.txt b/runtime/doc/eval.txt index e295772693..1f1dc71f28 100644 --- a/runtime/doc/eval.txt +++ b/runtime/doc/eval.txt @@ -2825,7 +2825,7 @@ executable({expr}) *executable()* arguments. executable() uses the value of $PATH and/or the normal searchpath for programs. *PATHEXT* - On MS-DOS and MS-Windows the ".exe", ".bat", etc. can + On Windows the ".exe", ".bat", etc. can optionally be included. Then the extensions in $PATHEXT are tried. Thus if "foo.exe" does not exist, "foo.exe.bat" can be found. If $PATHEXT is not set then ".exe;.com;.bat;.cmd" is @@ -2833,9 +2833,9 @@ executable({expr}) *executable()* the name without an extension. When 'shell' looks like a Unix shell, then the name is also tried without adding an extension. - On MS-DOS and MS-Windows it only checks if the file exists and + On Windows it only checks if the file exists and is not a directory, not if it's really executable. - On MS-Windows an executable in the same directory as Vim is + On Windows an executable in the same directory as Vim is always found. Since this directory is added to $PATH it should also work to execute it |win32-PATH|. The result is a Number: @@ -3625,8 +3625,7 @@ getmatches() *getmatches()* < *getpid()* getpid() Return a Number which is the process ID of the Vim process. - On Unix and MS-Windows this is a unique number, until Vim - exits. On MS-DOS it's always zero. + This is a unique number, until Vim exits. *getpos()* getpos({expr}) Get the position for {expr}. For possible values of {expr} @@ -5891,7 +5890,7 @@ sha256({string}) *sha256()* shellescape({string} [, {special}]) *shellescape()* Escape {string} for use as a shell command argument. - On MS-Windows and MS-DOS, when 'shellslash' is not set, it + On Windows when 'shellslash' is not set, it will enclose {string} in double quotes and double all double quotes within {string}. For other systems, it will enclose {string} in single quotes diff --git a/runtime/doc/farsi.txt b/runtime/doc/farsi.txt index 6036264237..b85c0a357c 100644 --- a/runtime/doc/farsi.txt +++ b/runtime/doc/farsi.txt @@ -111,7 +111,7 @@ The letter encoding used is the Vim extended ISIR-3342 standard with a built in function to convert between Vim extended ISIR-3342 and ISIR-3342 standard. For document portability reasons, the letter encoding is kept the same across -different platforms (i.e. UNIX's, NT/95/98, MS DOS, ...). +different platforms (i.e. Unix, Windows, ...). o Keyboard diff --git a/runtime/doc/filetype.txt b/runtime/doc/filetype.txt index baf7550948..b6525e8494 100644 --- a/runtime/doc/filetype.txt +++ b/runtime/doc/filetype.txt @@ -595,7 +595,7 @@ Format description: ignored. 2. Each entry starts with line that has format "{type} with timestamp {timestamp}:". {timestamp} is |strftime()|-formatted string representing - actual UNIX timestamp value. First strftime() argument is equal to + actual Unix timestamp value. First strftime() argument is equal to `%Y-%m-%dT%H:%M:%S`. When writing this timestamp is parsed using |msgpack#strptime()|, with caching (it remembers which timestamp produced particular strftime() output and uses this value if you did not change diff --git a/runtime/doc/gui_w32.txt b/runtime/doc/gui_w32.txt index 7bc0f5cb13..ce00600979 100644 --- a/runtime/doc/gui_w32.txt +++ b/runtime/doc/gui_w32.txt @@ -257,17 +257,6 @@ WARNING: If you close this window with the "X" button, and confirm the question if you really want to kill the application, Vim may be killed too! (This does not apply to commands run asynchronously with ":!start".) - *msdos-mode* -If you get a dialog that says "This program is set to run in MS-DOS mode..." -when you run an external program, you can solve this by changing the -properties of the associated shortcut: -- Use a Windows Explorer to find the command.com that is used. It can be - c:\command.com, c:\dos\command.com, c:\windows\command.com, etc. -- With the right mouse button, select properties of this command.com. -- In the Program tab select "Advanced". -- Unselect "MS-DOS mode". -- Click "OK" twice. - *win32-!start* Normally, Vim waits for a command to complete before continuing (this makes sense for most shell commands which produce output for Vim to use). If you diff --git a/runtime/doc/insert.txt b/runtime/doc/insert.txt index 013eb6b97b..cb01d5fe92 100644 --- a/runtime/doc/insert.txt +++ b/runtime/doc/insert.txt @@ -1941,9 +1941,9 @@ If the 'fileformats' option is not empty Vim tries to recognize the type of changed, the detected format is only used while reading the file. A similar thing happens with 'fileencodings'. -On non-MS-DOS and Win32 systems the message "[dos format]" is shown if +On non-Windows systems the message "[dos format]" is shown if a file is read in DOS format, to remind you that something unusual is done. -On Macintosh, MS-DOS, and Win32 the message "[unix format]" is shown if +On Macintosh and Windows the message "[unix format]" is shown if a file is read in Unix format. On non-Macintosh systems, the message "[Mac format]" is shown if a file is read in Mac format. diff --git a/runtime/doc/intro.txt b/runtime/doc/intro.txt index 431b6e1ad7..fdf106a7bb 100644 --- a/runtime/doc/intro.txt +++ b/runtime/doc/intro.txt @@ -251,7 +251,7 @@ Vim would never have become what it is now, without the help of these people! lots of patches Ingo Wilken Tcl interface Mike Williams PostScript printing - Juergen Weigert Lattice version, AUX improvements, UNIX and + Juergen Weigert Lattice version, AUX improvements, Unix and MS-DOS ports, autoconf Stefan 'Sec' Zehl Maintainer of vim.org diff --git a/runtime/doc/options.txt b/runtime/doc/options.txt index 6539ad364b..013e7c742c 100644 --- a/runtime/doc/options.txt +++ b/runtime/doc/options.txt @@ -183,7 +183,7 @@ the option value, use '\"' instead. This example sets the 'titlestring' option to 'hi "there"': > :set titlestring=hi\ \"there\" -For MS-DOS and WIN32 backslashes in file names are mostly not removed. More +For Windows backslashes in file names are mostly not removed. More precise: For options that expect a file name (those where environment variables are expanded) a backslash before a normal file name character is not removed. But a backslash before a special character (space, backslash, comma, @@ -772,14 +772,14 @@ A jump table for the options with a short description can be found at |Q_op|. putting a ":gui" command in the gvimrc file, before where the value of 'background' is used (e.g., before ":syntax on"). - For MS-DOS and Windows the default is "dark". + For Windows the default is "dark". For other systems "dark" is used when 'term' is "linux", "screen.linux", "cygwin" or "putty", or $COLORFGBG suggests a dark background. Otherwise the default is "light". Normally this option would be set in the vimrc file. Possibly depending on the terminal name. Example: > - :if &term == "pcterm" + :if &term == "xterm" : set background=dark :endif < When this option is set, the default settings for the highlight groups @@ -900,7 +900,7 @@ A jump table for the options with a short description can be found at |Q_op|. impossible!). Writing may fail because of this. - A directory "." means to put the backup file in the same directory as the edited file. - - A directory starting with "./" (or ".\" for MS-DOS et al.) means to + - A directory starting with "./" (or ".\" for Windows) means to put the backup file relative to where the edited file is. The leading "." is replaced with the path name of the edited file. ("." inside a directory name has no special meaning). @@ -2075,7 +2075,7 @@ A jump table for the options with a short description can be found at |Q_op|. the edited file. On Unix, a dot is prepended to the file name, so it doesn't show in a directory listing. On MS-Windows the "hidden" attribute is set and a dot prepended if possible. - - A directory starting with "./" (or ".\" for MS-DOS et al.) means to + - A directory starting with "./" (or ".\" for Windows) means to put the swap file relative to where the edited file is. The leading "." is replaced with the path name of the edited file. - For Unix and Win32, if a directory ends in two path separators "//" @@ -2395,7 +2395,7 @@ A jump table for the options with a short description can be found at |Q_op|. is read. *'fileformat'* *'ff'* -'fileformat' 'ff' string (MS-DOS and MS-Windows default: "dos", +'fileformat' 'ff' string (Windows default: "dos", Unix default: "unix", Macintosh default: "mac") local to buffer @@ -2865,14 +2865,14 @@ A jump table for the options with a short description can be found at |Q_op|. r-cr:hor20-Cursor/lCursor, sm:block-Cursor -blinkwait175-blinkoff150-blinkon175", - for MS-DOS and Win32 console: + for Windows console: "n-v-c:block,o:hor50,i-ci:hor15, r-cr:hor30,sm:block") global {only available when compiled with GUI enabled, and - for MS-DOS and Win32 console} + for Windows console} This option tells Vim what the cursor should look like in different - modes. It fully works in the GUI. In an MSDOS or Win32 console, only + modes. It fully works in the GUI. In a Windows console, only the height of the cursor can be changed. This can be done by specifying a block cursor, or a percentage for a vertical or horizontal cursor. @@ -3614,7 +3614,7 @@ A jump table for the options with a short description can be found at |Q_op|. When executing commands with |:normal| 'insertmode' is not used. *'isfname'* *'isf'* -'isfname' 'isf' string (default for MS-DOS and Win32: +'isfname' 'isf' string (default for Windows: "@,48-57,/,\,.,-,_,+,,,#,$,%,{,},[,],:,@-@,!,~,=" otherwise: "@,48-57,/,.,-,_,+,,,#,$,%,~,=") global @@ -3665,7 +3665,7 @@ A jump table for the options with a short description can be found at |Q_op|. See |option-backslash| about including spaces and backslashes. *'isident'* *'isi'* -'isident' 'isi' string (default for MS-DOS and Win32: +'isident' 'isi' string (default for Windows: "@,48-57,_,128-167,224-235" otherwise: "@,48-57,_,192-255") global @@ -4288,7 +4288,7 @@ A jump table for the options with a short description can be found at |Q_op|. The mouse pointer is restored when the mouse is moved. *'mousemodel'* *'mousem'* -'mousemodel' 'mousem' string (default "extend", "popup" for MS-DOS and Win32) +'mousemodel' 'mousem' string (default "extend", "popup" for Windows) global Sets the model to use for the mouse. The name mostly specifies what the right mouse button is used for: @@ -4390,7 +4390,7 @@ A jump table for the options with a short description can be found at |Q_op|. *'mousetime'* *'mouset'* 'mousetime' 'mouset' number (default 500) global - Only for GUI, MS-DOS, Win32 and Unix with xterm. Defines the maximum + Only for GUI, Windows and Unix with xterm. Defines the maximum time in msec between two mouse clicks for the second click to be recognized as a multi click. @@ -4471,11 +4471,11 @@ A jump table for the options with a short description can be found at |Q_op|. *'opendevice'* *'odev'* *'noopendevice'* *'noodev'* 'opendevice' 'odev' boolean (default off) global - {only for MS-DOS and MS-Windows} + {only for Windows} Enable reading and writing from devices. This may get Vim stuck on a device that can be opened but doesn't actually do the I/O. Therefore it is off by default. - Note that on MS-Windows editing "aux.h", "lpt1.txt" and the like also + Note that on Windows editing "aux.h", "lpt1.txt" and the like also result in editing a device. @@ -5249,7 +5249,7 @@ A jump table for the options with a short description can be found at |Q_op|. r Removable media. The argument is a string (up to the next ','). This parameter can be given several times. Each specifies the start of a path for which no marks will be - stored. This is to avoid removable media. For MS-DOS you + stored. This is to avoid removable media. For Windows you could use "ra:,rb:". You can also use it for temp files, e.g., for Unix: "r/tmp". Case is ignored. *shada-s* @@ -5287,8 +5287,7 @@ A jump table for the options with a short description can be found at |Q_op|. *'shell'* *'sh'* *E91* 'shell' 'sh' string (default $SHELL or "sh", - MS-DOS and Win32: "command.com" or - "cmd.exe") + Windows: "cmd.exe") global Name of the shell to use for ! and :! commands. When changing the value also check these options: 'shellpipe', 'shellslash' @@ -5330,11 +5329,11 @@ A jump table for the options with a short description can be found at |Q_op|. *'shellcmdflag'* *'shcf'* 'shellcmdflag' 'shcf' string (default: "-c"; - MS-DOS and Win32, when 'shell' does not + Windows, when 'shell' does not contain "sh" somewhere: "/c") global Flag passed to the shell to execute "!" and ":!" commands; e.g., - "bash.exe -c ls" or "command.com /c dir". For the MS-DOS-like + "bash.exe -c ls" or "cmd.exe /c dir". For Windows systems, the default is set according to the value of 'shell', to reduce the need to set this option by the user. On Unix it can have more than one flag. Each white space separated @@ -5342,7 +5341,7 @@ A jump table for the options with a short description can be found at |Q_op|. See |option-backslash| about including spaces and backslashes. See |shell-unquoting| which talks about separating this option into multiple arguments. - Also see |dos-shell| for MS-DOS and MS-Windows. + Also see |dos-shell| for Windows. This option cannot be set from a |modeline| or in the |sandbox|, for security reasons. @@ -5357,7 +5356,7 @@ A jump table for the options with a short description can be found at |Q_op|. The name of the temporary file can be represented by "%s" if necessary (the file name is appended automatically if no %s appears in the value of this option). - For MS-DOS the default is ">". The output is directly saved in a file + For Windows the default is ">". The output is directly saved in a file and not echoed to the screen. For Unix the default it "| tee". The stdout of the compiler is saved in a file and echoed to the screen. If the 'shell' option is "csh" or @@ -5381,7 +5380,7 @@ A jump table for the options with a short description can be found at |Q_op|. security reasons. *'shellquote'* *'shq'* -'shellquote' 'shq' string (default: ""; MS-DOS and Win32, when 'shell' +'shellquote' 'shq' string (default: ""; Windows, when 'shell' contains "sh" somewhere: "\"") global Quoting character(s), put around the command passed to the shell, for @@ -5389,7 +5388,7 @@ A jump table for the options with a short description can be found at |Q_op|. quoting. See 'shellxquote' to include the redirection. It's probably not useful to set both options. This is an empty string by default. Only known to be useful for - third-party shells on MS-DOS-like systems, such as the MKS Korn Shell + third-party shells on Windows systems, such as the MKS Korn Shell or bash, where it should be "\"". The default is adjusted according the value of 'shell', to reduce the need to set this option by the user. See |dos-shell|. @@ -5454,7 +5453,7 @@ A jump table for the options with a short description can be found at |Q_op|. *'shellxescape'* *'sxe'* 'shellxescape' 'sxe' string (default: ""; - for MS-DOS and MS-Windows: "\"&|<>()@^") + for Windows: "\"&|<>()@^") global When 'shellxquote' is set to "(" then the characters listed in this option will be escaped with a '^' character. This makes it possible @@ -6342,9 +6341,8 @@ A jump table for the options with a short description can be found at |Q_op|. 'term' string (default is $TERM, if that fails: in the GUI: "builtin_gui" on Mac: "mac-ansi" - on MS-DOS: "pcterm" on Unix: "ansi" - on Win 32: "win32") + on Windows: "win32") global Name of the terminal. Used for choosing the terminal control characters. Environment variables are expanded |:set_env|. @@ -7100,6 +7098,6 @@ A jump table for the options with a short description can be found at |Q_op|. global The number of microseconds to wait for each character sent to the screen. When non-zero, characters are sent to the terminal one by - one. For MS-DOS pcterm this does not work. For debugging purposes. + one. For debugging purposes. vim:tw=78:ts=8:ft=help:noet:norl: diff --git a/runtime/doc/pattern.txt b/runtime/doc/pattern.txt index 212e43cd99..21eeb9bc41 100644 --- a/runtime/doc/pattern.txt +++ b/runtime/doc/pattern.txt @@ -131,7 +131,7 @@ gD Goto global Declaration. When the cursor is on a *CTRL-C* CTRL-C Interrupt current (search) command. Use CTRL-Break on - MS-DOS |dos-CTRL-Break|. + Windows |dos-CTRL-Break|. In Normal mode, any pending command is aborted. *:noh* *:nohlsearch* @@ -1084,7 +1084,7 @@ x A single character, with no special meaning, matches itself *[:backspace:]* [:backspace:] the <BS> character The brackets in character class expressions are additional to the brackets delimiting a collection. For example, the following is a - plausible pattern for a UNIX filename: "[-./[:alnum:]_~]\+" That is, + plausible pattern for a Unix filename: "[-./[:alnum:]_~]\+" That is, a list of at least one character, each of which is either '-', '.', '/', alphabetic, numeric, '_' or '~'. These items only work for 8-bit characters. diff --git a/runtime/doc/quickfix.txt b/runtime/doc/quickfix.txt index 399933b512..bcce5a983a 100644 --- a/runtime/doc/quickfix.txt +++ b/runtime/doc/quickfix.txt @@ -587,11 +587,11 @@ or simpler > "$*" can be given multiple times, for example: > :set makeprg=gcc\ -o\ $*\ $* -The 'shellpipe' option defaults to ">" for MS-DOS and Win32. This means that -the output of the compiler is saved in a file and not shown on the screen -directly. For Unix "| tee" is used. The compiler output is shown on the -screen and saved in a file the same time. Depending on the shell used "|& -tee" or "2>&1| tee" is the default, so stderr output will be included. +The 'shellpipe' option defaults to ">" on Windows. This means that the output +of the compiler is saved in a file and not shown on the screen directly. For +Unix "| tee" is used. The compiler output is shown on the screen and saved in +a file the same time. Depending on the shell used "|& tee" or "2>&1| tee" is +the default, so stderr output will be included. If 'shellpipe' is empty, the {errorfile} part will be omitted. This is useful for compilers that write to an errorfile themselves. @@ -999,9 +999,9 @@ normally happens by matching following characters and items. When nothing is following the rest of the line is matched. If "%f" is followed by a '%' or a backslash, it will look for a sequence of 'isfname' characters. -On MS-DOS and MS-Windows a leading "C:" will be included in "%f", even when -using "%f:". This means that a file name which is a single alphabetical -letter will not be detected. +On Windows a leading "C:" will be included in "%f", even when using "%f:". +This means that a file name which is a single alphabetical letter will not be +detected. The "%p" conversion is normally followed by a "^". It's used for compilers that output a line like: > diff --git a/runtime/doc/quickref.txt b/runtime/doc/quickref.txt index ec7f340581..ded5e69438 100644 --- a/runtime/doc/quickref.txt +++ b/runtime/doc/quickref.txt @@ -980,11 +980,9 @@ Short explanation of each option: *option-list* |g_CTRL-G| g CTRL-G show cursor column, line, and character position |CTRL-C| CTRL-C during searches: Interrupt the search -|dos-CTRL-Break| CTRL-Break MS-DOS: during searches: Interrupt the search +|dos-CTRL-Break| CTRL-Break Windows: during searches: Interrupt the search |<Del>| <Del> while entering a count: delete last character |:version| :ve[rsion] show version information -|:mode| :mode N MS-DOS: set screen mode to N (number, C80, - C4350, etc.) |:normal| :norm[al][!] {commands} execute Normal mode commands |Q| Q switch to "Ex" mode diff --git a/runtime/doc/recover.txt b/runtime/doc/recover.txt index 0c65b243b1..e09138b2f5 100644 --- a/runtime/doc/recover.txt +++ b/runtime/doc/recover.txt @@ -60,7 +60,7 @@ Disadvantages: If you want to put swap files in a fixed place, put a command resembling the following ones in your vimrc: :set dir=~/tmp (for Unix) - :set dir=c:\\tmp (for MS-DOS and Win32) + :set dir=c:\\tmp (for Windows) This is also very handy when editing files on floppy. Of course you will have to create that "tmp" directory for this to work! diff --git a/runtime/doc/remote.txt b/runtime/doc/remote.txt index 81ab72a100..933ab3a444 100644 --- a/runtime/doc/remote.txt +++ b/runtime/doc/remote.txt @@ -1,4 +1,4 @@ -*remote.txt* For Vim version 7.4. Last change: 2008 May 24 +*remote.txt* For Vim version 7.4. Last change: 2015 Mar 01 VIM REFERENCE MANUAL by Bram Moolenaar @@ -34,7 +34,8 @@ The following command line arguments are available: The remote Vim is raised. If you don't want this use > vim --remote-send "<C-\><C-N>:n filename<CR>" -< --remote-silent [+{cmd}] {file} ... *--remote-silent* +< + --remote-silent [+{cmd}] {file} ... *--remote-silent* As above, but don't complain if there is no server and the file is edited locally. --remote-wait [+{cmd}] {file} ... *--remote-wait* diff --git a/runtime/doc/repeat.txt b/runtime/doc/repeat.txt index 90b41d1eee..59dbbf3067 100644 --- a/runtime/doc/repeat.txt +++ b/runtime/doc/repeat.txt @@ -287,13 +287,13 @@ with CTRL-V followed by the three digit decimal code. This does NOT work for the <t_xx> termcap codes, these can only be used in mappings. *:source_crnl* *W15* -MS-DOS and Win32: Files that are read with ":source" normally have -<CR><NL> <EOL>s. These always work. If you are using a file with <NL> <EOL>s -(for example, a file made on Unix), this will be recognized if 'fileformats' -is not empty and the first line does not end in a <CR>. This fails if the -first line has something like ":map <F1> :help^M", where "^M" is a <CR>. If -the first line ends in a <CR>, but following ones don't, you will get an error -message, because the <CR> from the first lines will be lost. +Windows: Files that are read with ":source" normally have <CR><NL> <EOL>s. +These always work. If you are using a file with <NL> <EOL>s (for example, a +file made on Unix), this will be recognized if 'fileformats' is not empty and +the first line does not end in a <CR>. This fails if the first line has +something like ":map <F1> :help^M", where "^M" is a <CR>. If the first line +ends in a <CR>, but following ones don't, you will get an error message, +because the <CR> from the first lines will be lost. Mac Classic: Files that are read with ":source" normally have <CR> <EOL>s. These always work. If you are using a file with <NL> <EOL>s (for example, a @@ -303,7 +303,7 @@ linebreaks which has a <CR> in first line. On other systems, Vim expects ":source"ed files to end in a <NL>. These always work. If you are using a file with <CR><NL> <EOL>s (for example, a -file made on MS-DOS), all lines will have a trailing <CR>. This may cause +file made on Windows), all lines will have a trailing <CR>. This may cause problems for some commands (e.g., mappings). There is no automatic <EOL> detection, because it's common to start with a line that defines a mapping that ends in a <CR>, which will confuse the automaton. @@ -658,10 +658,6 @@ long you take to respond to the input() prompt is irrelevant. Profiling should give a good indication of where time is spent, but keep in mind there are various things that may clobber the results: -- The accuracy of the time measured depends on the gettimeofday() system - function. It may only be as accurate as 1/100 second, even though the times - are displayed in micro seconds. - - Real elapsed time is measured, if other processes are busy they may cause delays at unpredictable moments. You may want to run the profiling several times and use the lowest results. diff --git a/runtime/doc/starting.txt b/runtime/doc/starting.txt index f46a258e2e..e2473976eb 100644 --- a/runtime/doc/starting.txt +++ b/runtime/doc/starting.txt @@ -356,7 +356,7 @@ accordingly. Vim proceeds in this order: 1. Set the 'shell' and 'term' option *SHELL* *COMSPEC* *TERM* The environment variable SHELL, if it exists, is used to set the - 'shell' option. On MS-DOS and Win32, the COMSPEC variable is used + 'shell' option. On Windows, the COMSPEC variable is used if SHELL is not set. The environment variable TERM, if it exists, is used to set the 'term' option. However, 'term' will change later when starting the GUI (step @@ -494,7 +494,7 @@ sessions. Put it in a place so that it will be found by 3b: Local setup: Put all commands that you need for editing a specific directory only into a vimrc file and place it in that directory under the name ".nvimrc" ("_nvimrc" -for MS-DOS and Win32). NOTE: To make Vim look for these special files you +for Windows). NOTE: To make Vim look for these special files you have to turn on the option 'exrc'. See |trojan-horse| too. System setup: @@ -516,10 +516,9 @@ interfere with Vi, then use the variable VIMINIT and the file init.vim instead. MS-DOS line separators: -On MS-DOS-like systems (MS-DOS itself and Win32), Vim assumes that all -the vimrc files have <CR> <NL> pairs as line separators. This will give -problems if you have a file with only <NL>s and have a line like -":map xx yy^M". The trailing ^M will be ignored. +On Windows systems Vim assumes that all the vimrc files have <CR> <NL> pairs +as line separators. This will give problems if you have a file with only +<NL>s and have a line like ":map xx yy^M". The trailing ^M will be ignored. The $MYVIMRC or $MYGVIMRC file will be set to the first found vimrc and/or gvimrc file. @@ -947,7 +946,7 @@ about to abandon with ":bdel", use ":wsh". The '[' and ']' marks are not stored, but the '"' mark is. The '"' mark is very useful for jumping to the cursor position when the file was last exited. No marks are saved for files that start with any string given with the "r" flag in 'shada'. This can be -used to avoid saving marks for files on removable media (for MS-DOS you would +used to avoid saving marks for files on removable media (for Windows you would use "ra:,rb:". The |v:oldfiles| variable is filled with the file names that the ShaDa file has marks for. diff --git a/runtime/doc/syntax.txt b/runtime/doc/syntax.txt index 1682980b5a..78d6fdb1e1 100644 --- a/runtime/doc/syntax.txt +++ b/runtime/doc/syntax.txt @@ -71,10 +71,10 @@ with: > For a color terminal see |:hi-normal-cterm|. For setting up your own colors syntax highlighting see |syncolor|. -NOTE: The syntax files on MS-DOS and Windows have lines that end in <CR><NL>. -The files for Unix end in <NL>. This means you should use the right type of -file for your system. Although on MS-DOS and Windows the right format is -automatically selected if the 'fileformats' option is not empty. +NOTE: The syntax files on Windows have lines that end in <CR><NL>. The files +for Unix end in <NL>. This means you should use the right type of file for +your system. Although on Windows the right format is automatically selected +if the 'fileformats' option is not empty. NOTE: When using reverse video ("gvim -fg white -bg black"), the default value of 'background' will not be set until the GUI window is opened, which is after @@ -4507,7 +4507,7 @@ mentioned for the default values. See |:verbose-cmd| for more information. *highlight-args* *E416* *E417* *E423* There are three types of terminals for highlighting: term a normal terminal (vt100, xterm) -cterm a color terminal (MS-DOS console, color-xterm, these have the "Co" +cterm a color terminal (Windows console, color-xterm, these have the "Co" termcap entry) gui the GUI @@ -4653,7 +4653,7 @@ ctermbg={color-nr} *highlight-ctermbg* *E419* *E420* When Vim knows the normal foreground and background colors, "fg" and "bg" can be used as color names. This only works after setting the - colors for the Normal group and for the MS-DOS console. Example, for + colors for the Normal group and for the Windows console. Example, for reverse video: > :highlight Visual ctermfg=bg ctermbg=fg < Note that the colors are used that are valid at the moment this diff --git a/runtime/doc/term.txt b/runtime/doc/term.txt index a43da81b57..d85b4a326d 100644 --- a/runtime/doc/term.txt +++ b/runtime/doc/term.txt @@ -425,11 +425,9 @@ cleared when scrolling). Unfortunately it is not possible to deduce from the termcap how cursor positioning should be done when using a scrolling region: Relative to the beginning of the screen or relative to the beginning of the scrolling region. -Most terminals use the first method. A known exception is the MS-DOS console -(pcterm). The 't_CS' option should be set to any string when cursor -positioning is relative to the start of the scrolling region. It should be -set to an empty string otherwise. It defaults to "yes" when 'term' is -"pcterm". +Most terminals use the first method. The 't_CS' option should be set to any +string when cursor positioning is relative to the start of the scrolling +region. It should be set to an empty string otherwise. Note for xterm users: The shifted cursor keys normally don't work. You can make them work with the xmodmap command and some mappings in Vim. @@ -672,10 +670,9 @@ border, the text is scrolled. A selection can be started by pressing the left mouse button on the first character, moving the mouse to the last character, then releasing the mouse button. You will not always see the selection until you release the button, -only in some versions (GUI, MS-DOS, WIN32) will the dragging be shown -immediately. Note that you can make the text scroll by moving the mouse at -least one character in the first/last line in the window when 'scrolloff' is -non-zero. +only in some versions (GUI, Windows) will the dragging be shown immediately. +Note that you can make the text scroll by moving the mouse at least one +character in the first/last line in the window when 'scrolloff' is non-zero. In Normal, Visual and Select mode clicking the right mouse button causes the Visual area to be extended. When 'mousemodel' is "popup", the left button has @@ -689,9 +686,9 @@ work on systems where the window manager consumes the mouse events when the alt key is pressed (it may move the window). *double-click* -Double, triple and quadruple clicks are supported when the GUI is active, -for MS-DOS and Win32, and for an xterm (if the gettimeofday() function is -available). For selecting text, extra clicks extend the selection: +Double, triple and quadruple clicks are supported when the GUI is active, for +Windows and for an xterm. For selecting text, extra clicks extend the +selection: click select ~ double word or % match *<2-LeftMouse>* triple line *<3-LeftMouse>* diff --git a/runtime/doc/usr_02.txt b/runtime/doc/usr_02.txt index cd25b14e32..f81a4e3a2c 100644 --- a/runtime/doc/usr_02.txt +++ b/runtime/doc/usr_02.txt @@ -29,11 +29,10 @@ To start Vim, enter this command: > gvim file.txt -In UNIX you can type this at any command prompt. If you are running Microsoft -Windows, open an MS-DOS prompt window and enter the command. - In either case, Vim starts editing a file called file.txt. Because this -is a new file, you get a blank window. This is what your screen will look -like: +On Unix you can type this at any command prompt. If you are running Windows, +open a command prompt window and enter the command. In either case, Vim +starts editing a file called file.txt. Because this is a new file, you get a +blank window. This is what your screen will look like: +---------------------------------------+ |# | @@ -61,10 +60,9 @@ use this command: > the editing occurs inside your command window. In other words, if you are running inside an xterm, the editor uses your xterm window. If you are using -an MS-DOS command prompt window under Microsoft Windows, the editing occurs -inside this window. The text in the window will look the same for both -versions, but with gvim you have extra features, like a menu bar. More about -that later. +the command prompt under Microsoft Windows, the editing occurs inside this +window. The text in the window will look the same for both versions, but with +gvim you have extra features, like a menu bar. More about that later. ============================================================================== *02.2* Inserting text @@ -80,7 +78,7 @@ mistakes; you can correct them later. To enter the following programmer's limerick, this is what you type: > iA very intelligent turtle - Found programming UNIX a hurdle + Found programming Unix a hurdle After typing "turtle" you press the <Enter> key to start a new line. Finally you press the <Esc> key to stop Insert mode and go back to Normal mode. You @@ -88,7 +86,7 @@ now have two lines of text in your Vim window: +---------------------------------------+ |A very intelligent turtle | - |Found programming UNIX a hurdle | + |Found programming Unix a hurdle | |~ | |~ | | | @@ -110,7 +108,7 @@ of the window. This indicates you are in Insert mode. +---------------------------------------+ |A very intelligent turtle | - |Found programming UNIX a hurdle | + |Found programming Unix a hurdle | |~ | |~ | |-- INSERT -- | @@ -187,7 +185,7 @@ look like this: +---------------------------------------+ |intelligent turtle | - |Found programming UNIX a hurdle | + |Found programming Unix a hurdle | |~ | |~ | | | @@ -202,7 +200,7 @@ insert mode (the final <Esc>). The result: +---------------------------------------+ |A young intelligent turtle | - |Found programming UNIX a hurdle | + |Found programming Unix a hurdle | |~ | |~ | | | @@ -215,7 +213,7 @@ To delete a whole line use the "dd" command. The following line will then move up to fill the gap: +---------------------------------------+ - |Found programming UNIX a hurdle | + |Found programming Unix a hurdle | |~ | |~ | |~ | @@ -332,7 +330,7 @@ Insert mode. Then you can type the text for the new line. Suppose the cursor is somewhere in the first of these two lines: A very intelligent turtle ~ - Found programming UNIX a hurdle ~ + Found programming Unix a hurdle ~ If you now use the "o" command and type new text: > @@ -342,7 +340,7 @@ The result is: A very intelligent turtle ~ That liked using Vim ~ - Found programming UNIX a hurdle ~ + Found programming Unix a hurdle ~ The "O" command (uppercase) opens a line above the cursor. diff --git a/runtime/doc/usr_09.txt b/runtime/doc/usr_09.txt index 05cc32bceb..d68d734b8f 100644 --- a/runtime/doc/usr_09.txt +++ b/runtime/doc/usr_09.txt @@ -134,10 +134,10 @@ The following command makes the mouse work like a Microsoft Windows mouse: > :behave mswin -The default behavior of the mouse on UNIX systems is xterm. The default -behavior on a Microsoft Windows system is selected during the installation -process. For details about what the two behaviors are, see |:behave|. Here -follows a summary. +The default behavior of the mouse on Unix systems is xterm. The default +behavior on Windows systems is selected during the installation process. For +details about what the two behaviors are, see |:behave|. Here follows a +summary. XTERM MOUSE BEHAVIOR diff --git a/runtime/doc/usr_10.txt b/runtime/doc/usr_10.txt index 64b0181c35..bf7ba18222 100644 --- a/runtime/doc/usr_10.txt +++ b/runtime/doc/usr_10.txt @@ -698,10 +698,10 @@ still be something that an external command can do better or faster. through an external program. In other words, it runs the system command represented by {program}, giving it the block of text represented by {motion} as input. The output of this command then replaces the selected block. - Because this summarizes badly if you are unfamiliar with UNIX filters, take + Because this summarizes badly if you are unfamiliar with Unix filters, take a look at an example. The sort command sorts a file. If you execute the following command, the unsorted file input.txt will be sorted and written to -output.txt. (This works on both UNIX and Microsoft Windows.) > +output.txt. This works on both Unix and Windows. > sort <input.txt >output.txt diff --git a/runtime/doc/usr_12.txt b/runtime/doc/usr_12.txt index fba1b53274..237abae55f 100644 --- a/runtime/doc/usr_12.txt +++ b/runtime/doc/usr_12.txt @@ -309,7 +309,7 @@ matches can be found. ============================================================================== *12.8* Find where a word is used -If you are a UNIX user, you can use a combination of Vim and the grep command +If you are a Unix user, you can use a combination of Vim and the grep command to edit all the files that contain a given word. This is extremely useful if you are working on a program and want to view or edit all the files that contain a specific variable. @@ -324,7 +324,7 @@ will only list the files containing the word and not print the matching lines. The word it is searching for is "frame_counter". Actually, this can be any regular expression. (Note: What grep uses for regular expressions is not exactly the same as what Vim uses.) - The entire command is enclosed in backticks (`). This tells the UNIX shell + The entire command is enclosed in backticks (`). This tells the Unix shell to run this command and pretend that the results were typed on the command line. So what happens is that the grep command is run and produces a list of files, these files are put on the Vim command line. This results in Vim diff --git a/runtime/doc/usr_23.txt b/runtime/doc/usr_23.txt index bdb3b7afd6..4761203512 100644 --- a/runtime/doc/usr_23.txt +++ b/runtime/doc/usr_23.txt @@ -25,7 +25,7 @@ Back in the early days, the old Teletype machines used two characters to start a new line. One to move the carriage back to the first position (carriage return, <CR>), another to move the paper up (line feed, <LF>). When computers came out, storage was expensive. Some people decided that -they did not need two characters for end-of-line. The UNIX people decided +they did not need two characters for end-of-line. The Unix people decided they could use <Line Feed> only for end-of-line. The Apple people standardized on <CR>. The MS-DOS (and Microsoft Windows) folks decided to keep the old <CR><LF>. @@ -34,7 +34,7 @@ have line-break problems. The Vim editor automatically recognizes the different file formats and handles things properly behind your back. The option 'fileformats' contains the various formats that will be tried when a new file is edited. The following command, for example, tells Vim to -try UNIX format first and MS-DOS format second: > +try Unix format first and MS-DOS format second: > :set fileformats=unix,dos @@ -97,12 +97,12 @@ CONVERSION You can use the 'fileformat' option to convert from one file format to another. Suppose, for example, that you have an MS-DOS file named README.TXT -that you want to convert to UNIX format. Start by editing the MS-DOS format +that you want to convert to Unix format. Start by editing the MS-DOS format file: > vim README.TXT Vim will recognize this as a dos format file. Now change the file format to -UNIX: > +Unix: > :set fileformat=unix :write diff --git a/runtime/doc/usr_24.txt b/runtime/doc/usr_24.txt index 46a22c683c..ba9d083fe0 100644 --- a/runtime/doc/usr_24.txt +++ b/runtime/doc/usr_24.txt @@ -563,9 +563,9 @@ that combination. Thus CTRL-K dP also works. Since there is no digraph for "dP" Vim will also search for a "Pd" digraph. Note: - The digraphs depend on the character set that Vim assumes you are - using. On MS-DOS they are different from MS-Windows. Always use - ":digraphs" to find out which digraphs are currently available. + The digraphs depend on the character set that Vim assumes you + are using. Always use ":digraphs" to find out which digraphs are + currently available. You can define your own digraphs. Example: > diff --git a/runtime/doc/usr_27.txt b/runtime/doc/usr_27.txt index fb096593f2..d837610698 100644 --- a/runtime/doc/usr_27.txt +++ b/runtime/doc/usr_27.txt @@ -83,7 +83,7 @@ matter if 'ignorecase' or 'smartcase' was changed. Note: If your search takes much longer than you expected, you can interrupt - it with CTRL-C on Unix and CTRL-Break on MS-DOS and MS-Windows. + it with CTRL-C on Unix and CTRL-Break on Windows. ============================================================================== *27.2* Wrapping around the file end diff --git a/runtime/doc/usr_41.txt b/runtime/doc/usr_41.txt index c6b143ca0e..8017b99f97 100644 --- a/runtime/doc/usr_41.txt +++ b/runtime/doc/usr_41.txt @@ -1499,8 +1499,8 @@ Here is a summary of items that apply to Vim scripts. They are also mentioned elsewhere, but form a nice checklist. The end-of-line character depends on the system. For Unix a single <NL> -character is used. For MS-DOS, Windows and the like, <CR><LF> is used. -This is important when using mappings that end in a <CR>. See |:source_crnl|. +character is used. For Windows <CR><LF> is used. This is important when +using mappings that end in a <CR>. See |:source_crnl|. WHITE SPACE diff --git a/runtime/doc/various.txt b/runtime/doc/various.txt index ad0f541dfd..f028102634 100644 --- a/runtime/doc/various.txt +++ b/runtime/doc/various.txt @@ -563,7 +563,7 @@ which it was defined is reported. :5sleep "sleep for five seconds :sleep 100m "sleep for a hundred milliseconds 10gs "sleep for ten seconds -< Can be interrupted with CTRL-C (CTRL-Break on MS-DOS). +< Can be interrupted with CTRL-C (CTRL-Break on Windows). "gs" stands for "goto sleep". While sleeping the cursor is positioned in the text, if at a visible position. diff --git a/runtime/doc/vi_diff.txt b/runtime/doc/vi_diff.txt index 34e8731898..38248d1b22 100644 --- a/runtime/doc/vi_diff.txt +++ b/runtime/doc/vi_diff.txt @@ -44,8 +44,7 @@ Memory usage limits The option 'maxmem' ('mm') is used to set the maximum memory used for one buffer (in kilobytes). 'maxmemtot' is used to set the maximum memory used for -all buffers (in kilobytes). The defaults depend on the system used. For -MS-DOS, 'maxmemtot' is set depending on the amount of memory available. +all buffers (in kilobytes). The defaults depend on the system used. These are not hard limits, but tell Vim when to move text into a swap file. If you don't like Vim to swap to a file, set 'maxmem' and 'maxmemtot' to a very large value. The swap file will then only be used for recovery. If you diff --git a/runtime/syntax/java.vim b/runtime/syntax/java.vim index e5491b2612..e113a904c3 100644 --- a/runtime/syntax/java.vim +++ b/runtime/syntax/java.vim @@ -2,7 +2,7 @@ " Language: Java " Maintainer: Claudio Fleiner <claudio@fleiner.com> " URL: http://www.fleiner.com/vim/syntax/java.vim -" Last Change: 2012 Oct 05 +" Last Change: 2015 March 01 " Please check :help java.vim for comments on some of the options available. @@ -30,7 +30,7 @@ endif " some characters that cannot be in a java program (outside a string) syn match javaError "[\\@`]" -syn match javaError "<<<\|\.\.\|=>\|||=\|&&=\|[^-]->\|\*\/" +syn match javaError "<<<\|\.\.\|=>\|||=\|&&=\|\*\/" syn match javaOK "\.\.\." @@ -63,7 +63,7 @@ syn match javaTypedef "\.\s*\<class\>"ms=s+1 syn keyword javaClassDecl enum syn match javaClassDecl "^class\>" syn match javaClassDecl "[^.]\s*\<class\>"ms=s+1 -syn match javaAnnotation "@\([_$a-zA-Z][_$a-zA-Z0-9]*\.\)*[_$a-zA-Z][_$a-zA-Z0-9]*\>" +syn match javaAnnotation "@\([_$a-zA-Z][_$a-zA-Z0-9]*\.\)*[_$a-zA-Z][_$a-zA-Z0-9]*\>\(([^)]*)\)\=" contains=javaString syn match javaClassDecl "@interface\>" syn keyword javaBranch break continue nextgroup=javaUserLabelRef skipwhite syn match javaUserLabelRef "\k\+" contained @@ -121,7 +121,7 @@ if exists("java_space_errors") endif endif -syn region javaLabelRegion transparent matchgroup=javaLabel start="\<case\>" matchgroup=NONE end=":" contains=javaNumber,javaCharacter +syn region javaLabelRegion transparent matchgroup=javaLabel start="\<case\>" matchgroup=NONE end=":" contains=javaNumber,javaCharacter,javaString syn match javaUserLabel "^\s*[_$a-zA-Z][_$a-zA-Z0-9_]*\s*:"he=e-1 contains=javaLabel syn keyword javaLabel default @@ -188,10 +188,10 @@ syn region javaString start=+"+ end=+"+ end=+$+ contains=javaSpecialChar,javaS syn match javaCharacter "'[^']*'" contains=javaSpecialChar,javaSpecialCharError syn match javaCharacter "'\\''" contains=javaSpecialChar syn match javaCharacter "'[^\\]'" -syn match javaNumber "\<\(0[0-7]*\|0[xX]\x\+\|\d\+\)[lL]\=\>" -syn match javaNumber "\(\<\d\+\.\d*\|\.\d\+\)\([eE][-+]\=\d\+\)\=[fFdD]\=" -syn match javaNumber "\<\d\+[eE][-+]\=\d\+[fFdD]\=\>" -syn match javaNumber "\<\d\+\([eE][-+]\=\d\+\)\=[fFdD]\>" +syn match javaNumber "\<\(0[bB][0-1]\+\|0[0-7]*\|0[xX]\x\+\|\d\(\d\|_\d\)*\)[lL]\=\>" +syn match javaNumber "\(\<\d\(\d\|_\d\)*\.\(\d\(\d\|_\d\)*\)\=\|\.\d\(\d\|_\d\)*\)\([eE][-+]\=\d\(\d\|_\d\)*\)\=[fFdD]\=" +syn match javaNumber "\<\d\(\d\|_\d\)*[eE][-+]\=\d\(\d\|_\d\)*[fFdD]\=\>" +syn match javaNumber "\<\d\(\d\|_\d\)*\([eE][-+]\=\d\(\d\|_\d\)*\)\=[fFdD]\>" " unicode characters syn match javaSpecial "\\u\d\{4\}" @@ -200,19 +200,21 @@ syn cluster javaTop add=javaString,javaCharacter,javaNumber,javaSpecial,javaStri if exists("java_highlight_functions") if java_highlight_functions == "indent" - syn match javaFuncDef "^\(\t\| \{8\}\)[_$a-zA-Z][_$a-zA-Z0-9_. \[\]]*([^-+*/()]*)" contains=javaScopeDecl,javaType,javaStorageClass,@javaClasses - syn region javaFuncDef start=+^\(\t\| \{8\}\)[$_a-zA-Z][$_a-zA-Z0-9_. \[\]]*([^-+*/()]*,\s*+ end=+)+ contains=javaScopeDecl,javaType,javaStorageClass,@javaClasses - syn match javaFuncDef "^ [$_a-zA-Z][$_a-zA-Z0-9_. \[\]]*([^-+*/()]*)" contains=javaScopeDecl,javaType,javaStorageClass,@javaClasses - syn region javaFuncDef start=+^ [$_a-zA-Z][$_a-zA-Z0-9_. \[\]]*([^-+*/()]*,\s*+ end=+)+ contains=javaScopeDecl,javaType,javaStorageClass,@javaClasses + syn match javaFuncDef "^\(\t\| \{8\}\)[_$a-zA-Z][_$a-zA-Z0-9_. \[\]<>]*([^-+*/]*)" contains=javaScopeDecl,javaType,javaStorageClass,@javaClasses,javaAnnotation + syn region javaFuncDef start=+^\(\t\| \{8\}\)[$_a-zA-Z][$_a-zA-Z0-9_. \[\]<>]*([^-+*/]*,\s*+ end=+)+ contains=javaScopeDecl,javaType,javaStorageClass,@javaClasses,javaAnnotation + syn match javaFuncDef "^ [$_a-zA-Z][$_a-zA-Z0-9_. \[\]<>]*([^-+*/]*)" contains=javaScopeDecl,javaType,javaStorageClass,@javaClasses,javaAnnotation + syn region javaFuncDef start=+^ [$_a-zA-Z][$_a-zA-Z0-9_. \[\]<>]*([^-+*/]*,\s*+ end=+)+ contains=javaScopeDecl,javaType,javaStorageClass,@javaClasses,javaAnnotation else " This line catches method declarations at any indentation>0, but it assumes " two things: " 1. class names are always capitalized (ie: Button) " 2. method names are never capitalized (except constructors, of course) - syn region javaFuncDef start=+^\s\+\(\(public\|protected\|private\|static\|abstract\|final\|native\|synchronized\)\s\+\)*\(\(void\|boolean\|char\|byte\|short\|int\|long\|float\|double\|\([A-Za-z_][A-Za-z0-9_$]*\.\)*[A-Z][A-Za-z0-9_$]*\)\(<[^>]*>\)\=\(\[\]\)*\s\+[a-z][A-Za-z0-9_$]*\|[A-Z][A-Za-z0-9_$]*\)\s*([^0-9]+ end=+)+ contains=javaScopeDecl,javaType,javaStorageClass,javaComment,javaLineComment,@javaClasses + "syn region javaFuncDef start=+^\s\+\(\(public\|protected\|private\|static\|abstract\|final\|native\|synchronized\)\s\+\)*\(\(void\|boolean\|char\|byte\|short\|int\|long\|float\|double\|\([A-Za-z_][A-Za-z0-9_$]*\.\)*[A-Z][A-Za-z0-9_$]*\)\(<[^>]*>\)\=\(\[\]\)*\s\+[a-z][A-Za-z0-9_$]*\|[A-Z][A-Za-z0-9_$]*\)\s*([^0-9]+ end=+)+ contains=javaScopeDecl,javaType,javaStorageClass,javaComment,javaLineComment,@javaClasses + syn region javaFuncDef start=+^\s\+\(\(public\|protected\|private\|static\|abstract\|final\|native\|synchronized\)\s\+\)*\(<.*>\s\+\)\?\(\(void\|boolean\|char\|byte\|short\|int\|long\|float\|double\|\([A-Za-z_][A-Za-z0-9_$]*\.\)*[A-Z][A-Za-z0-9_$]*\)\(<[^(){}]*>\)\=\(\[\]\)*\s\+[a-z][A-Za-z0-9_$]*\|[A-Z][A-Za-z0-9_$]*\)\s*(+ end=+)+ contains=javaScopeDecl,javaType,javaStorageClass,javaComment,javaLineComment,@javaClasses,javaAnnotation endif + syn match javaLambdaDef "[a-zA-Z_][a-zA-Z0-9_]*\s*->" syn match javaBraces "[{}]" - syn cluster javaTop add=javaFuncDef,javaBraces + syn cluster javaTop add=javaFuncDef,javaBraces,javaLambdaDef endif if exists("java_highlight_debug") @@ -266,18 +268,23 @@ if exists("java_mark_braces_in_parens_as_errors") endif " catch errors caused by wrong parenthesis -syn region javaParenT transparent matchgroup=javaParen start="(" end=")" contains=@javaTop,javaParenT1 +syn region javaParenT transparent matchgroup=javaParen start="(" end=")" contains=@javaTop,javaParenT1 syn region javaParenT1 transparent matchgroup=javaParen1 start="(" end=")" contains=@javaTop,javaParenT2 contained syn region javaParenT2 transparent matchgroup=javaParen2 start="(" end=")" contains=@javaTop,javaParenT contained syn match javaParenError ")" " catch errors caused by wrong square parenthesis -syn region javaParenT transparent matchgroup=javaParen start="\[" end="\]" contains=@javaTop,javaParenT1 +syn region javaParenT transparent matchgroup=javaParen start="\[" end="\]" contains=@javaTop,javaParenT1 syn region javaParenT1 transparent matchgroup=javaParen1 start="\[" end="\]" contains=@javaTop,javaParenT2 contained syn region javaParenT2 transparent matchgroup=javaParen2 start="\[" end="\]" contains=@javaTop,javaParenT contained syn match javaParenError "\]" JavaHiLink javaParenError javaError +if exists("java_highlight_functions") + syn match javaLambdaDef "([a-zA-Z0-9_<>\[\], \t]*)\s*->" + " needs to be defined after the parenthesis error catcher to work +endif + if !exists("java_minlines") let java_minlines = 10 endif @@ -288,6 +295,7 @@ if version >= 508 || !exists("did_java_syn_inits") if version < 508 let did_java_syn_inits = 1 endif + JavaHiLink javaLambdaDef Function JavaHiLink javaFuncDef Function JavaHiLink javaVarArg Function JavaHiLink javaBraces Function diff --git a/scripts/vim-patch.sh b/scripts/vim-patch.sh index c0934a17e3..badf747742 100755 --- a/scripts/vim-patch.sh +++ b/scripts/vim-patch.sh @@ -182,7 +182,7 @@ list_vim_patches() { local patch_number="${BASH_REMATCH[2]}" # Tagged Vim patch, check version.c: is_missing="$(sed -n '/static int included_patches/,/}/p' "${NEOVIM_SOURCE_DIR}/src/nvim/version.c" | - grep -x -e "[[:space:]]*//${patch_number} NA" -e "[[:space:]]*${patch_number}," >/dev/null && echo "false" || echo "true")" + grep -x -e "[[:space:]]*//[[:space:]]${patch_number} NA" -e "[[:space:]]*${patch_number}," >/dev/null && echo "false" || echo "true")" vim_commit="${BASH_REMATCH[1]//-/.}" else # Untagged Vim patch (e.g. runtime updates), check the Neovim git log: diff --git a/src/nvim/ex_cmds.c b/src/nvim/ex_cmds.c index 34c25589d4..29d87d0fc1 100644 --- a/src/nvim/ex_cmds.c +++ b/src/nvim/ex_cmds.c @@ -951,30 +951,26 @@ void do_bang(int addr_count, exarg_T *eap, int forceit, int do_in, int do_out) xfree(newcmd); } -/* - * do_filter: filter lines through a command given by the user - * - * We mostly use temp files and the call_shell() routine here. This would - * normally be done using pipes on a UNIX machine, but this is more portable - * to non-unix machines. The call_shell() routine needs to be able - * to deal with redirection somehow, and should handle things like looking - * at the PATH env. variable, and adding reasonable extensions to the - * command name given by the user. All reasonable versions of call_shell() - * do this. - * Alternatively, if on Unix and redirecting input or output, but not both, - * and the 'shelltemp' option isn't set, use pipes. - * We use input redirection if do_in is TRUE. - * We use output redirection if do_out is TRUE. - */ -static void -do_filter ( +// do_filter: filter lines through a command given by the user +// +// We mostly use temp files and the call_shell() routine here. This would +// normally be done using pipes on a Unix system, but this is more portable +// to non-Unix systems. The call_shell() routine needs to be able +// to deal with redirection somehow, and should handle things like looking +// at the PATH env. variable, and adding reasonable extensions to the +// command name given by the user. All reasonable versions of call_shell() +// do this. +// Alternatively, if on Unix and redirecting input or output, but not both, +// and the 'shelltemp' option isn't set, use pipes. +// We use input redirection if do_in is TRUE. +// We use output redirection if do_out is TRUE. +static void do_filter( linenr_T line1, linenr_T line2, exarg_T *eap, /* for forced 'ff' and 'fenc' */ char_u *cmd, int do_in, - int do_out -) + int do_out) { char_u *itmp = NULL; char_u *otmp = NULL; @@ -1690,7 +1686,7 @@ check_overwrite ( && os_file_exists(ffname)) { if (!eap->forceit && !eap->append) { #ifdef UNIX - /* with UNIX it is possible to open a directory */ + // It is possible to open a directory on Unix. if (os_isdir(ffname)) { EMSG2(_(e_isadir2), ffname); return FAIL; diff --git a/src/nvim/ex_cmds2.c b/src/nvim/ex_cmds2.c index 57153cf5a1..47774f5a99 100644 --- a/src/nvim/ex_cmds2.c +++ b/src/nvim/ex_cmds2.c @@ -6,6 +6,7 @@ #include <inttypes.h> #include <stdbool.h> #include <string.h> +#include <fcntl.h> #include "nvim/vim.h" #include "nvim/ascii.h" diff --git a/src/nvim/ex_docmd.c b/src/nvim/ex_docmd.c index 84bd31d9ad..cbe7c1a231 100644 --- a/src/nvim/ex_docmd.c +++ b/src/nvim/ex_docmd.c @@ -6843,9 +6843,9 @@ void ex_cd(exarg_T *eap) prev_dir = NULL; #if defined(UNIX) - /* for UNIX ":cd" means: go to home directory */ + // On Unix ":cd" means: go to home directory. if (*new_dir == NUL) { - /* use NameBuff for home directory name */ + // Use NameBuff for home directory name. expand_env((char_u *)"$HOME", NameBuff, MAXPATHL); new_dir = NameBuff; } diff --git a/src/nvim/ex_getln.c b/src/nvim/ex_getln.c index 6d81f3680a..eca62da949 100644 --- a/src/nvim/ex_getln.c +++ b/src/nvim/ex_getln.c @@ -596,7 +596,7 @@ static int command_line_execute(VimState *state, int key) } if (s->j > 0) { - // TODO(tarruda): this is only for DOS/UNIX systems - need to put in + // TODO(tarruda): this is only for DOS/Unix systems - need to put in // machine-specific stuff here and in upseg init cmdline_del(s->j); put_on_cmdline(upseg + 1, 3, false); diff --git a/src/nvim/fileio.c b/src/nvim/fileio.c index bd0f0fc80a..26376afa27 100644 --- a/src/nvim/fileio.c +++ b/src/nvim/fileio.c @@ -7,6 +7,7 @@ #include <stdbool.h> #include <string.h> #include <inttypes.h> +#include <fcntl.h> #include "nvim/vim.h" #include "nvim/ascii.h" @@ -366,14 +367,13 @@ readfile ( /* don't display the file info for another buffer now */ need_fileinfo = FALSE; - /* - * For Unix: Use the short file name whenever possible. - * Avoids problems with networks and when directory names are changed. - * Don't do this for MS-DOS, a "cd" in a sub-shell may have moved us to - * another directory, which we don't detect. - */ - if (sfname == NULL) + // For Unix: Use the short file name whenever possible. + // Avoids problems with networks and when directory names are changed. + // Don't do this for Windows, a "cd" in a sub-shell may have moved us to + // another directory, which we don't detect. + if (sfname == NULL) { sfname = fname; + } #if defined(UNIX) fname = sfname; #endif @@ -1992,13 +1992,14 @@ failed: } #ifdef OPEN_CHR_FILES -/* - * Returns TRUE if the file name argument is of the form "/dev/fd/\d\+", - * which is the name of files used for process substitution output by - * some shells on some operating systems, e.g., bash on SunOS. - * Do not accept "/dev/fd/[012]", opening these may hang Vim. - */ -static int is_dev_fd_file(char_u *fname) +/// Returns true if the file name argument is of the form "/dev/fd/\d\+", +/// which is the name of files used for process substitution output by +/// some shells on some operating systems, e.g., bash on SunOS. +/// Do not accept "/dev/fd/[012]", opening these may hang Vim. +/// +/// @param fname file name to check +static bool is_dev_fd_file(char_u *fname) + FUNC_ATTR_NONNULL_ALL FUNC_ATTR_WARN_UNUSED_RESULT { return STRNCMP(fname, "/dev/fd/", 8) == 0 && ascii_isdigit(fname[8]) @@ -2353,13 +2354,12 @@ buf_write ( if (sfname == NULL) sfname = fname; - /* - * For Unix: Use the short file name whenever possible. - * Avoids problems with networks and when directory names are changed. - * Don't do this for MS-DOS, a "cd" in a sub-shell may have moved us to - * another directory, which we don't detect - */ - ffname = fname; /* remember full fname */ + + // For Unix: Use the short file name whenever possible. + // Avoids problems with networks and when directory names are changed. + // Don't do this for Windows, a "cd" in a sub-shell may have moved us to + // another directory, which we don't detect. + ffname = fname; // remember full fname #ifdef UNIX fname = sfname; #endif @@ -3807,29 +3807,30 @@ void msg_add_fname(buf_T *buf, char_u *fname) STRCAT(IObuff, "\" "); } -/* - * Append message for text mode to IObuff. - * Return TRUE if something appended. - */ -static int msg_add_fileformat(int eol_type) +/// Append message for text mode to IObuff. +/// +/// @param eol_type line ending type +/// +/// @return true if something was appended. +static bool msg_add_fileformat(int eol_type) { #ifndef USE_CRNL if (eol_type == EOL_DOS) { STRCAT(IObuff, shortmess(SHM_TEXT) ? _("[dos]") : _("[dos format]")); - return TRUE; + return true; } #endif if (eol_type == EOL_MAC) { STRCAT(IObuff, shortmess(SHM_TEXT) ? _("[mac]") : _("[mac format]")); - return TRUE; + return true; } #ifdef USE_CRNL if (eol_type == EOL_UNIX) { STRCAT(IObuff, shortmess(SHM_TEXT) ? _("[unix]") : _("[unix format]")); - return TRUE; + return true; } #endif - return FALSE; + return false; } /* @@ -3893,7 +3894,11 @@ static int check_mtime(buf_T *buf, FileInfo *file_info) return OK; } -static int time_differs(long t1, long t2) +/// Return true if the times differ +/// +/// @param t1 first time +/// @param t2 second time +static bool time_differs(long t1, long t2) FUNC_ATTR_CONST { #if defined(__linux__) || defined(MSWIN) /* On a FAT filesystem, esp. under Linux, there are only 5 bits to store @@ -4082,19 +4087,17 @@ static int buf_write_bytes(struct bw_info *ip) return (wlen < len) ? FAIL : OK; } -/* - * Convert a Unicode character to bytes. - * Return TRUE for an error, FALSE when it's OK. - */ -static int -ucs2bytes ( - unsigned c, /* in: character */ - char_u **pp, /* in/out: pointer to result */ - int flags /* FIO_ flags */ -) +/// Convert a Unicode character to bytes. +/// +/// @param c character to convert +/// @param[in,out] pp pointer to store the result at +/// @param flags FIO_ flags that specify which encoding to use +/// +/// @return true for an error, false when it's OK. +static bool ucs2bytes(unsigned c, char_u **pp, int flags) FUNC_ATTR_NONNULL_ALL { char_u *p = *pp; - int error = FALSE; + bool error = false; int cc; @@ -4116,8 +4119,9 @@ ucs2bytes ( /* Make two words, ten bits of the character in each. First * word is 0xd800 - 0xdbff, second one 0xdc00 - 0xdfff */ c -= 0x10000; - if (c >= 0x100000) - error = TRUE; + if (c >= 0x100000) { + error = true; + } cc = ((c >> 10) & 0x3ff) + 0xd800; if (flags & FIO_ENDIAN_L) { *p++ = cc; @@ -4127,8 +4131,9 @@ ucs2bytes ( *p++ = cc; } c = (c & 0x3ff) + 0xdc00; - } else - error = TRUE; + } else { + error = true; + } } if (flags & FIO_ENDIAN_L) { *p++ = c; @@ -4139,7 +4144,7 @@ ucs2bytes ( } } else { /* Latin1 */ if (c >= 0x100) { - error = TRUE; + error = true; *p++ = 0xBF; } else *p++ = c; @@ -4149,11 +4154,14 @@ ucs2bytes ( return error; } -/* - * Return TRUE if file encoding "fenc" requires conversion from or to - * 'encoding'. - */ -static int need_conversion(char_u *fenc) +/// Return true if file encoding "fenc" requires conversion from or to +/// 'encoding'. +/// +/// @param fenc file encoding to check +/// +/// @return true if conversion is required +static bool need_conversion(const char_u *fenc) + FUNC_ATTR_NONNULL_ALL FUNC_ATTR_WARN_UNUSED_RESULT { int same_encoding; int enc_flags; @@ -4180,19 +4188,19 @@ static int need_conversion(char_u *fenc) return !(enc_utf8 && fenc_flags == FIO_UTF8); } -/* - * Check "ptr" for a unicode encoding and return the FIO_ flags needed for the - * internal conversion. - * if "ptr" is an empty string, use 'encoding'. - */ -static int get_fio_flags(char_u *ptr) +/// Return the FIO_ flags needed for the internal conversion if 'name' was +/// unicode or latin1, otherwise 0. If "name" is an empty string, +/// use 'encoding'. +/// +/// @param name string to check for encoding +static int get_fio_flags(const char_u *name) { int prop; - if (*ptr == NUL) - ptr = p_enc; - - prop = enc_canon_props(ptr); + if (*name == NUL) { + name = p_enc; + } + prop = enc_canon_props(name); if (prop & ENC_UNICODE) { if (prop & ENC_2BYTE) { if (prop & ENC_ENDIAN_L) @@ -4424,11 +4432,15 @@ char *modname(const char *fname, const char *ext, bool prepend_dot) return retval; } -/* - * Like fgets(), but if the file line is too long, it is truncated and the - * rest of the line is thrown away. Returns TRUE for end-of-file. - */ -int vim_fgets(char_u *buf, int size, FILE *fp) +/// Like fgets(), but if the file line is too long, it is truncated and the +/// rest of the line is thrown away. +/// +/// @param[out] buf buffer to fill +/// @param size size of the buffer +/// @param fp file to read from +/// +/// @return true for end-of-file. +bool vim_fgets(char_u *buf, int size, FILE *fp) FUNC_ATTR_NONNULL_ALL { char *eof; #define FGETS_SIZE 200 @@ -5327,11 +5339,13 @@ static void au_del_group(char_u *name) } } -/* - * Find the ID of an autocmd group name. - * Return it's ID. Returns AUGROUP_ERROR (< 0) for error. - */ -static int au_find_group(char_u *name) +/// Find the ID of an autocmd group name. +/// +/// @param name augroup name +/// +/// @return the ID or AUGROUP_ERROR (< 0) for error. +static int au_find_group(const char_u *name) + FUNC_ATTR_PURE FUNC_ATTR_WARN_UNUSED_RESULT { for (int i = 0; i < augroups.ga_len; ++i) { if (AUGROUP_NAME(i) != NULL && STRCMP(AUGROUP_NAME(i), name) == 0) { @@ -5341,10 +5355,11 @@ static int au_find_group(char_u *name) return AUGROUP_ERROR; } -/* - * Return TRUE if augroup "name" exists. - */ -int au_has_group(char_u *name) +/// Return true if augroup "name" exists. +/// +/// @param name augroup name +bool au_has_group(const char_u *name) + FUNC_ATTR_PURE FUNC_ATTR_WARN_UNUSED_RESULT { return au_find_group(name) != AUGROUP_ERROR; } @@ -5461,21 +5476,24 @@ find_end_event ( return pat; } -/* - * Return TRUE if "event" is included in 'eventignore'. - */ -static int event_ignored(event_T event) +/// Return true if "event" is included in 'eventignore'. +/// +/// @param event event to check +static bool event_ignored(event_T event) + FUNC_ATTR_PURE FUNC_ATTR_WARN_UNUSED_RESULT { - char_u *p = p_ei; + char_u *p = p_ei; while (*p != NUL) { - if (STRNICMP(p, "all", 3) == 0 && (p[3] == NUL || p[3] == ',')) - return TRUE; - if (event_name2nr(p, &p) == event) - return TRUE; + if (STRNICMP(p, "all", 3) == 0 && (p[3] == NUL || p[3] == ',')) { + return true; + } + if (event_name2nr(p, &p) == event) { + return true; + } } - return FALSE; + return false; } /* @@ -5992,18 +6010,19 @@ void ex_doautoall(exarg_T *eap) check_cursor(); /* just in case lines got deleted */ } -/* - * Check *argp for <nomodeline>. When it is present return FALSE, otherwise - * return TRUE and advance *argp to after it. - * Thus return TRUE when do_modelines() should be called. - */ -int check_nomodeline(char_u **argp) +/// Check *argp for <nomodeline>. When it is present return false, otherwise +/// return true and advance *argp to after it. Thus do_modelines() should be +/// called when true is returned. +/// +/// @param[in,out] argp argument string +bool check_nomodeline(char_u **argp) + FUNC_ATTR_NONNULL_ALL FUNC_ATTR_WARN_UNUSED_RESULT { if (STRNCMP(*argp, "<nomodeline>", 12) == 0) { *argp = skipwhite(*argp + 12); - return FALSE; + return false; } - return TRUE; + return true; } /* @@ -6180,76 +6199,78 @@ win_found: static int autocmd_nested = FALSE; -/* - * Execute autocommands for "event" and file name "fname". - * Return TRUE if some commands were executed. - */ -int -apply_autocmds ( - event_T event, - char_u *fname, /* NULL or empty means use actual file name */ - char_u *fname_io, /* fname to use for <afile> on cmdline */ - int force, /* when TRUE, ignore autocmd_busy */ - buf_T *buf /* buffer for <abuf> */ -) +/// Execute autocommands for "event" and file name "fname". +/// +/// @param event event that occured +/// @param fname filename, NULL or empty means use actual file name +/// @param fname_io filename to use for <afile> on cmdline +/// @param force When true, ignore autocmd_busy +/// @param buf Buffer for <abuf> +/// +/// @return true if some commands were executed. +bool apply_autocmds(event_T event, char_u *fname, char_u *fname_io, bool force, + buf_T *buf) { return apply_autocmds_group(event, fname, fname_io, force, AUGROUP_ALL, buf, NULL); } -/* - * Like apply_autocmds(), but with extra "eap" argument. This takes care of - * setting v:filearg. - */ -static int apply_autocmds_exarg(event_T event, char_u *fname, char_u *fname_io, int force, buf_T *buf, exarg_T *eap) +/// Like apply_autocmds(), but with extra "eap" argument. This takes care of +/// setting v:filearg. +/// +/// @param event event that occured +/// @param fname NULL or empty means use actual file name +/// @param fname_io fname to use for <afile> on cmdline +/// @param force When true, ignore autocmd_busy +/// @param buf Buffer for <abuf> +/// @param exarg Ex command arguments +/// +/// @return true if some commands were executed. +static bool apply_autocmds_exarg(event_T event, char_u *fname, char_u *fname_io, + bool force, buf_T *buf, exarg_T *eap) { return apply_autocmds_group(event, fname, fname_io, force, AUGROUP_ALL, buf, eap); } -/* - * Like apply_autocmds(), but handles the caller's retval. If the script - * processing is being aborted or if retval is FAIL when inside a try - * conditional, no autocommands are executed. If otherwise the autocommands - * cause the script to be aborted, retval is set to FAIL. - */ -int -apply_autocmds_retval ( - event_T event, - char_u *fname, /* NULL or empty means use actual file name */ - char_u *fname_io, /* fname to use for <afile> on cmdline */ - int force, /* when TRUE, ignore autocmd_busy */ - buf_T *buf, /* buffer for <abuf> */ - int *retval /* pointer to caller's retval */ -) +/// Like apply_autocmds(), but handles the caller's retval. If the script +/// processing is being aborted or if retval is FAIL when inside a try +/// conditional, no autocommands are executed. If otherwise the autocommands +/// cause the script to be aborted, retval is set to FAIL. +/// +/// @param event event that occured +/// @param fname NULL or empty means use actual file name +/// @param fname_io fname to use for <afile> on cmdline +/// @param force When true, ignore autocmd_busy +/// @param buf Buffer for <abuf> +/// @param[in,out] retval caller's retval +/// +/// @return true if some autocommands were executed +bool apply_autocmds_retval(event_T event, char_u *fname, char_u *fname_io, + bool force, buf_T *buf, int *retval) { - int did_cmd; - - if (should_abort(*retval)) - return FALSE; + if (should_abort(*retval)) { + return false; + } - did_cmd = apply_autocmds_group(event, fname, fname_io, force, - AUGROUP_ALL, buf, NULL); - if (did_cmd - && aborting() - ) + bool did_cmd = apply_autocmds_group(event, fname, fname_io, force, + AUGROUP_ALL, buf, NULL); + if (did_cmd && aborting()) { *retval = FAIL; + } return did_cmd; } -/* - * Return TRUE when there is a CursorHold autocommand defined. - */ -int has_cursorhold(void) +/// Return true when there is a CursorHold/CursorHoldI autocommand defined for +/// the current mode. +bool has_cursorhold(void) FUNC_ATTR_PURE FUNC_ATTR_WARN_UNUSED_RESULT { return first_autopat[(int)(get_real_state() == NORMAL_BUSY ? EVENT_CURSORHOLD : EVENT_CURSORHOLDI)] != NULL; } -/* - * Return TRUE if the CursorHold event can be triggered. - */ -int trigger_cursorhold(void) +/// Return true if the CursorHold/CursorHoldI event can be triggered. +bool trigger_cursorhold(void) FUNC_ATTR_PURE FUNC_ATTR_WARN_UNUSED_RESULT { int state; @@ -6260,10 +6281,11 @@ int trigger_cursorhold(void) && !ins_compl_active() ) { state = get_real_state(); - if (state == NORMAL_BUSY || (state & INSERT) != 0) - return TRUE; + if (state == NORMAL_BUSY || (state & INSERT) != 0) { + return true; + } } - return FALSE; + return false; } /// Return true if "event" autocommand is defined. @@ -6274,23 +6296,27 @@ bool has_event(int event) FUNC_ATTR_PURE FUNC_ATTR_WARN_UNUSED_RESULT return first_autopat[event] != NULL; } -static int -apply_autocmds_group ( - event_T event, - char_u *fname, /* NULL or empty means use actual file name */ - char_u *fname_io, /* fname to use for <afile> on cmdline, NULL means - use fname */ - int force, /* when TRUE, ignore autocmd_busy */ - int group, /* group ID, or AUGROUP_ALL */ - buf_T *buf, /* buffer for <abuf> */ - exarg_T *eap /* command arguments */ -) +/// Execute autocommands for "event" and file name "fname". +/// +/// @param event event that occured +/// @param fname filename, NULL or empty means use actual file name +/// @param fname_io filename to use for <afile> on cmdline, +/// NULL means use `fname`. +/// @param force When true, ignore autocmd_busy +/// @param group autocmd group ID or AUGROUP_ALL +/// @param buf Buffer for <abuf> +/// @param exarg Ex command arguments +/// +/// @return true if some commands were executed. +static bool apply_autocmds_group(event_T event, char_u *fname, char_u *fname_io, + bool force, int group, buf_T *buf, + exarg_T *eap) { char_u *sfname = NULL; /* short file name */ char_u *tail; bool save_changed; buf_T *old_curbuf; - int retval = FALSE; + bool retval = false; char_u *save_sourcing_name; linenr_T save_sourcing_lnum; char_u *save_autocmd_fname; @@ -6444,17 +6470,16 @@ apply_autocmds_group ( } if (fname == NULL) { /* out of memory */ xfree(sfname); - retval = FALSE; + retval = false; goto BYPASS_AU; } #ifdef BACKSLASH_IN_FILENAME - /* - * Replace all backslashes with forward slashes. This makes the - * autocommand patterns portable between Unix and MS-DOS. - */ - if (sfname != NULL) + // Replace all backslashes with forward slashes. This makes the + // autocommand patterns portable between Unix and Windows. + if (sfname != NULL) { forward_slash(sfname); + } forward_slash(fname); #endif @@ -6528,17 +6553,19 @@ apply_autocmds_group ( if (eap != NULL) { save_cmdarg = set_cmdarg(eap, NULL); set_vim_var_nr(VV_CMDBANG, (long)eap->forceit); - } else - save_cmdarg = NULL; /* avoid gcc warning */ - retval = TRUE; - /* mark the last pattern, to avoid an endless loop when more patterns - * are added when executing autocommands */ - for (ap = patcmd.curpat; ap->next != NULL; ap = ap->next) - ap->last = FALSE; - ap->last = TRUE; - check_lnums(TRUE); /* make sure cursor and topline are valid */ + } else { + save_cmdarg = NULL; // avoid gcc warning + } + retval = true; + // mark the last pattern, to avoid an endless loop when more patterns + // are added when executing autocommands + for (ap = patcmd.curpat; ap->next != NULL; ap = ap->next) { + ap->last = false; + } + ap->last = true; + check_lnums(true); // make sure cursor and topline are valid do_cmdline(NULL, getnextac, (void *)&patcmd, - DOCMD_NOWAIT|DOCMD_VERBOSE|DOCMD_REPEAT); + DOCMD_NOWAIT|DOCMD_VERBOSE|DOCMD_REPEAT); if (eap != NULL) { (void)set_cmdarg(NULL, save_cmdarg); set_vim_var_nr(VV_CMDBANG, save_cmdbang); @@ -6754,42 +6781,44 @@ char_u *getnextac(int c, void *cookie, int indent) return retval; } -/* - * Return TRUE if there is a matching autocommand for "fname". - * To account for buffer-local autocommands, function needs to know - * in which buffer the file will be opened. - */ -int has_autocmd(event_T event, char_u *sfname, buf_T *buf) +/// Return true if there is a matching autocommand for "fname". +/// To account for buffer-local autocommands, function needs to know +/// in which buffer the file will be opened. +/// +/// @param event event that occured. +/// @param sfname filename the event occured in. +/// @param buf buffer the file is open in +bool has_autocmd(event_T event, char_u *sfname, buf_T *buf) + FUNC_ATTR_WARN_UNUSED_RESULT { AutoPat *ap; char_u *fname; char_u *tail = path_tail(sfname); - int retval = FALSE; + bool retval = false; - fname = (char_u *)FullName_save((char *)sfname, FALSE); - if (fname == NULL) - return FALSE; + fname = (char_u *)FullName_save((char *)sfname, false); + if (fname == NULL) { + return false; + } #ifdef BACKSLASH_IN_FILENAME - /* - * Replace all backslashes with forward slashes. This makes the - * autocommand patterns portable between Unix and MS-DOS. - */ + // Replace all backslashes with forward slashes. This makes the + // autocommand patterns portable between Unix and Windows. sfname = vim_strsave(sfname); forward_slash(sfname); forward_slash(fname); #endif - for (ap = first_autopat[(int)event]; ap != NULL; ap = ap->next) + for (ap = first_autopat[(int)event]; ap != NULL; ap = ap->next) { if (ap->pat != NULL && ap->cmds != NULL && (ap->buflocal_nr == 0 ? match_file_pat(NULL, &ap->reg_prog, fname, sfname, tail, ap->allow_dirs) - : buf != NULL && ap->buflocal_nr == buf->b_fnum - )) { - retval = TRUE; + : buf != NULL && ap->buflocal_nr == buf->b_fnum)) { + retval = true; break; } + } xfree(fname); #ifdef BACKSLASH_IN_FILENAME @@ -6877,29 +6906,27 @@ char_u *get_event_name(expand_T *xp, int idx) } -/* - * Return TRUE if autocmd is supported. - */ -int autocmd_supported(char_u *name) +/// Return true if autocmd "event" is supported. +bool autocmd_supported(char_u *event) { char_u *p; - return event_name2nr(name, &p) != NUM_EVENTS; + return event_name2nr(event, &p) != NUM_EVENTS; } -/* - * Return TRUE if an autocommand is defined for a group, event and - * pattern: The group can be omitted to accept any group. "event" and "pattern" - * can be NULL to accept any event and pattern. "pattern" can be NULL to accept - * any pattern. Buffer-local patterns <buffer> or <buffer=N> are accepted. - * Used for: - * exists("#Group") or - * exists("#Group#Event") or - * exists("#Group#Event#pat") or - * exists("#Event") or - * exists("#Event#pat") - */ -int au_exists(char_u *arg) +/// Return true if an autocommand is defined for a group, event and +/// pattern: The group can be omitted to accept any group. +/// `event` and `pattern` can be omitted to accept any event and pattern. +/// Buffer-local patterns <buffer> or <buffer=N> are accepted. +/// Used for: +/// exists("#Group") or +/// exists("#Group#Event") or +/// exists("#Group#Event#pat") or +/// exists("#Event") or +/// exists("#Event#pat") +/// +/// @param arg autocommand string +bool au_exists(const char_u *arg) FUNC_ATTR_WARN_UNUSED_RESULT { char_u *arg_save; char_u *pattern = NULL; @@ -6909,7 +6936,7 @@ int au_exists(char_u *arg) AutoPat *ap; buf_T *buflocal_buf = NULL; int group; - int retval = FALSE; + bool retval = false; /* Make a copy so that we can change the '#' chars to a NUL. */ arg_save = vim_strsave(arg); @@ -6925,8 +6952,8 @@ int au_exists(char_u *arg) event_name = arg_save; } else { if (p == NULL) { - /* "Group": group name is present and it's recognized */ - retval = TRUE; + // "Group": group name is present and it's recognized + retval = true; goto theend; } @@ -6968,7 +6995,7 @@ int au_exists(char_u *arg) || (buflocal_buf == NULL ? fnamecmp(ap->pat, pattern) == 0 : ap->buflocal_nr == buflocal_buf->b_fnum))) { - retval = TRUE; + retval = true; break; } @@ -6983,12 +7010,13 @@ theend: /// /// Used for autocommands and 'wildignore'. /// -/// @param pattern the pattern to match with -/// @param prog the pre-compiled regprog or NULL -/// @param fname the full path of the file name -/// @param sfname the short file name or NULL -/// @param tail the tail of the path -/// @param allow_dirs allow matching with dir +/// @param pattern pattern to match with +/// @param prog pre-compiled regprog or NULL +/// @param fname full path of the file name +/// @param sfname short file name or NULL +/// @param tail tail of the path +/// @param allow_dirs Allow matching with dir +/// /// @return true if there is a match, false otherwise static bool match_file_pat(char_u *pattern, regprog_T **prog, char_u *fname, char_u *sfname, char_u *tail, int allow_dirs) @@ -7027,12 +7055,17 @@ static bool match_file_pat(char_u *pattern, regprog_T **prog, char_u *fname, return result; } -/* - * Return TRUE if a file matches with a pattern in "list". - * "list" is a comma-separated list of patterns, like 'wildignore'. - * "sfname" is the short file name or NULL, "ffname" the long file name. - */ -int match_file_list(char_u *list, char_u *sfname, char_u *ffname) +/// Check if a file matches with a pattern in "list". +/// "list" is a comma-separated list of patterns, like 'wildignore'. +/// "sfname" is the short file name or NULL, "ffname" the long file name. +/// +/// @param list list of patterns to match +/// @param sfname short file name +/// @param ffname full file name +/// +/// @return true if there was a match +bool match_file_list(char_u *list, char_u *sfname, char_u *ffname) + FUNC_ATTR_WARN_UNUSED_RESULT FUNC_ATTR_NONNULL_ARG(1, 3) { char_u buf[100]; char_u *tail; @@ -7043,20 +7076,21 @@ int match_file_list(char_u *list, char_u *sfname, char_u *ffname) tail = path_tail(sfname); - /* try all patterns in 'wildignore' */ + // try all patterns in 'wildignore' p = list; while (*p) { - copy_option_part(&p, buf, 100, ","); - regpat = file_pat_to_reg_pat(buf, NULL, &allow_dirs, FALSE); - if (regpat == NULL) + copy_option_part(&p, buf, ARRAY_SIZE(buf), ","); + regpat = file_pat_to_reg_pat(buf, NULL, &allow_dirs, false); + if (regpat == NULL) { break; - match = match_file_pat(regpat, NULL, ffname, sfname, - tail, (int)allow_dirs); + } + match = match_file_pat(regpat, NULL, ffname, sfname, tail, (int)allow_dirs); xfree(regpat); - if (match) - return TRUE; + if (match) { + return true; + } } - return FALSE; + return false; } /// Convert the given pattern "pat" which has shell style wildcards in it, into diff --git a/src/nvim/globals.h b/src/nvim/globals.h index 50eda6cb17..b45f13de4c 100644 --- a/src/nvim/globals.h +++ b/src/nvim/globals.h @@ -8,11 +8,10 @@ // actually defined and initialized. #ifndef EXTERN # define EXTERN extern -# define INIT(x) +# define INIT(...) #else # ifndef INIT -# define INIT(x) x -# define DO_INIT +# define INIT(...) __VA_ARGS__ # endif #endif @@ -117,12 +116,9 @@ #define DFLT_COLS 80 /* default value for 'columns' */ #define DFLT_ROWS 24 /* default value for 'lines' */ -EXTERN long Rows /* nr of rows in the screen */ -#ifdef DO_INIT - = DFLT_ROWS -#endif -; -EXTERN long Columns INIT(= DFLT_COLS); /* nr of columns in the screen */ +EXTERN long Rows INIT(= DFLT_ROWS); // nr of rows in the screen + +EXTERN long Columns INIT(= DFLT_COLS); // nr of columns in the screen /* * The characters and attributes cached for the screen. @@ -751,11 +747,8 @@ EXTERN int can_si INIT(= FALSE); */ EXTERN int can_si_back INIT(= FALSE); -EXTERN pos_T saved_cursor /* w_cursor before formatting text. */ -#ifdef DO_INIT - = INIT_POS_T(0, 0, 0) -#endif -; +// w_cursor before formatting text. +EXTERN pos_T saved_cursor INIT(= INIT_POS_T(0, 0, 0)); /* * Stuff for insert mode. @@ -917,19 +910,16 @@ EXTERN int RedrawingDisabled INIT(= 0); EXTERN int readonlymode INIT(= FALSE); /* Set to TRUE for "view" */ EXTERN int recoverymode INIT(= FALSE); /* Set to TRUE for "-r" option */ -EXTERN typebuf_T typebuf /* typeahead buffer */ -#ifdef DO_INIT - = {NULL, NULL, 0, 0, 0, 0, 0, 0, 0} -#endif -; -EXTERN int ex_normal_busy INIT(= 0); /* recursiveness of ex_normal() */ -EXTERN int ex_normal_lock INIT(= 0); /* forbid use of ex_normal() */ -EXTERN int ignore_script INIT(= FALSE); /* ignore script input */ -EXTERN int stop_insert_mode; /* for ":stopinsert" and 'insertmode' */ +// typeahead buffer +EXTERN typebuf_T typebuf INIT(= { NULL, NULL, 0, 0, 0, 0, 0, 0, 0 }); -EXTERN int KeyTyped; /* TRUE if user typed current char */ -EXTERN int KeyStuffed; /* TRUE if current char from stuffbuf */ -EXTERN int maptick INIT(= 0); /* tick for each non-mapped char */ +EXTERN int ex_normal_busy INIT(= 0); // recursiveness of ex_normal() +EXTERN int ex_normal_lock INIT(= 0); // forbid use of ex_normal() +EXTERN int ignore_script INIT(= false); // ignore script input +EXTERN int stop_insert_mode; // for ":stopinsert" and 'insertmode' +EXTERN int KeyTyped; // TRUE if user typed current char +EXTERN int KeyStuffed; // TRUE if current char from stuffbuf +EXTERN int maptick INIT(= 0); // tick for each non-mapped char EXTERN char_u chartab[256]; /* table used in charset.c; See init_chartab() for explanation */ @@ -959,30 +949,28 @@ EXTERN reg_extmatch_T *re_extmatch_in INIT(= NULL); /* Used by vim_regexec(): EXTERN reg_extmatch_T *re_extmatch_out INIT(= NULL); /* Set by vim_regexec() * to store \z\(...\) matches */ -EXTERN int did_outofmem_msg INIT(= FALSE); -/* set after out of memory msg */ -EXTERN int did_swapwrite_msg INIT(= FALSE); -/* set after swap write error msg */ -EXTERN int undo_off INIT(= FALSE); /* undo switched off for now */ -EXTERN int global_busy INIT(= 0); /* set when :global is executing */ -EXTERN int listcmd_busy INIT(= FALSE); /* set when :argdo, :windo or - :bufdo is executing */ -EXTERN int need_start_insertmode INIT(= FALSE); -/* start insert mode soon */ -EXTERN char_u *last_cmdline INIT(= NULL); /* last command line (for ":) */ -EXTERN char_u *repeat_cmdline INIT(= NULL); /* command line for "." */ -EXTERN char_u *new_last_cmdline INIT(= NULL); /* new value for last_cmdline */ -EXTERN char_u *autocmd_fname INIT(= NULL); /* fname for <afile> on cmdline */ -EXTERN int autocmd_fname_full; /* autocmd_fname is full path */ -EXTERN int autocmd_bufnr INIT(= 0); /* fnum for <abuf> on cmdline */ -EXTERN char_u *autocmd_match INIT(= NULL); /* name for <amatch> on cmdline */ -EXTERN int did_cursorhold INIT(= FALSE); /* set when CursorHold t'gerd */ -EXTERN pos_T last_cursormoved /* for CursorMoved event */ -# ifdef DO_INIT - = INIT_POS_T(0, 0, 0) -# endif -; -EXTERN int last_changedtick INIT(= 0); /* for TextChanged event */ +EXTERN int did_outofmem_msg INIT(= false); +// set after out of memory msg +EXTERN int did_swapwrite_msg INIT(= false); +// set after swap write error msg +EXTERN int undo_off INIT(= false); // undo switched off for now +EXTERN int global_busy INIT(= 0); // set when :global is executing +EXTERN int listcmd_busy INIT(= false); // set when :argdo, :windo or + // :bufdo is executing +EXTERN int need_start_insertmode INIT(= false); +// start insert mode soon +EXTERN char_u *last_cmdline INIT(= NULL); // last command line (for ":) +EXTERN char_u *repeat_cmdline INIT(= NULL); // command line for "." +EXTERN char_u *new_last_cmdline INIT(= NULL); // new value for last_cmdline +EXTERN char_u *autocmd_fname INIT(= NULL); // fname for <afile> on cmdline +EXTERN int autocmd_fname_full; // autocmd_fname is full path +EXTERN int autocmd_bufnr INIT(= 0); // fnum for <abuf> on cmdline +EXTERN char_u *autocmd_match INIT(= NULL); // name for <amatch> on cmdline +EXTERN int did_cursorhold INIT(= false); // set when CursorHold t'gerd +// for CursorMoved event +EXTERN pos_T last_cursormoved INIT(= INIT_POS_T(0, 0, 0)); + +EXTERN int last_changedtick INIT(= 0); // for TextChanged event EXTERN buf_T *last_changedtick_buf INIT(= NULL); EXTERN int postponed_split INIT(= 0); /* for CTRL-W CTRL-] command */ @@ -1092,13 +1080,9 @@ EXTERN int typebuf_was_filled INIT(= FALSE); /* received text from client #ifdef BACKSLASH_IN_FILENAME -EXTERN char psepc INIT(= '\\'); /* normal path separator character */ -EXTERN char psepcN INIT(= '/'); /* abnormal path separator character */ -EXTERN char pseps[2] /* normal path separator string */ -# ifdef DO_INIT - = {'\\', 0} -# endif -; +EXTERN char psepc INIT(= '\\'); // normal path separator character +EXTERN char psepcN INIT(= '/'); // abnormal path separator character +EXTERN char pseps[2] INIT(= { '\\', 0 }); // normal path separator string #endif /* Set to TRUE when an operator is being executed with virtual editing, MAYBE @@ -1117,12 +1101,8 @@ EXTERN int need_cursor_line_redraw INIT(= FALSE); #ifdef USE_MCH_ERRMSG -/* Grow array to collect error messages in until they can be displayed. */ -EXTERN garray_T error_ga -# ifdef DO_INIT - = GA_EMPTY_INIT_VALUE -# endif -; +// Grow array to collect error messages in until they can be displayed. +EXTERN garray_T error_ga INIT(= GA_EMPTY_INIT_VALUE); #endif diff --git a/src/nvim/if_cscope.c b/src/nvim/if_cscope.c index cd206e2e0d..d236501b3f 100644 --- a/src/nvim/if_cscope.c +++ b/src/nvim/if_cscope.c @@ -11,6 +11,7 @@ #include <assert.h> #include <errno.h> #include <inttypes.h> +#include <fcntl.h> #include "nvim/vim.h" #include "nvim/ascii.h" @@ -1841,9 +1842,7 @@ static void sig_handler(int s) { */ static void cs_release_csp(size_t i, int freefnpp) { - /* - * Trying to exit normally (not sure whether it is fit to UNIX cscope - */ + // Trying to exit normally (not sure whether it is fit to Unix cscope) if (csinfo[i].to_fp != NULL) { (void)fputs("q\n", csinfo[i].to_fp); (void)fflush(csinfo[i].to_fp); diff --git a/src/nvim/memfile.c b/src/nvim/memfile.c index 137c7c49d3..8cf5642a80 100644 --- a/src/nvim/memfile.c +++ b/src/nvim/memfile.c @@ -40,6 +40,7 @@ #include <limits.h> #include <string.h> #include <stdbool.h> +#include <fcntl.h> #include "nvim/vim.h" #include "nvim/ascii.h" diff --git a/src/nvim/memline.c b/src/nvim/memline.c index c91a25df6e..f58b2ac38f 100644 --- a/src/nvim/memline.c +++ b/src/nvim/memline.c @@ -38,6 +38,7 @@ #include <inttypes.h> #include <string.h> #include <stdbool.h> +#include <fcntl.h> #include "nvim/ascii.h" #include "nvim/vim.h" diff --git a/src/nvim/os/dl.c b/src/nvim/os/dl.c index b4a35e203e..fef02cc784 100644 --- a/src/nvim/os/dl.c +++ b/src/nvim/os/dl.c @@ -63,7 +63,7 @@ bool os_libcall(const char *libname, // call the library and save the result // TODO(aktau): catch signals and use jmp (if available) to handle - // exceptions. jmp's on UNIX seem to interact trickily with signals as + // exceptions. jmp's on Unix seem to interact trickily with signals as // well. So for now we only support those libraries that are well-behaved. if (str_out) { str_str_fn sfn = (str_str_fn) fn; diff --git a/src/nvim/os/env.c b/src/nvim/os/env.c index a791dca39c..c1804067e9 100644 --- a/src/nvim/os/env.c +++ b/src/nvim/os/env.c @@ -142,7 +142,7 @@ void os_get_hostname(char *hostname, size_t len) /// - go to that directory /// - do os_dirname() to get the real name of that directory. /// This also works with mounts and links. -/// Don't do this for MS-DOS, it will change the "current dir" for a drive. +/// Don't do this for Windows, it will change the "current dir" for a drive. static char_u *homedir = NULL; void init_homedir(void) @@ -290,7 +290,7 @@ void expand_env_esc(char_u *srcp, char_u *dst, int dstlen, bool esc, bool one, } #if defined(UNIX) - // Verify that we have found the end of a UNIX ${VAR} style variable + // Verify that we have found the end of a Unix ${VAR} style variable if (src[1] == '{' && *tail != '}') { var = NULL; } else { diff --git a/src/nvim/os/time.c b/src/nvim/os/time.c index ba1dcf631a..188f0802c9 100644 --- a/src/nvim/os/time.c +++ b/src/nvim/os/time.c @@ -93,7 +93,7 @@ struct tm *os_localtime_r(const time_t *restrict clock, #endif } -/// Obtains the current UNIX timestamp and adjusts it to local time +/// Obtains the current Unix timestamp and adjusts it to local time. /// /// @param result Pointer to a 'struct tm' where the result should be placed /// @return A pointer to a 'struct tm' in the current time zone (the 'result' @@ -104,7 +104,7 @@ struct tm *os_get_localtime(struct tm *result) FUNC_ATTR_NONNULL_ALL return os_localtime_r(&rawtime, result); } -/// Obtains the current UNIX timestamp +/// Obtains the current Unix timestamp. /// /// @return Seconds since epoch. Timestamp os_time(void) diff --git a/src/nvim/os/win_defs.h b/src/nvim/os/win_defs.h index 2ce74c9818..ba96347a12 100644 --- a/src/nvim/os/win_defs.h +++ b/src/nvim/os/win_defs.h @@ -5,6 +5,10 @@ #include <sys/stat.h> #include <stdio.h> +// Windows does not have S_IFLNK but libuv defines it +// and sets the flag for us when calling uv_fs_stat. +#include <uv.h> + #define NAME_MAX _MAX_PATH #define TEMP_DIR_NAMES {"$TMP", "$TEMP", "$USERPROFILE", ""} @@ -50,6 +54,10 @@ typedef SSIZE_T ssize_t; # endif #endif +#ifndef O_NOFOLLOW +# define O_NOFOLLOW 0 +#endif + #if !defined(S_ISDIR) && defined(S_IFDIR) # define S_ISDIR(m) (((m) & S_IFMT) == S_IFDIR) #endif diff --git a/src/nvim/path.c b/src/nvim/path.c index 23b22b67f1..5ac3d07f67 100644 --- a/src/nvim/path.c +++ b/src/nvim/path.c @@ -196,7 +196,7 @@ char_u *get_past_head(char_u *path) int vim_ispathsep(int c) { #ifdef UNIX - return c == '/'; /* UNIX has ':' inside file names */ + return c == '/'; // Unix has ':' inside file names #else # ifdef BACKSLASH_IN_FILENAME return c == ':' || c == '/' || c == '\\'; diff --git a/src/nvim/shada.c b/src/nvim/shada.c index 59ef2a0d28..dcdf2195f8 100644 --- a/src/nvim/shada.c +++ b/src/nvim/shada.c @@ -5,6 +5,7 @@ #include <stdint.h> #include <inttypes.h> #include <errno.h> +#include <fcntl.h> #ifdef HAVE_UNISTD_H # include <unistd.h> #endif diff --git a/src/nvim/undo.c b/src/nvim/undo.c index 69ac18ad54..6b60f95f22 100644 --- a/src/nvim/undo.c +++ b/src/nvim/undo.c @@ -77,6 +77,7 @@ #include <limits.h> #include <stdbool.h> #include <string.h> +#include <fcntl.h> #include "nvim/vim.h" #include "nvim/ascii.h" diff --git a/test/unit/os/env_spec.lua b/test/unit/os/env_spec.lua index e0e12a24f2..9e00a3e8f8 100644 --- a/test/unit/os/env_spec.lua +++ b/test/unit/os/env_spec.lua @@ -148,8 +148,8 @@ describe('env function', function() local name = 'NEOVIM_UNIT_TEST_EXPAND_ENV_ESCN' local value = 'NEOVIM_UNIT_TEST_EXPAND_ENV_ESCV' os_setenv(name, value, 1) - -- TODO(bobtwinkles) This only tests UNIX expansions. There should be a - -- test for windows as well + -- TODO(bobtwinkles) This only tests Unix expansions. There should be a + -- test for Windows as well local input1 = to_cstr('$NEOVIM_UNIT_TEST_EXPAND_ENV_ESCN/test') local input2 = to_cstr('${NEOVIM_UNIT_TEST_EXPAND_ENV_ESCN}/test') local output_buff1 = cstr(255, '') diff --git a/third-party/CMakeLists.txt b/third-party/CMakeLists.txt index de421365c4..d7bb620236 100644 --- a/third-party/CMakeLists.txt +++ b/third-party/CMakeLists.txt @@ -55,7 +55,7 @@ endif() # Cross compiling: use these for dependencies built for the # HOST system, when not crosscompiling these should be the -# same as DEPS_*. Except when targeting UNIX in which case +# same as DEPS_*. Except when targeting Unix in which case # want all the dependencies to use the same compiler. if(CMAKE_CROSSCOMPILING AND NOT UNIX) set(HOSTDEPS_INSTALL_DIR "${CMAKE_BINARY_DIR}/host") diff --git a/third-party/cmake/BuildMsgpack.cmake b/third-party/cmake/BuildMsgpack.cmake index f0d5fab676..4b6b361e85 100644 --- a/third-party/cmake/BuildMsgpack.cmake +++ b/third-party/cmake/BuildMsgpack.cmake @@ -53,7 +53,7 @@ if(MINGW AND CMAKE_CROSSCOMPILING) # Hack to avoid -rdynamic in Mingw -DCMAKE_SHARED_LIBRARY_LINK_C_FLAGS="") elseif(MSVC) - # Same as UNIX without fPIC + # Same as Unix without fPIC set(MSGPACK_CONFIGURE_COMMAND ${CMAKE_COMMAND} ${DEPS_BUILD_DIR}/src/msgpack -DMSGPACK_ENABLE_CXX=OFF -DMSGPACK_BUILD_TESTS=OFF |