aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CMakeLists.txt5
-rw-r--r--cmake/Deps.cmake9
-rw-r--r--runtime/autoload/netrw.vim133
-rw-r--r--runtime/autoload/netrwSettings.vim3
-rw-r--r--runtime/doc/news.txt6
-rw-r--r--runtime/doc/pi_netrw.txt114
-rw-r--r--runtime/ftplugin/jj.vim19
-rw-r--r--runtime/lua/vim/filetype.lua1
-rw-r--r--runtime/lua/vim/lsp/protocol.lua7
-rw-r--r--runtime/plugin/netrwPlugin.vim4
-rw-r--r--runtime/syntax/java.vim39
-rw-r--r--runtime/syntax/jj.vim20
-rw-r--r--runtime/syntax/spec.vim2
-rw-r--r--src/nvim/move.c1
-rw-r--r--src/nvim/quickfix.c6
-rw-r--r--test/functional/legacy/scroll_opt_spec.lua129
-rw-r--r--test/functional/plugin/lsp_spec.lua2
-rw-r--r--test/old/testdir/test_filetype.vim1
-rw-r--r--test/old/testdir/test_scroll_opt.vim45
19 files changed, 324 insertions, 222 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index cdc834d0fc..933bc16aa8 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -50,11 +50,6 @@ file(GLOB DOCFILES CONFIGURE_DEPENDS ${PROJECT_SOURCE_DIR}/runtime/doc/*.txt)
set_directory_properties(PROPERTIES
EP_PREFIX "${DEPS_BUILD_DIR}")
-find_program(CCACHE_PRG ccache)
-if(CCACHE_PRG)
- set(CMAKE_C_COMPILER_LAUNCHER ${CMAKE_COMMAND} -E env CCACHE_SLOPPINESS=pch_defines,time_macros ${CCACHE_PRG})
-endif()
-
if(NOT CI_BUILD)
set(CMAKE_INSTALL_MESSAGE NEVER)
endif()
diff --git a/cmake/Deps.cmake b/cmake/Deps.cmake
index 0d4cb7d469..413e3a08a9 100644
--- a/cmake/Deps.cmake
+++ b/cmake/Deps.cmake
@@ -23,6 +23,12 @@ if(POLICY CMP0092)
list(APPEND DEPS_CMAKE_ARGS -D CMAKE_POLICY_DEFAULT_CMP0092=NEW)
endif()
+find_program(CACHE_PRG NAMES ccache sccache)
+if(CACHE_PRG)
+ set(CMAKE_C_COMPILER_LAUNCHER ${CMAKE_COMMAND} -E env CCACHE_SLOPPINESS=pch_defines,time_macros ${CACHE_PRG})
+ list(APPEND DEPS_CMAKE_CACHE_ARGS -DCMAKE_C_COMPILER_LAUNCHER:STRING=${CMAKE_C_COMPILER_LAUNCHER})
+endif()
+
# MAKE_PRG
if(UNIX)
find_program(MAKE_PRG NAMES gmake make)
@@ -58,7 +64,8 @@ function(get_externalproject_options name DEPS_IGNORE_SHA)
set(EXTERNALPROJECT_OPTIONS
DOWNLOAD_NO_PROGRESS TRUE
- EXTERNALPROJECT_OPTIONS URL ${${name_allcaps}_URL})
+ EXTERNALPROJECT_OPTIONS URL ${${name_allcaps}_URL}
+ CMAKE_CACHE_ARGS ${DEPS_CMAKE_CACHE_ARGS})
if(NOT ${DEPS_IGNORE_SHA})
list(APPEND EXTERNALPROJECT_OPTIONS URL_HASH SHA256=${${name_allcaps}_SHA256})
diff --git a/runtime/autoload/netrw.vim b/runtime/autoload/netrw.vim
index f4e46c1a99..ac74d047ac 100644
--- a/runtime/autoload/netrw.vim
+++ b/runtime/autoload/netrw.vim
@@ -9,6 +9,8 @@
" 2024 Feb 19 by Vim Project: (announce adoption)
" 2024 Feb 29 by Vim Project: handle symlinks in tree mode correctly
" 2024 Apr 03 by Vim Project: detect filetypes for remote edited files
+" 2024 May 08 by Vim Project: cleanup legacy Win9X checks
+" 2024 May 09 by Vim Project: remove hard-coded private.ppk
" Former Maintainer: Charles E Campbell
" GetLatestVimScripts: 1075 1 :AutoInstall: netrw.vim
" Copyright: Copyright (C) 2016 Charles E. Campbell {{{1
@@ -278,14 +280,8 @@ call s:NetrwInit("g:netrw_rcp_cmd" , "rcp")
call s:NetrwInit("g:netrw_rsync_cmd", "rsync")
call s:NetrwInit("g:netrw_rsync_sep", "/")
if !exists("g:netrw_scp_cmd")
- if executable("scp")
- call s:NetrwInit("g:netrw_scp_cmd" , "scp -q")
- elseif executable("pscp")
- if (has("win32") || has("win95") || has("win64") || has("win16")) && filereadable('c:\private.ppk')
- call s:NetrwInit("g:netrw_scp_cmd", 'pscp -i c:\private.ppk')
- else
- call s:NetrwInit("g:netrw_scp_cmd", 'pscp -q')
- endif
+ if executable("pscp")
+ call s:NetrwInit("g:netrw_scp_cmd", 'pscp -q')
else
call s:NetrwInit("g:netrw_scp_cmd" , "scp -q")
endif
@@ -294,7 +290,7 @@ endif
call s:NetrwInit("g:netrw_sftp_cmd" , "sftp")
call s:NetrwInit("g:netrw_ssh_cmd" , "ssh")
-if (has("win32") || has("win95") || has("win64") || has("win16"))
+if has("win32")
\ && exists("g:netrw_use_nt_rcp")
\ && g:netrw_use_nt_rcp
\ && executable( $SystemRoot .'/system32/rcp.exe')
@@ -309,12 +305,8 @@ endif
" Default values for netrw's global variables {{{2
" Cygwin Detection ------- {{{3
if !exists("g:netrw_cygwin")
- if has("win32") || has("win95") || has("win64") || has("win16")
- if has("win32unix") && &shell =~ '\%(\<bash\>\|\<zsh\>\)\%(\.exe\)\=$'
- let g:netrw_cygwin= 1
- else
- let g:netrw_cygwin= 0
- endif
+ if has("win32unix") && &shell =~ '\%(\<bash\>\|\<zsh\>\)\%(\.exe\)\=$'
+ let g:netrw_cygwin= 1
else
let g:netrw_cygwin= 0
endif
@@ -370,10 +362,6 @@ endif
call s:NetrwInit("g:netrw_keepdir",1)
if !exists("g:netrw_list_cmd")
if g:netrw_scp_cmd =~ '^pscp' && executable("pscp")
- if (has("win32") || has("win95") || has("win64") || has("win16")) && filereadable("c:\\private.ppk")
- " provide a pscp-based listing command
- let g:netrw_scp_cmd ="pscp -i C:\\private.ppk"
- endif
if exists("g:netrw_list_cmd_options")
let g:netrw_list_cmd= g:netrw_scp_cmd." -ls USEPORT HOSTNAME: ".g:netrw_list_cmd_options
else
@@ -401,7 +389,7 @@ if !exists("g:netrw_localcmdshell")
let g:netrw_localcmdshell= ""
endif
if !exists("g:netrw_localcopycmd")
- if has("win32") || has("win95") || has("win64") || has("win16")
+ if has("win32")
if g:netrw_cygwin
let g:netrw_localcopycmd= "cp"
else
@@ -415,7 +403,7 @@ if !exists("g:netrw_localcopycmd")
endif
endif
if !exists("g:netrw_localcopydircmd")
- if has("win32") || has("win95") || has("win64") || has("win16")
+ if has("win32")
if g:netrw_cygwin
let g:netrw_localcopydircmd = "cp"
let g:netrw_localcopydircmdopt= " -R"
@@ -437,7 +425,7 @@ if exists("g:netrw_local_mkdir")
let g:netrw_localmkdir= g:netrw_local_mkdir
call netrw#ErrorMsg(s:NOTE,"g:netrw_local_mkdir is deprecated in favor of g:netrw_localmkdir",87)
endif
-if has("win32") || has("win95") || has("win64") || has("win16")
+if has("win32")
if g:netrw_cygwin
call s:NetrwInit("g:netrw_localmkdir","mkdir")
else
@@ -453,7 +441,7 @@ if exists("g:netrw_local_movecmd")
call netrw#ErrorMsg(s:NOTE,"g:netrw_local_movecmd is deprecated in favor of g:netrw_localmovecmd",88)
endif
if !exists("g:netrw_localmovecmd")
- if has("win32") || has("win95") || has("win64") || has("win16")
+ if has("win32")
if g:netrw_cygwin
let g:netrw_localmovecmd= "mv"
else
@@ -486,7 +474,7 @@ call s:NetrwInit("g:netrw_mousemaps" , (exists("+mouse") && &mouse =~# '[anh
call s:NetrwInit("g:netrw_retmap" , 0)
if has("unix") || (exists("g:netrw_cygwin") && g:netrw_cygwin)
call s:NetrwInit("g:netrw_chgperm" , "chmod PERM FILENAME")
-elseif has("win32") || has("win95") || has("win64") || has("win16")
+elseif has("win32")
call s:NetrwInit("g:netrw_chgperm" , "cacls FILENAME /e /p PERM")
else
call s:NetrwInit("g:netrw_chgperm" , "chmod PERM FILENAME")
@@ -545,14 +533,13 @@ if !exists("g:netrw_xstrlen")
endif
endif
call s:NetrwInit("g:NetrwTopLvlMenu","Netrw.")
-call s:NetrwInit("g:netrw_win95ftp",1)
call s:NetrwInit("g:netrw_winsize",50)
call s:NetrwInit("g:netrw_wiw",1)
if g:netrw_winsize > 100|let g:netrw_winsize= 100|endif
" ---------------------------------------------------------------------
" Default values for netrw's script variables: {{{2
call s:NetrwInit("g:netrw_fname_escape",' ?&;%')
-if has("win32") || has("win95") || has("win64") || has("win16")
+if has("win32")
call s:NetrwInit("g:netrw_glob_escape",'*?`{[]$')
else
call s:NetrwInit("g:netrw_glob_escape",'*[]?`{~$\')
@@ -684,7 +671,7 @@ fun! netrw#Explore(indx,dosplit,style,...)
" record current directory
let curdir = simplify(b:netrw_curdir)
let curfiledir = substitute(expand("%:p"),'^\(.*[/\\]\)[^/\\]*$','\1','e')
- if !exists("g:netrw_cygwin") && (has("win32") || has("win95") || has("win64") || has("win16"))
+ if !exists("g:netrw_cygwin") && has("win32")
let curdir= substitute(curdir,'\','/','g')
endif
" call Decho("curdir<".curdir."> curfiledir<".curfiledir.">",'~'.expand("<slnum>"))
@@ -837,7 +824,7 @@ fun! netrw#Explore(indx,dosplit,style,...)
" handle .../**/.../filepat
" call Decho("case starpat=4: Explore .../**/.../filepat",'~'.expand("<slnum>"))
let prefixdir= substitute(dirname,'^\(.\{-}\)\*\*.*$','\1','')
- if prefixdir =~ '^/' || (prefixdir =~ '^\a:/' && (has("win32") || has("win95") || has("win64") || has("win16")))
+ if prefixdir =~ '^/' || (prefixdir =~ '^\a:/' && has("win32"))
let b:netrw_curdir = prefixdir
else
let b:netrw_curdir= getcwd().'/'.prefixdir
@@ -874,7 +861,7 @@ fun! netrw#Explore(indx,dosplit,style,...)
else
if dirname == ""
let dirname= getcwd()
- elseif (has("win32") || has("win95") || has("win64") || has("win16")) && !g:netrw_cygwin
+ elseif has("win32") && !g:netrw_cygwin
" Windows : check for a drive specifier, or else for a remote share name ('\\Foo' or '//Foo',
" depending on whether backslashes have been converted to forward slashes by earlier code).
if dirname !~ '^[a-zA-Z]:' && dirname !~ '^\\\\\w\+' && dirname !~ '^//\w\+'
@@ -1383,7 +1370,7 @@ fun! netrw#Obtain(islocal,fname,...)
" call Decho("obtain a file from local ".b:netrw_curdir." to ".tgtdir,'~'.expand("<slnum>"))
if exists("b:netrw_curdir") && getcwd() != b:netrw_curdir
let topath= s:ComposePath(tgtdir,"")
- if (has("win32") || has("win95") || has("win64") || has("win16"))
+ if has("win32")
" transfer files one at time
" call Decho("transfer files one at a time",'~'.expand("<slnum>"))
for fname in fnamelist
@@ -2254,7 +2241,7 @@ fun! netrw#NetRead(mode,...)
endif
" 'C' in 'C:\path\to\file' is handled as hostname on windows.
" This is workaround to avoid mis-handle windows local-path:
- if g:netrw_scp_cmd =~ '^scp' && (has("win32") || has("win95") || has("win64") || has("win16"))
+ if g:netrw_scp_cmd =~ '^scp' && has("win32")
let tmpfile_get = substitute(tr(tmpfile, '\', '/'), '^\(\a\):[/\\]\(.*\)$', '/\1/\2', '')
else
let tmpfile_get = tmpfile
@@ -3174,7 +3161,7 @@ fun! s:NetrwMethod(choice)
if exists("s:netrw_hup[host]")
call NetUserPass("ftp:".host)
- elseif (has("win32") || has("win95") || has("win64") || has("win16")) && s:netrw_ftp_cmd =~# '-[sS]:'
+ elseif has("win32") && s:netrw_ftp_cmd =~# '-[sS]:'
" call Decho("has -s: : s:netrw_ftp_cmd<".s:netrw_ftp_cmd.">",'~'.expand("<slnum>"))
" call Decho(" g:netrw_ftp_cmd<".g:netrw_ftp_cmd.">",'~'.expand("<slnum>"))
if g:netrw_ftp_cmd =~# '-[sS]:\S*MACHINE\>'
@@ -3289,38 +3276,6 @@ fun! s:NetrwMethod(choice)
" call Dret("s:NetrwMethod : b:netrw_method=".b:netrw_method." g:netrw_port=".g:netrw_port)
endfun
-" ------------------------------------------------------------------------
-" NetReadFixup: this sort of function is typically written by the user {{{2
-" to handle extra junk that their system's ftp dumps
-" into the transfer. This function is provided as an
-" example and as a fix for a Windows 95 problem: in my
-" experience, win95's ftp always dumped four blank lines
-" at the end of the transfer.
-if has("win95") && exists("g:netrw_win95ftp") && g:netrw_win95ftp
- fun! NetReadFixup(method, line1, line2)
-" call Dfunc("NetReadFixup(method<".a:method."> line1=".a:line1." line2=".a:line2.")")
-
- " sanity checks -- attempt to convert inputs to integers
- let method = a:method + 0
- let line1 = a:line1 + 0
- let line2 = a:line2 + 0
- if type(method) != 0 || type(line1) != 0 || type(line2) != 0 || method < 0 || line1 <= 0 || line2 <= 0
-" call Dret("NetReadFixup")
- return
- endif
-
- if method == 3 " ftp (no <.netrc>)
- let fourblanklines= line2 - 3
- if fourblanklines >= line1
- exe "sil NetrwKeepj ".fourblanklines.",".line2."g/^\s*$/d"
- call histdel("/",-1)
- endif
- endif
-
-" call Dret("NetReadFixup")
- endfun
-endif
-
" ---------------------------------------------------------------------
" NetUserPass: set username and password for subsequent ftp transfer {{{2
" Usage: :call NetUserPass() -- will prompt for userid and password
@@ -3943,7 +3898,7 @@ fun! s:NetrwBrowse(islocal,dirname)
if b:netrw_curdir =~ '[/\\]$'
let b:netrw_curdir= substitute(b:netrw_curdir,'[/\\]$','','e')
endif
- if b:netrw_curdir =~ '\a:$' && (has("win32") || has("win95") || has("win64") || has("win16"))
+ if b:netrw_curdir =~ '\a:$' && has("win32")
let b:netrw_curdir= b:netrw_curdir."/"
endif
if b:netrw_curdir == ''
@@ -4097,7 +4052,7 @@ fun! s:NetrwFile(fname)
let b:netrw_curdir= getcwd()
endif
- if !exists("g:netrw_cygwin") && (has("win32") || has("win95") || has("win64") || has("win16"))
+ if !exists("g:netrw_cygwin") && has("win32")
if fname =~ '^\' || fname =~ '^\a:\'
" windows, but full path given
let ret= fname
@@ -4817,7 +4772,7 @@ fun! s:NetrwBrowseChgDir(islocal,newdir,...)
call s:SavePosn(s:netrw_posn)
NetrwKeepj call s:NetrwOptionsSave("s:")
NetrwKeepj call s:NetrwOptionsSafe(a:islocal)
- if (has("win32") || has("win95") || has("win64") || has("win16"))
+ if has("win32")
let dirname = substitute(b:netrw_curdir,'\\','/','ge')
else
let dirname = b:netrw_curdir
@@ -5064,7 +5019,7 @@ fun! s:NetrwBrowseChgDir(islocal,newdir,...)
endif
" call Decho("go-up: amiga: dirname<".dirname."> (go up one dir)",'~'.expand("<slnum>"))
- elseif !g:netrw_cygwin && (has("win32") || has("win95") || has("win64") || has("win16"))
+ elseif !g:netrw_cygwin && has("win32")
" windows
if a:islocal
let dirname= substitute(dirname,'^\(.*\)/\([^/]\+\)/$','\1','')
@@ -5349,7 +5304,7 @@ fun! netrw#BrowseX(fname,remote)
" set up the filename
" (lower case the extension, make a local copy of a remote file)
let exten= substitute(a:fname,'.*\.\(.\{-}\)','\1','e')
- if has("win32") || has("win95") || has("win64") || has("win16")
+ if has("win32")
let exten= substitute(exten,'^.*$','\L&\E','')
endif
if exten =~ "[\\/]"
@@ -5396,12 +5351,12 @@ fun! netrw#BrowseX(fname,remote)
" by default, g:netrw_suppress_gx_mesg is true
if g:netrw_suppress_gx_mesg
if &srr =~ "%s"
- if (has("win32") || has("win95") || has("win64") || has("win16"))
+ if has("win32")
let redir= substitute(&srr,"%s","nul","")
else
let redir= substitute(&srr,"%s","/dev/null","")
endif
- elseif (has("win32") || has("win95") || has("win64") || has("win16"))
+ elseif has("win32")
let redir= &srr . "nul"
else
let redir= &srr . "/dev/null"
@@ -5444,7 +5399,7 @@ fun! netrw#BrowseX(fname,remote)
call s:NetrwExe("sil !".viewer." ".viewopt.s:ShellEscape(fname,1).redir)
let ret= v:shell_error
- elseif has("win32") || has("win64")
+ elseif has("win32")
" call Decho("(netrw#BrowseX) win".(has("win32")? "32" : "64"),'~'.expand("<slnum>"))
if executable("start")
call s:NetrwExe('sil! !start rundll32 url.dll,FileProtocolHandler '.s:ShellEscape(fname,1))
@@ -7167,7 +7122,7 @@ fun! s:NetrwMarkFileCopy(islocal,...)
let args= join(map(deepcopy(s:netrwmarkfilelist_{bufnr('%')}),"s:ShellEscape(b:netrw_curdir.\"/\".v:val)"))
let tgt = s:ShellEscape(s:netrwmftgt)
endif
- if !g:netrw_cygwin && (has("win32") || has("win95") || has("win64") || has("win16"))
+ if !g:netrw_cygwin && has("win32")
let args= substitute(args,'/','\\','g')
let tgt = substitute(tgt, '/','\\','g')
endif
@@ -7181,7 +7136,7 @@ fun! s:NetrwMarkFileCopy(islocal,...)
" call Decho("args<".args."> is a directory",'~'.expand("<slnum>"))
let copycmd= g:netrw_localcopydircmd
" call Decho("using copydircmd<".copycmd.">",'~'.expand("<slnum>"))
- if !g:netrw_cygwin && (has("win32") || has("win95") || has("win64") || has("win16"))
+ if !g:netrw_cygwin && has("win32")
" window's xcopy doesn't copy a directory to a target properly. Instead, it copies a directory's
" contents to a target. One must append the source directory name to the target to get xcopy to
" do the right thing.
@@ -7799,7 +7754,7 @@ fun! s:NetrwMarkFileMove(islocal)
endif
let tgt = s:ShellEscape(s:netrwmftgt)
" call Decho("tgt<".tgt.">",'~'.expand("<slnum>"))
- if !g:netrw_cygwin && (has("win32") || has("win95") || has("win64") || has("win16"))
+ if !g:netrw_cygwin && has("win32")
let tgt= substitute(tgt, '/','\\','g')
" call Decho("windows exception: tgt<".tgt.">",'~'.expand("<slnum>"))
if g:netrw_localmovecmd =~ '\s'
@@ -7820,7 +7775,7 @@ fun! s:NetrwMarkFileMove(islocal)
" Jul 19, 2022: fixing file move when g:netrw_keepdir is 1
let fname= b:netrw_curdir."/".fname
endif
- if !g:netrw_cygwin && (has("win32") || has("win95") || has("win64") || has("win16"))
+ if !g:netrw_cygwin && has("win32")
let fname= substitute(fname,'/','\\','g')
endif
" call Decho("system(".movecmd." ".s:ShellEscape(fname)." ".tgt.")",'~'.expand("<slnum>"))
@@ -10239,7 +10194,7 @@ fun! s:NetrwRemoteFtpCmd(path,listcmd)
endif
" cleanup for Windows " {{{3
- if has("win32") || has("win95") || has("win64") || has("win16")
+ if has("win32")
sil! NetrwKeepj %s/\r$//e
NetrwKeepj call histdel("/",-1)
endif
@@ -10747,7 +10702,7 @@ fun! netrw#FileUrlEdit(fname)
let fname= substitute(fname,'^file://localhost/','file:///','')
" call Decho("fname<".fname.">",'~'.expand("<slnum>"))
endif
- if (has("win32") || has("win95") || has("win64") || has("win16"))
+ if has("win32")
if fname =~ '^file:///\=\a[|:]/'
" call Decho('converting file:///\a|/ -to- file://\a:/','~'.expand("<slnum>"))
let fname = substitute(fname,'^file:///\=\(\a\)[|:]/','file://\1:/','')
@@ -10757,7 +10712,7 @@ fun! netrw#FileUrlEdit(fname)
let fname2396 = netrw#RFC2396(fname)
let fname2396e= fnameescape(fname2396)
let plainfname= substitute(fname2396,'file://\(.*\)','\1',"")
- if (has("win32") || has("win95") || has("win64") || has("win16"))
+ if has("win32")
" call Decho("windows exception for plainfname",'~'.expand("<slnum>"))
if plainfname =~ '^/\+\a:'
" call Decho('removing leading "/"s','~'.expand("<slnum>"))
@@ -10969,7 +10924,7 @@ fun! s:LocalFastBrowser()
let s:netrw_events= 1
augroup AuNetrwEvent
au!
- if (has("win32") || has("win95") || has("win64") || has("win16"))
+ if has("win32")
" call Decho("installing autocmd: ShellCmdPost",'~'.expand("<slnum>"))
au ShellCmdPost * call s:LocalBrowseRefresh()
else
@@ -11011,7 +10966,7 @@ fun! s:LocalListing()
let filelist = filelist + s:NetrwGlob(dirname,".*",0)
" call Decho("filelist=".string(filelist),'~'.expand("<slnum>"))
- if g:netrw_cygwin == 0 && (has("win32") || has("win95") || has("win64") || has("win16"))
+ if g:netrw_cygwin == 0 && has("win32")
" call Decho("filelist=".string(filelist),'~'.expand("<slnum>"))
elseif index(filelist,'..') == -1 && b:netrw_curdir !~ '/'
" include ../ in the glob() entry if its missing
@@ -11057,7 +11012,7 @@ fun! s:LocalListing()
let pfile= filename."/"
elseif exists("b:netrw_curdir") && b:netrw_curdir !~ '^.*://' && !isdirectory(s:NetrwFile(filename))
- if (has("win32") || has("win95") || has("win64") || has("win16"))
+ if has("win32")
if filename =~ '\.[eE][xX][eE]$' || filename =~ '\.[cC][oO][mM]$' || filename =~ '\.[bB][aA][tT]$'
" indicate an executable
" call Decho("indicate <".filename."> is executable with trailing *",'~'.expand("<slnum>"))
@@ -11534,7 +11489,7 @@ endfun
" netrw#WinPath: tries to insure that the path is windows-acceptable, whether cygwin is used or not {{{2
fun! netrw#WinPath(path)
" call Dfunc("netrw#WinPath(path<".a:path.">)")
- if (!g:netrw_cygwin || &shell !~ '\%(\<bash\>\|\<zsh\>\)\%(\.exe\)\=$') && (has("win32") || has("win95") || has("win64") || has("win16"))
+ if (!g:netrw_cygwin || &shell !~ '\%(\<bash\>\|\<zsh\>\)\%(\.exe\)\=$') && has("win32")
" remove cygdrive prefix, if present
let path = substitute(a:path,g:netrw_cygdrive.'/\(.\)','\1:','')
" remove trailing slash (Win95)
@@ -11594,11 +11549,11 @@ fun! s:ComposePath(base,subdir)
endif
" COMBAK: test on windows with changing to root directory: :e C:/
- elseif a:subdir =~ '^\a:[/\\]\([^/\\]\|$\)' && (has("win32") || has("win95") || has("win64") || has("win16"))
+ elseif a:subdir =~ '^\a:[/\\]\([^/\\]\|$\)' && has("win32")
" call Decho("windows",'~'.expand("<slnum>"))
let ret= a:subdir
- elseif a:base =~ '^\a:[/\\]\([^/\\]\|$\)' && (has("win32") || has("win95") || has("win64") || has("win16"))
+ elseif a:base =~ '^\a:[/\\]\([^/\\]\|$\)' && has("win32")
" call Decho("windows",'~'.expand("<slnum>"))
if a:base =~ '[/\\]$'
let ret= a:base.a:subdir
@@ -11710,7 +11665,7 @@ fun! s:GetTempfile(fname)
" o/s dependencies
if g:netrw_cygwin != 0
let tmpfile = substitute(tmpfile,'^\(\a\):',g:netrw_cygdrive.'/\1','e')
- elseif has("win32") || has("win95") || has("win64") || has("win16")
+ elseif has("win32")
if !exists("+shellslash") || !&ssl
let tmpfile = substitute(tmpfile,'/','\','g')
endif
@@ -11926,7 +11881,7 @@ fun! s:NetrwDelete(path)
" call Dfunc("s:NetrwDelete(path<".a:path.">)")
let path = netrw#WinPath(a:path)
- if !g:netrw_cygwin && (has("win32") || has("win95") || has("win64") || has("win16"))
+ if !g:netrw_cygwin && has("win32")
if exists("+shellslash")
let sskeep= &shellslash
setl noshellslash
@@ -12117,7 +12072,7 @@ fun! s:NetrwLcd(newdir)
" 'root' (ie. '\'). The share name may start with either backslashes ('\\Foo') or
" forward slashes ('//Foo'), depending on whether backslashes have been converted to
" forward slashes by earlier code; so check for both.
- if (has("win32") || has("win95") || has("win64") || has("win16")) && !g:netrw_cygwin
+ if has("win32") && !g:netrw_cygwin
if a:newdir =~ '^\\\\\w\+' || a:newdir =~ '^//\w\+'
let dirname = '\'
exe 'NetrwKeepj sil lcd '.fnameescape(dirname)
@@ -12590,7 +12545,7 @@ endfun
" ---------------------------------------------------------------------
" s:ShellEscape: shellescape(), or special windows handling {{{2
fun! s:ShellEscape(s, ...)
- if (has('win32') || has('win64')) && $SHELL == '' && &shellslash
+ if has('win32') && $SHELL == '' && &shellslash
return printf('"%s"', substitute(a:s, '"', '""', 'g'))
endif
let f = a:0 > 0 ? a:1 : 0
diff --git a/runtime/autoload/netrwSettings.vim b/runtime/autoload/netrwSettings.vim
index 5525c0d035..3452602272 100644
--- a/runtime/autoload/netrwSettings.vim
+++ b/runtime/autoload/netrwSettings.vim
@@ -3,6 +3,8 @@
" Maintainer: This runtime file is looking for a new maintainer.
" Former Maintainer: Charles E Campbell
" Version: 18
+" Last Change:
+" 2024 May 08 by Vim Project: cleanup legacy Win9X checks
" Copyright: Copyright (C) 1999-2007 Charles E. Campbell {{{1
" Permission is hereby granted to use and distribute this code,
" with or without modifications, provided that this copyright
@@ -91,7 +93,6 @@ fun! netrwSettings#NetrwSettings()
put = 'let g:netrw_sshport = '.g:netrw_sshport
put = 'let g:netrw_silent = '.g:netrw_silent
put = 'let g:netrw_use_nt_rcp = '.g:netrw_use_nt_rcp
- put = 'let g:netrw_win95ftp = '.g:netrw_win95ftp
let s:netrw_xfer_stop= line(".")
put =''
put ='+ Netrw Messages'
diff --git a/runtime/doc/news.txt b/runtime/doc/news.txt
index 6bdb2d808e..111e69b0fe 100644
--- a/runtime/doc/news.txt
+++ b/runtime/doc/news.txt
@@ -435,10 +435,8 @@ The following changes to existing APIs or features add new behavior.
• Enabled treesitter highlighting for Lua files.
• The `workspace/didChangeWatchedFiles` LSP client capability is now enabled
- by default.
- • On Mac or Windows, `libuv.fs_watch` is used as the backend.
- • On Linux, `fswatch` (recommended) is used as the backend if available,
- otherwise `libuv.fs_event` is used on each subdirectory.
+ by default on Mac and Windows. Disabled on Linux since there currently isn't
+ a viable backend for watching files that scales well for large directories.
• |LspRequest| autocmd callbacks now contain additional information about the LSP
request status update that occurred.
diff --git a/runtime/doc/pi_netrw.txt b/runtime/doc/pi_netrw.txt
index d8fcd066a8..3014da2c5d 100644
--- a/runtime/doc/pi_netrw.txt
+++ b/runtime/doc/pi_netrw.txt
@@ -446,10 +446,6 @@ settings are described below, in |netrw-browser-options|, and in
messages don't always seem to show up this
way, but one doesn't have to quit the window.
- *g:netrw_win95ftp* =1 if using Win95, will remove four trailing blank
- lines that o/s's ftp "provides" on transfers
- =0 force normal ftp behavior (no trailing line removal)
-
*g:netrw_cygwin* =1 assume scp under windows is from cygwin. Also
permits network browsing to use ls with time and
size sorting (default if windows)
@@ -825,8 +821,6 @@ set in the user's <.vimrc> file: (see also |netrw-settings| |netrw-protocol|)
g:netrw_uid Holds current user-id for ftp.
g:netrw_use_nt_rcp =0 don't use WinNT/2K/XP's rcp (default)
=1 use WinNT/2K/XP's rcp, binary mode
- g:netrw_win95ftp =0 use unix-style ftp even if win95/98/ME/etc
- =1 use default method to do ftp >
-----------------------------------------------------------------------
<
*netrw-internal-variables*
@@ -955,21 +949,8 @@ messages) you may write a NetReadFixup() function:
endfunction
>
The NetReadFixup() function will be called if it exists and thus allows you to
-customize your reading process. As a further example, <netrw.vim> contains
-just such a function to handle Windows 95 ftp. For whatever reason, Windows
-95's ftp dumps four blank lines at the end of a transfer, and so it is
-desirable to automate their removal. Here's some code taken from <netrw.vim>
-itself:
->
- if has("win95") && g:netrw_win95ftp
- fun! NetReadFixup(method, line1, line2)
- if method == 3 " ftp (no <.netrc>)
- let fourblanklines= line2 - 3
- silent fourblanklines .. "," .. line2 .. "g/^\s*/d"
- endif
- endfunction
- endif
->
+customize your reading process.
+
(Related topics: |ftp| |netrw-userpass| |netrw-start|)
==============================================================================
@@ -3397,16 +3378,7 @@ Example: Clear netrw's marked file list via a mapping on gu >
(This section is likely to grow as I get feedback)
(also see |netrw-debug|)
*netrw-p1*
- P1. I use windows 95, and my ftp dumps four blank lines at the {{{2
- end of every read.
-
- See |netrw-fixup|, and put the following into your
- <.vimrc> file:
-
- let g:netrw_win95ftp= 1
-
- *netrw-p2*
- P2. I use Windows, and my network browsing with ftp doesn't sort by {{{2
+ P1. I use Windows, and my network browsing with ftp doesn't sort by {{{2
time or size! -or- The remote system is a Windows server; why
don't I get sorts by time or size?
@@ -3432,8 +3404,8 @@ Example: Clear netrw's marked file list via a mapping on gu >
modify its listing behavior.
- *netrw-p3*
- P3. I tried rcp://user@host/ (or protocol other than ftp) and netrw {{{2
+ *netrw-p2*
+ P2. I tried rcp://user@host/ (or protocol other than ftp) and netrw {{{2
used ssh! That wasn't what I asked for...
Netrw has two methods for browsing remote directories: ssh
@@ -3441,8 +3413,8 @@ Example: Clear netrw's marked file list via a mapping on gu >
When it comes time to do download a file (not just a directory
listing), netrw will use the given protocol to do so.
- *netrw-p4*
- P4. I would like long listings to be the default. {{{2
+ *netrw-p3*
+ P3. I would like long listings to be the default. {{{2
Put the following statement into your |vimrc|: >
@@ -3451,8 +3423,8 @@ Example: Clear netrw's marked file list via a mapping on gu >
Check out |netrw-browser-var| for more customizations that
you can set.
- *netrw-p5*
- P5. My times come up oddly in local browsing {{{2
+ *netrw-p4*
+ P4. My times come up oddly in local browsing {{{2
Does your system's strftime() accept the "%c" to yield dates
such as "Sun Apr 27 11:49:23 1997"? If not, do a
@@ -3461,16 +3433,16 @@ Example: Clear netrw's marked file list via a mapping on gu >
let g:netrw_timefmt= "%X" (where X is the option)
<
- *netrw-p6*
- P6. I want my current directory to track my browsing. {{{2
+ *netrw-p5*
+ P5. I want my current directory to track my browsing. {{{2
How do I do that?
Put the following line in your |vimrc|:
>
let g:netrw_keepdir= 0
<
- *netrw-p7*
- P7. I use Chinese (or other non-ascii) characters in my filenames, {{{2
+ *netrw-p6*
+ P6. I use Chinese (or other non-ascii) characters in my filenames, {{{2
and netrw (Explore, Sexplore, Hexplore, etc) doesn't display them!
(taken from an answer provided by Wu Yongwei on the vim
@@ -3484,8 +3456,8 @@ Example: Clear netrw's marked file list via a mapping on gu >
(...it is one more reason to recommend that people use utf-8!)
- *netrw-p8*
- P8. I'm getting "ssh is not executable on your system" -- what do I {{{2
+ *netrw-p7*
+ P7. I'm getting "ssh is not executable on your system" -- what do I {{{2
do?
(Dudley Fox) Most people I know use putty for windows ssh. It
@@ -3567,8 +3539,8 @@ Example: Clear netrw's marked file list via a mapping on gu >
of the others will use the string in g:netrw_ssh_cmd by
default.
- *netrw-p9* *netrw-ml_get*
- P9. I'm browsing, changing directory, and bang! ml_get errors {{{2
+ *netrw-p8* *netrw-ml_get*
+ P8. I'm browsing, changing directory, and bang! ml_get errors {{{2
appear and I have to kill vim. Any way around this?
Normally netrw attempts to avoid writing swapfiles for
@@ -3578,8 +3550,8 @@ Example: Clear netrw's marked file list via a mapping on gu >
in your <.vimrc>: >
let g:netrw_use_noswf= 0
<
- *netrw-p10*
- P10. I'm being pestered with "[something] is a directory" and {{{2
+ *netrw-p9*
+ P9. I'm being pestered with "[something] is a directory" and {{{2
"Press ENTER or type command to continue" prompts...
The "[something] is a directory" prompt is issued by Vim,
@@ -3589,8 +3561,8 @@ Example: Clear netrw's marked file list via a mapping on gu >
I also suggest that you set your |'cmdheight'| to 2 (or more) in
your <.vimrc> file.
- *netrw-p11*
- P11. I want to have two windows; a thin one on the left and my {{{2
+ *netrw-p10*
+ P10. I want to have two windows; a thin one on the left and my {{{2
editing window on the right. How may I accomplish this?
You probably want netrw running as in a side window. If so, you
@@ -3615,8 +3587,8 @@ Example: Clear netrw's marked file list via a mapping on gu >
<middlemouse> to select the file.
- *netrw-p12*
- P12. My directory isn't sorting correctly, or unwanted letters are {{{2
+ *netrw-p11*
+ P11. My directory isn't sorting correctly, or unwanted letters are {{{2
appearing in the listed filenames, or things aren't lining
up properly in the wide listing, ...
@@ -3625,8 +3597,8 @@ Example: Clear netrw's marked file list via a mapping on gu >
Multibyte encodings use two (or more) bytes per character.
You may need to change |g:netrw_sepchr| and/or |g:netrw_xstrlen|.
- *netrw-p13*
- P13. I'm a Windows + putty + ssh user, and when I attempt to {{{2
+ *netrw-p12*
+ P12. I'm a Windows + putty + ssh user, and when I attempt to {{{2
browse, the directories are missing trailing "/"s so netrw treats
them as file transfers instead of as attempts to browse
subdirectories. How may I fix this?
@@ -3646,8 +3618,8 @@ Example: Clear netrw's marked file list via a mapping on gu >
"let g:netrw_sftp_cmd = "d:\\dev\\putty\\PSFTP.exe"
"let g:netrw_scp_cmd = "d:\\dev\\putty\\PSCP.exe"
<
- *netrw-p14*
- P14. I would like to speed up writes using Nwrite and scp/ssh {{{2
+ *netrw-p13*
+ P13. I would like to speed up writes using Nwrite and scp/ssh {{{2
style connections. How? (Thomer M. Gil)
Try using ssh's ControlMaster and ControlPath (see the ssh_config
@@ -3673,8 +3645,8 @@ Example: Clear netrw's marked file list via a mapping on gu >
vim scp://host.domain.com//home/user/.bashrc
<
- *netrw-p15*
- P15. How may I use a double-click instead of netrw's usual single {{{2
+ *netrw-p14*
+ P14. How may I use a double-click instead of netrw's usual single {{{2
click to open a file or directory? (Ben Fritz)
First, disable netrw's mapping with >
@@ -3686,8 +3658,8 @@ Example: Clear netrw's marked file list via a mapping on gu >
all netrw's mouse mappings, not just the <leftmouse> one.
(see |g:netrw_mousemaps|)
- *netrw-p16*
- P16. When editing remote files (ex. :e ftp://hostname/path/file), {{{2
+ *netrw-p15*
+ P15. When editing remote files (ex. :e ftp://hostname/path/file), {{{2
under Windows I get an |E303| message complaining that its unable
to open a swap file.
@@ -3695,8 +3667,8 @@ Example: Clear netrw's marked file list via a mapping on gu >
directory. Start netrw from your $HOME or other writable
directory.
- *netrw-p17*
- P17. Netrw is closing buffers on its own. {{{2
+ *netrw-p16*
+ P16. Netrw is closing buffers on its own. {{{2
What steps will reproduce the problem?
1. :Explore, navigate directories, open a file
2. :Explore, open another file
@@ -3709,15 +3681,15 @@ Example: Clear netrw's marked file list via a mapping on gu >
It appears that the buffers are not exactly closed;
a ":ls!" will show them (although ":ls" does not).
- *netrw-P18*
- P18. How to locally edit a file that's only available via {{{2
+ *netrw-P17*
+ P17. How to locally edit a file that's only available via {{{2
another server accessible via ssh?
See http://stackoverflow.com/questions/12469645/
"Using Vim to Remotely Edit A File on ServerB Only
Accessible From ServerA"
- *netrw-P19*
- P19. How do I get numbering on in directory listings? {{{2
+ *netrw-P18*
+ P18. How do I get numbering on in directory listings? {{{2
With |g:netrw_bufsettings|, you can control netrw's buffer
settings; try putting >
let g:netrw_bufsettings="noma nomod nu nobl nowrap ro nornu"
@@ -3725,8 +3697,8 @@ Example: Clear netrw's marked file list via a mapping on gu >
instead, try >
let g:netrw_bufsettings="noma nomod nonu nobl nowrap ro rnu"
<
- *netrw-P20*
- P20. How may I have gvim start up showing a directory listing? {{{2
+ *netrw-P19*
+ P19. How may I have gvim start up showing a directory listing? {{{2
Try putting the following code snippet into your .vimrc: >
augroup VimStartup
au!
@@ -3738,8 +3710,8 @@ Example: Clear netrw's marked file list via a mapping on gu >
This snippet assumes that you have client-server enabled
(ie. a "huge" vim version).
- *netrw-P21*
- P21. I've made a directory (or file) with an accented character, {{{2
+ *netrw-P20*
+ P20. I've made a directory (or file) with an accented character, {{{2
but netrw isn't letting me enter that directory/read that file:
Its likely that the shell or o/s is using a different encoding
@@ -3749,8 +3721,8 @@ Example: Clear netrw's marked file list via a mapping on gu >
au FileType netrw set enc=latin1
<
- *netrw-P22*
- P22. I get an error message when I try to copy or move a file: {{{2
+ *netrw-P21*
+ P21. I get an error message when I try to copy or move a file: {{{2
>
**error** (netrw) tried using g:netrw_localcopycmd<cp>; it doesn't work!
<
diff --git a/runtime/ftplugin/jj.vim b/runtime/ftplugin/jj.vim
new file mode 100644
index 0000000000..cc5d700a30
--- /dev/null
+++ b/runtime/ftplugin/jj.vim
@@ -0,0 +1,19 @@
+" Vim filetype plugin
+" Language: jj description
+" Maintainer: Gregory Anders <greg@gpanders.com>
+" Last Change: 2024 May 8
+
+if exists('b:did_ftplugin')
+ finish
+endif
+let b:did_ftplugin = 1
+
+" Use the same formatoptions and textwidth as the gitcommit ftplugin
+setlocal nomodeline formatoptions+=tl textwidth=72
+setlocal formatoptions-=c formatoptions-=r formatoptions-=o formatoptions-=q formatoptions+=n
+setlocal formatlistpat=^\\s*\\d\\+[\\]:.)}]\\s\\+\\\|^\\s*[-*+]\\s\\+
+
+setlocal comments=b:JJ:
+setlocal commentstring=JJ:\ %s
+
+let b:undo_ftplugin = 'setl modeline< formatoptions< textwidth< formatlistpat< comments< commentstring<'
diff --git a/runtime/lua/vim/filetype.lua b/runtime/lua/vim/filetype.lua
index 3b7ea03c2d..1ea1bbccf6 100644
--- a/runtime/lua/vim/filetype.lua
+++ b/runtime/lua/vim/filetype.lua
@@ -570,6 +570,7 @@ local extension = {
jsx = 'javascriptreact',
clp = 'jess',
jgr = 'jgraph',
+ jjdescription = 'jj',
j73 = 'jovial',
jov = 'jovial',
jovial = 'jovial',
diff --git a/runtime/lua/vim/lsp/protocol.lua b/runtime/lua/vim/lsp/protocol.lua
index 599f02425e..419c2ff644 100644
--- a/runtime/lua/vim/lsp/protocol.lua
+++ b/runtime/lua/vim/lsp/protocol.lua
@@ -10,6 +10,8 @@ local function get_value_set(tbl)
return value_set
end
+local sysname = vim.uv.os_uname().sysname
+
-- Protocol for the Microsoft Language Server Protocol (mslsp)
local protocol = {}
@@ -835,7 +837,10 @@ function protocol.make_client_capabilities()
refreshSupport = true,
},
didChangeWatchedFiles = {
- dynamicRegistration = true,
+ -- TODO(lewis6991): do not advertise didChangeWatchedFiles on Linux
+ -- or BSD since all the current backends are too limited.
+ -- Ref: #27807, #28058, #23291, #26520
+ dynamicRegistration = sysname == 'Darwin' or sysname == 'Windows_NT',
relativePatternSupport = true,
},
inlayHint = {
diff --git a/runtime/plugin/netrwPlugin.vim b/runtime/plugin/netrwPlugin.vim
index ed6f7dc008..c70e6518ff 100644
--- a/runtime/plugin/netrwPlugin.vim
+++ b/runtime/plugin/netrwPlugin.vim
@@ -2,6 +2,8 @@
" PLUGIN SECTION
" Maintainer: This runtime file is looking for a new maintainer.
" Date: Feb 09, 2021
+" Last Change:
+" 2024 May 08 by Vim Project: cleanup legacy Win9X checks
" Former Maintainer: Charles E Campbell
" GetLatestVimScripts: 1075 1 :AutoInstall: netrw.vim
" Copyright: Copyright (C) 1999-2021 Charles E. Campbell {{{1
@@ -35,7 +37,7 @@ augroup FileExplorer
au BufLeave * if &ft != "netrw"|let w:netrw_prvfile= expand("%:p")|endif
au BufEnter * sil call s:LocalBrowse(expand("<amatch>"))
au VimEnter * sil call s:VimEnter(expand("<amatch>"))
- if has("win32") || has("win95") || has("win64") || has("win16")
+ if has("win32")
au BufEnter .* sil call s:LocalBrowse(expand("<amatch>"))
endif
augroup END
diff --git a/runtime/syntax/java.vim b/runtime/syntax/java.vim
index ff9b4b04be..4bf154473d 100644
--- a/runtime/syntax/java.vim
+++ b/runtime/syntax/java.vim
@@ -3,7 +3,7 @@
" Maintainer: Aliaksei Budavei <0x000c70 AT gmail DOT com>
" Former Maintainer: Claudio Fleiner <claudio@fleiner.com>
" Repository: https://github.com/zzzyxwvut/java-vim.git
-" Last Change: 2024 Apr 28
+" Last Change: 2024 May 07
" Please check :help java.vim for comments on some of the options available.
@@ -90,7 +90,6 @@ if s:module_info_cur_buf
syn keyword javaModuleStorageClass module transitive
syn keyword javaModuleStmt open requires exports opens uses provides
syn keyword javaModuleExternal to with
- syn cluster javaTop add=javaModuleStorageClass,javaModuleStmt,javaModuleExternal
endif
if exists("java_highlight_java_lang_ids")
@@ -107,7 +106,6 @@ if exists("java_highlight_all") || exists("java_highlight_java") || exists("ja
" the current keyword placement. The below _match_es follow suit.
syn keyword javaR_JavaLang ArithmeticException ArrayIndexOutOfBoundsException ArrayStoreException ClassCastException IllegalArgumentException IllegalMonitorStateException IllegalThreadStateException IndexOutOfBoundsException NegativeArraySizeException NullPointerException NumberFormatException RuntimeException SecurityException StringIndexOutOfBoundsException IllegalStateException UnsupportedOperationException EnumConstantNotPresentException TypeNotPresentException IllegalCallerException LayerInstantiationException WrongThreadException MatchException
- syn cluster javaTop add=javaR_JavaLang
syn cluster javaClasses add=javaR_JavaLang
hi def link javaR_JavaLang javaR_Java
" Member enumerations:
@@ -128,15 +126,12 @@ if exists("java_highlight_all") || exists("java_highlight_java") || exists("ja
syn match javaC_JavaLang "\<System\>" " See javaDebug.
" As of JDK 21, java.lang.Compiler is no more (deprecated in JDK 9).
syn keyword javaLangDeprecated Compiler
- syn cluster javaTop add=javaC_JavaLang
syn cluster javaClasses add=javaC_JavaLang
hi def link javaC_JavaLang javaC_Java
syn keyword javaE_JavaLang AbstractMethodError ClassCircularityError ClassFormatError Error IllegalAccessError IncompatibleClassChangeError InstantiationError InternalError LinkageError NoClassDefFoundError NoSuchFieldError NoSuchMethodError OutOfMemoryError StackOverflowError ThreadDeath UnknownError UnsatisfiedLinkError VerifyError VirtualMachineError ExceptionInInitializerError UnsupportedClassVersionError AssertionError BootstrapMethodError
- syn cluster javaTop add=javaE_JavaLang
syn cluster javaClasses add=javaE_JavaLang
hi def link javaE_JavaLang javaE_Java
syn keyword javaX_JavaLang ClassNotFoundException CloneNotSupportedException Exception IllegalAccessException InstantiationException InterruptedException NoSuchMethodException Throwable NoSuchFieldException ReflectiveOperationException
- syn cluster javaTop add=javaX_JavaLang
syn cluster javaClasses add=javaX_JavaLang
hi def link javaX_JavaLang javaX_Java
@@ -152,7 +147,6 @@ if exists("java_highlight_all") || exists("java_highlight_java") || exists("ja
syn keyword javaLangObject clone equals finalize getClass hashCode
syn keyword javaLangObject notify notifyAll toString wait
hi def link javaLangObject javaConstant
- syn cluster javaTop add=javaLangObject
endif
if filereadable(expand("<sfile>:p:h")."/javaid.vim")
@@ -187,13 +181,6 @@ hi def link javaLabelVarType javaOperator
hi def link javaLabelNumber javaNumber
hi def link javaLabelCastType javaType
-" highlighting C++ keywords as errors removed, too many people find it
-" annoying. Was: if !exists("java_allow_cpp_keywords")
-
-" The following cluster contains all java groups except the contained ones
-syn cluster javaTop add=javaExternal,javaError,javaBranch,javaLabelRegion,javaConditional,javaRepeat,javaBoolean,javaConstant,javaTypedef,javaOperator,javaType,javaStatement,javaStorageClass,javaAssert,javaExceptions,javaMethodDecl,javaClassDecl,javaScopeDecl,javaConceptKind,javaError2,javaUserLabel,javaLangObject,javaAnnotation,javaVarArg
-
-
" Comments
syn keyword javaTodo contained TODO FIXME XXX
@@ -223,8 +210,6 @@ syn match javaCommentError contained "/\*"me=e-1 display
hi def link javaCommentError javaError
hi def link javaCommentStart javaComment
-syn cluster javaTop add=javaComment,javaLineComment
-
if !exists("java_ignore_javadoc") && main_syntax != 'jsp'
syntax case ignore
" syntax coloring for javadoc comments (HTML)
@@ -266,8 +251,6 @@ syn match javaTextBlockError +"""\s*"""+
syn region javaStrTemplEmbExp contained matchgroup=javaStrTempl start="\\{" end="}" contains=TOP
syn region javaStrTempl start=+\%(\.[[:space:]\n]*\)\@<="+ end=+"+ contains=javaStrTemplEmbExp,javaSpecialChar,javaSpecialError,@Spell
syn region javaStrTempl start=+\%(\.[[:space:]\n]*\)\@<="""[ \t\x0c\r]*$+hs=e+1 end=+"""+he=s-1 contains=javaStrTemplEmbExp,javaSpecialChar,javaSpecialError,javaTextBlockError,@Spell
-" The next line is commented out, it can cause a crash for a long line
-"syn match javaStringError +"\%([^"\\]\|\\.\)*$+
syn match javaCharacter "'[^']*'" contains=javaSpecialChar,javaSpecialCharError
syn match javaCharacter "'\\''" contains=javaSpecialChar
syn match javaCharacter "'[^\\]'"
@@ -286,8 +269,6 @@ syn match javaNumber "\<0[xX]\%(\x\%(_*\x\)*\.\=\|\%(\x\%(_*\x\)*\)\=\.\x\%(
" Unicode characters
syn match javaSpecial "\\u\x\x\x\x"
-syn cluster javaTop add=javaString,javaStrTempl,javaCharacter,javaNumber,javaSpecial,javaStringError,javaTextBlockError
-
" Method declarations (JLS-17, §8.4.3, §8.4.4, §9.4).
if exists("java_highlight_functions")
syn cluster javaFuncParams contains=javaAnnotation,@javaClasses,javaType,javaVarArg,javaComment,javaLineComment
@@ -328,7 +309,6 @@ if exists("java_highlight_functions")
syn match javaLambdaDef "\<\K\k*\>\%(\<default\>\)\@<!\s*->"
syn match javaBraces "[{}]"
- syn cluster javaTop add=javaFuncDef,javaBraces,javaLambdaDef
endif
if exists("java_highlight_debug")
@@ -341,8 +321,6 @@ if exists("java_highlight_debug")
syn region javaDebugStrTemplEmbExp contained matchgroup=javaDebugStrTempl start="\\{" end="}" contains=javaComment,javaLineComment,javaDebug\%(Paren\)\@!.*
syn region javaDebugStrTempl contained start=+\%(\.[[:space:]\n]*\)\@<="+ end=+"+ contains=javaDebugStrTemplEmbExp,javaDebugSpecial
syn region javaDebugStrTempl contained start=+\%(\.[[:space:]\n]*\)\@<="""[ \t\x0c\r]*$+hs=e+1 end=+"""+he=s-1 contains=javaDebugStrTemplEmbExp,javaDebugSpecial,javaDebugTextBlockError
- " The next line is commented out, it can cause a crash for a long line
-" syn match javaDebugStringError contained +"\%([^"\\]\|\\.\)*$+
syn match javaDebugTextBlockError contained +"""\s*"""+
syn match javaDebugCharacter contained "'[^\\]'"
syn match javaDebugSpecialCharacter contained "'\\.'"
@@ -366,13 +344,10 @@ if exists("java_highlight_debug")
" FIXME: What API do "trace*" belong to?
" syn match javaDebug "\<trace[SL]\=\s*("me=e-1 contains=javaDebug.* nextgroup=javaDebugParen
- syn cluster javaTop add=javaDebug
-
hi def link javaDebug Debug
hi def link javaDebugString DebugString
hi def link javaDebugStrTempl Macro
- hi def link javaDebugStringError javaError
- hi def link javaDebugTextBlockError javaDebugStringError
+ hi def link javaDebugTextBlockError Error
hi def link javaDebugType DebugType
hi def link javaDebugBoolean DebugBoolean
hi def link javaDebugNumber Debug
@@ -390,7 +365,6 @@ endif
if exists("java_mark_braces_in_parens_as_errors")
syn match javaInParen contained "[{}]"
hi def link javaInParen javaError
- syn cluster javaTop add=javaInParen
endif
" catch errors caused by wrong parenthesis
@@ -411,6 +385,10 @@ if exists("java_highlight_functions")
syn match javaLambdaDef "\k\@4<!(\%(\k\|[[:space:]<>?\[\]@,.]\)*)\s*->"
endif
+" The @javaTop cluster comprises non-contained Java syntax groups.
+" Note that the syntax file "aidl.vim" relies on its availability.
+syn cluster javaTop contains=TOP,javaDocComment,javaFold,javaParenError,javaParenT
+
if !exists("java_minlines")
let java_minlines = 10
endif
@@ -452,8 +430,7 @@ hi def link javaCharacter Character
hi def link javaSpecialChar SpecialChar
hi def link javaNumber Number
hi def link javaError Error
-hi def link javaStringError Error
-hi def link javaTextBlockError javaStringError
+hi def link javaTextBlockError Error
hi def link javaStatement Statement
hi def link javaOperator Operator
hi def link javaComment Comment
@@ -497,4 +474,4 @@ let b:spell_options = "contained"
let &cpo = s:cpo_save
unlet s:selectable_regexp_engine s:module_info_cur_buf s:cpo_save
-" vim: ts=8
+" vim: sw=2 ts=8 noet sta
diff --git a/runtime/syntax/jj.vim b/runtime/syntax/jj.vim
new file mode 100644
index 0000000000..a2911a0268
--- /dev/null
+++ b/runtime/syntax/jj.vim
@@ -0,0 +1,20 @@
+" Vim syntax file
+" Language: jj description
+" Maintainer: Gregory Anders <greg@gpanders.com>
+" Last Change: 2024 May 8
+
+if exists('b:current_syntax')
+ finish
+endif
+let b:current_syntax = 'jj'
+
+syn match jjAdded "A .*" contained
+syn match jjRemoved "D .*" contained
+syn match jjChanged "M .*" contained
+
+syn region jjComment start="^JJ: " end="$" contains=jjAdded,jjRemoved,jjChanged
+
+hi def link jjComment Comment
+hi def link jjAdded Added
+hi def link jjRemoved Removed
+hi def link jjChanged Changed
diff --git a/runtime/syntax/spec.vim b/runtime/syntax/spec.vim
index 12ce8d5ac1..4cb3a343eb 100644
--- a/runtime/syntax/spec.vim
+++ b/runtime/syntax/spec.vim
@@ -111,7 +111,7 @@ syn region specDescriptionArea matchgroup=specSection start='^%description' end=
syn region specPackageArea matchgroup=specSection start='^%package' end='^%'me=e-1 contains=specPackageOpts,specPreAmble,specComment
"%% Scripts Section %%
-syn region specScriptArea matchgroup=specSection start='^%\(prep\|build\|install\|clean\|check\|pre\|postun\|preun\|post\|posttrans\)\>' skip='^%{\|^%\(define\|patch\d*\|configure\|GNUconfigure\|setup\|autosetup\|autopatch\|find_lang\|make_build\|makeinstall\|make_install\)\>' end='^%'me=e-1 contains=specSpecialVariables,specVariables,@specCommands,specVariables,shDo,shFor,shCaseEsac,specNoNumberHilite,specCommandOpts,shComment,shIf,specSpecialChar,specMacroIdentifier,specSectionMacroArea,specSectionMacroBracketArea,shOperator,shQuote1,shQuote2
+syn region specScriptArea matchgroup=specSection start='^%\(prep\|generate_buildrequires\|conf\|build\|install\|clean\|check\|pre\|postun\|preun\|post\|posttrans\)\>' skip='^%{\|^%\(define\|patch\d*\|configure\|GNUconfigure\|setup\|autosetup\|autopatch\|find_lang\|make_build\|makeinstall\|make_install\)\>' end='^%'me=e-1 contains=specSpecialVariables,specVariables,@specCommands,specVariables,shDo,shFor,shCaseEsac,specNoNumberHilite,specCommandOpts,shComment,shIf,specSpecialChar,specMacroIdentifier,specSectionMacroArea,specSectionMacroBracketArea,shOperator,shQuote1,shQuote2
"%% Changelog Section %%
syn region specChangelogArea matchgroup=specSection start='^%changelog' end='^%'me=e-1 contains=specEmail,specURL,specWeekday,specMonth,specNumber,specComment,specLicense
diff --git a/src/nvim/move.c b/src/nvim/move.c
index 377ccd7596..078ce3d72c 100644
--- a/src/nvim/move.c
+++ b/src/nvim/move.c
@@ -286,6 +286,7 @@ void update_topline(win_T *wp)
}
wp->w_topline = 1;
wp->w_botline = 2;
+ wp->w_skipcol = 0;
wp->w_valid |= VALID_BOTLINE|VALID_BOTLINE_AP;
wp->w_viewport_invalid = true;
wp->w_scbind_pos = 1;
diff --git a/src/nvim/quickfix.c b/src/nvim/quickfix.c
index 94e176bd94..2713dd2a45 100644
--- a/src/nvim/quickfix.c
+++ b/src/nvim/quickfix.c
@@ -4195,6 +4195,12 @@ static void qf_fill_buffer(qf_list_T *qfl, buf_T *buf, qfline_T *old_last, int q
}
}
+ FOR_ALL_TAB_WINDOWS(tp, wp) {
+ if (wp->w_buffer == curbuf) {
+ wp->w_skipcol = 0;
+ }
+ }
+
// Remove all undo information
u_clearallandblockfree(curbuf);
}
diff --git a/test/functional/legacy/scroll_opt_spec.lua b/test/functional/legacy/scroll_opt_spec.lua
index 80b8e72aec..06460a9986 100644
--- a/test/functional/legacy/scroll_opt_spec.lua
+++ b/test/functional/legacy/scroll_opt_spec.lua
@@ -913,6 +913,119 @@ describe('smoothscroll', function()
assert_alive()
end)
+ -- oldtest: Test_smoothscroll_insert_bottom()
+ it('works in Insert mode at bottom of window', function()
+ screen:try_resize(40, 9)
+ exec([[
+ call setline(1, repeat([repeat('A very long line ...', 10)], 5))
+ set wrap smoothscroll scrolloff=0
+ ]])
+ feed('Go123456789<CR>')
+ screen:expect([[
+ {1:<<<}ery long line ...A very long line ...|
+ A very long line ...A very long line ...|*5
+ 123456789 |
+ ^ |
+ {5:-- INSERT --} |
+ ]])
+ end)
+
+ -- oldtest: Test_smoothscroll_in_qf_window()
+ it('works in quickfix window when changing quickfix list', function()
+ screen:try_resize(60, 20)
+ exec([[
+ set nocompatible display=lastline
+ copen 5
+ setlocal number smoothscroll
+ let g:l = [{'text': 'foo'}] + repeat([{'text': join(range(30))}], 10)
+ call setqflist(g:l, 'r')
+ normal! G
+ wincmd t
+ let g:l1 = [{'text': join(range(1000))}]
+ ]])
+ screen:expect([[
+ ^ |
+ {1:~ }|*11
+ {3:[No Name] }|
+ {1:<<<}{8: }21 22 23 24 25 26 27 28 29 |
+ {8: 10 }|| 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
+ {8: }21 22 23 24 25 26 27 28 29 |
+ {8: 11 }|| 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
+ {8: }21 22 23 24 25 26 27 28 29 |
+ {2:[Quickfix List] }|
+ |
+ ]])
+
+ feed([[:call setqflist([], 'r')<CR>]])
+ local screen_empty = [[
+ ^ |
+ {1:~ }|*11
+ {3:[No Name] }|
+ {8: 1 } |
+ {1:~ }|*4
+ {2:[Quickfix List] }|
+ :call setqflist([], 'r') |
+ ]]
+ screen:expect(screen_empty)
+
+ feed([[:call setqflist(g:l, 'r')<CR>]])
+ local screen_l_top = [[
+ ^ |
+ {1:~ }|*11
+ {3:[No Name] }|
+ {8: 1 }{10:|| foo }|
+ {8: 2 }|| 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
+ {8: }21 22 23 24 25 26 27 28 29 |
+ {8: 3 }|| 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
+ {8: }21 22 23 24 25 26 27 28 29 |
+ {2:[Quickfix List] }|
+ :call setqflist(g:l, 'r') |
+ ]]
+ screen:expect(screen_l_top)
+
+ feed([[:call setqflist(g:l1, 'r')<CR>]])
+ local screen_l1_top = [[
+ ^ |
+ {1:~ }|*11
+ {3:[No Name] }|
+ {8: 1 }{10:|| 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 }|
+ {8: }{10:21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39}|
+ {8: }{10: 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 5}|
+ {8: }{10:8 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 }|
+ {8: }{10:77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95}|
+ {2:[Quickfix List] }|
+ :call setqflist(g:l1, 'r') |
+ ]]
+ screen:expect(screen_l1_top)
+
+ feed('<C-W>b$<C-W>t')
+ local screen_l1_bot = [[
+ ^ |
+ {1:~ }|*11
+ {3:[No Name] }|
+ {1:<<<}{8: }{10: 937 938 939 940 941 942 943 944 945 946 947 948 949 950}|
+ {8: }{10: 951 952 953 954 955 956 957 958 959 960 961 962 963 964}|
+ {8: }{10: 965 966 967 968 969 970 971 972 973 974 975 976 977 978}|
+ {8: }{10: 979 980 981 982 983 984 985 986 987 988 989 990 991 992}|
+ {8: }{10: 993 994 995 996 997 998 999 }|
+ {2:[Quickfix List] }|
+ :call setqflist(g:l1, 'r') |
+ ]]
+ screen:expect(screen_l1_bot)
+
+ feed([[:call setqflist([], 'r')<CR>]])
+ screen:expect(screen_empty)
+
+ feed([[:call setqflist(g:l1, 'r')<CR>]])
+ screen:expect(screen_l1_top)
+
+ feed('<C-W>b$<C-W>t')
+ screen:expect(screen_l1_bot)
+
+ feed([[:call setqflist(g:l, 'r')<CR>]])
+ screen:expect(screen_l_top)
+ end)
+
it('works with virt_lines above and below', function()
screen:try_resize(55, 7)
exec([=[
@@ -986,22 +1099,6 @@ describe('smoothscroll', function()
]])
end)
- it('works in Insert mode at bottom of window', function()
- screen:try_resize(40, 9)
- exec([[
- call setline(1, repeat([repeat('A very long line ...', 10)], 5))
- set wrap smoothscroll scrolloff=0
- ]])
- feed('Go123456789<CR>')
- screen:expect([[
- {1:<<<}ery long line ...A very long line ...|
- A very long line ...A very long line ...|*5
- 123456789 |
- ^ |
- {5:-- INSERT --} |
- ]])
- end)
-
it('<<< marker shows with tabline, winbar and splits', function()
screen:try_resize(40, 12)
screen:set_default_attr_ids({
diff --git a/test/functional/plugin/lsp_spec.lua b/test/functional/plugin/lsp_spec.lua
index 0432d3fc94..3bbb5c0971 100644
--- a/test/functional/plugin/lsp_spec.lua
+++ b/test/functional/plugin/lsp_spec.lua
@@ -5521,7 +5521,7 @@ describe('LSP', function()
)
end
- eq(true, check_registered(nil)) -- start{_client}() defaults to make_client_capabilities().
+ eq(is_os('mac') or is_os('win'), check_registered(nil)) -- start{_client}() defaults to make_client_capabilities().
eq(false, check_registered(vim.empty_dict()))
eq(
false,
diff --git a/test/old/testdir/test_filetype.vim b/test/old/testdir/test_filetype.vim
index 174eb333d9..3dd3db512a 100644
--- a/test/old/testdir/test_filetype.vim
+++ b/test/old/testdir/test_filetype.vim
@@ -360,6 +360,7 @@ func s:GetFilenameChecks() abort
\ 'javascriptreact': ['file.jsx'],
\ 'jess': ['file.clp'],
\ 'jgraph': ['file.jgr'],
+ \ 'jj': ['file.jjdescription'],
\ 'jq': ['file.jq'],
\ 'jovial': ['file.jov', 'file.j73', 'file.jovial'],
\ 'jproperties': ['file.properties', 'file.properties_xx', 'file.properties_xx_xx', 'some.properties_xx_xx_file', 'org.eclipse.xyz.prefs'],
diff --git a/test/old/testdir/test_scroll_opt.vim b/test/old/testdir/test_scroll_opt.vim
index 50b0e13ba4..c7b986e040 100644
--- a/test/old/testdir/test_scroll_opt.vim
+++ b/test/old/testdir/test_scroll_opt.vim
@@ -964,6 +964,51 @@ func Test_smoothscroll_insert_bottom()
call StopVimInTerminal(buf)
endfunc
+func Test_smoothscroll_in_qf_window()
+ CheckFeature quickfix
+ CheckScreendump
+
+ let lines =<< trim END
+ set nocompatible display=lastline
+ copen 5
+ setlocal number smoothscroll
+ let g:l = [{'text': 'foo'}] + repeat([{'text': join(range(30))}], 10)
+ call setqflist(g:l, 'r')
+ normal! G
+ wincmd t
+ let g:l1 = [{'text': join(range(1000))}]
+ END
+ call writefile(lines, 'XSmoothScrollInQfWindow', 'D')
+ let buf = RunVimInTerminal('-u NONE -S XSmoothScrollInQfWindow', #{rows: 20, cols: 60})
+ call VerifyScreenDump(buf, 'Test_smoothscroll_in_qf_window_1', {})
+
+ call term_sendkeys(buf, ":call setqflist([], 'r')\<CR>")
+ call VerifyScreenDump(buf, 'Test_smoothscroll_in_qf_window_2', {})
+
+ call term_sendkeys(buf, ":call setqflist(g:l, 'r')\<CR>")
+ call VerifyScreenDump(buf, 'Test_smoothscroll_in_qf_window_3', {})
+
+ call term_sendkeys(buf, ":call setqflist(g:l1, 'r')\<CR>")
+ call VerifyScreenDump(buf, 'Test_smoothscroll_in_qf_window_4', {})
+
+ call term_sendkeys(buf, "\<C-W>b$\<C-W>t")
+ call VerifyScreenDump(buf, 'Test_smoothscroll_in_qf_window_5', {})
+
+ call term_sendkeys(buf, ":call setqflist([], 'r')\<CR>")
+ call VerifyScreenDump(buf, 'Test_smoothscroll_in_qf_window_2', {})
+
+ call term_sendkeys(buf, ":call setqflist(g:l1, 'r')\<CR>")
+ call VerifyScreenDump(buf, 'Test_smoothscroll_in_qf_window_4', {})
+
+ call term_sendkeys(buf, "\<C-W>b$\<C-W>t")
+ call VerifyScreenDump(buf, 'Test_smoothscroll_in_qf_window_5', {})
+
+ call term_sendkeys(buf, ":call setqflist(g:l, 'r')\<CR>")
+ call VerifyScreenDump(buf, 'Test_smoothscroll_in_qf_window_3', {})
+
+ call StopVimInTerminal(buf)
+endfunc
+
func Test_smoothscroll_in_zero_width_window()
set cpo+=n number smoothscroll
set winwidth=99999 winminwidth=0