Skip to content

Commit 37bfc1f

Browse files
committed
Merge remote-tracking branch 'vim/master'
This merges the upstream socket client server code. For now it is disabled to prevent it from interferring with MacVim's own client server implementation.
2 parents f3c3eae + 306a138 commit 37bfc1f

File tree

364 files changed

+17781
-15352
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

364 files changed

+17781
-15352
lines changed

.github/MAINTAINERS

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,7 @@ runtime/ftplugin/nginx.vim @chr4
239239
runtime/ftplugin/nim.vim @ribru17
240240
runtime/ftplugin/nroff.vim @averms
241241
runtime/ftplugin/nsis.vim @k-takata
242-
runtime/ftplugin/nu.vim @mrcjkb
242+
runtime/ftplugin/nu.vim @elkasztano
243243
runtime/ftplugin/octave.vim @dkearns
244244
runtime/ftplugin/ondir.vim @jparise
245245
runtime/ftplugin/opencl.vim @Freed-Wu
@@ -380,6 +380,7 @@ runtime/indent/mma.vim @dkearns
380380
runtime/indent/mojo.vim @ribru17
381381
runtime/indent/nginx.vim @chr4
382382
runtime/indent/nsis.vim @k-takata
383+
runtime/indent/nu.vim @elkasztano
383384
runtime/indent/occam.vim @dkearns
384385
runtime/indent/perl.vim @petdance
385386
runtime/indent/php.vim @2072
@@ -449,6 +450,7 @@ runtime/syntax/bzr.vim @hdima
449450
runtime/syntax/cabal.vim @coot
450451
runtime/syntax/cabalconfig.vim @coot
451452
runtime/syntax/cabalproject.vim @coot
453+
runtime/syntax/cangjie.vim @WuJunkai2004
452454
runtime/syntax/cf.vim @ernstvanderlinden
453455
runtime/syntax/chatito.vim @ObserverOfTime
454456
runtime/syntax/chicken.vim @evhan
@@ -567,6 +569,7 @@ runtime/syntax/ninja.vim @nico
567569
runtime/syntax/nix.vim @equill
568570
runtime/syntax/nroff.vim @jmarshall
569571
runtime/syntax/nsis.vim @k-takata
572+
runtime/syntax/nu.vim @elkasztano
570573
runtime/syntax/odin.vim @habamax
571574
runtime/syntax/omnimark.vim @kennypete
572575
runtime/syntax/ondir.vim @jparise

Filelist

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -569,6 +569,7 @@ SRC_DOS_UNIX = \
569569

570570
# Source files for MS Windows (also in the extra archive).
571571
SRC_DOS = \
572+
src/auto/nmake/tools.mak \
572573
src/GvimExt/*.mak \
573574
src/GvimExt/GvimExt.reg \
574575
src/GvimExt/Makefile \

README_vim.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,16 @@
1+
<div align="center" markdown="1">
2+
<sup>Special thanks for supporting Vim by donating to the <a href="https://iccf-holland.org/">ICCF</a>:</sup>
3+
<br>
4+
<br>
5+
<a href="https://go.warp.dev/vim">
6+
<img alt="Warp sponsorship" width="400" src="https://raw.githubusercontent.com/warpdotdev/brand-assets/refs/heads/main/Github/Sponsor/Warp-Github-LG-03.png">
7+
</a>
8+
9+
### [Warp, built for coding with multiple AI agents.](https://www.warp.dev/vim)
10+
[Available for MacOS, Linux, & Windows](https://www.warp.dev/vim)<br>
11+
</div>
12+
<hr>
13+
114
# [![Vim The editor](https://github.com/vim/vim/raw/master/runtime/vimlogo.gif)](https://www.vim.org)
215

316
[![Github Build status](https://github.com/vim/vim/workflows/GitHub%20CI/badge.svg)](https://github.com/vim/vim/actions?query=workflow%3A%22GitHub+CI%22)

ci/lychee.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ retries = 2
1717
retry_wait_time = 2
1818

1919
# Timeout per request in seconds
20-
timeout = 20
20+
timeout = 60
2121

2222
############################# Exclusions ##########################
2323

nsis/Make_mvc.mak

Lines changed: 57 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,59 @@
11
#
22
# Makefile for MS Windows for create self-installing exe of Vim.
3-
# 05/04/2024, Restorer restorer@mail2k.ru
3+
# 2024‐04-05, Restorer, restorer@mail2k.ru
44
#
55

66

7-
#!INCLUDE .\Make_all.mak
7+
# included common tools
8+
!INCLUDE ..\src\auto\nmake\tools.mak
9+
10+
# Read MAJOR and MINOR from version.h.
11+
!IFNDEF MAJOR
12+
! IF ![for /F "tokens=3" %G in \
13+
('findstr /RC:"VIM_VERSION_MAJOR[ ^]*[0-9^]" ..\src\version.h') \
14+
do @(echo:MAJOR=%G>> .\_major.tmp)]
15+
! INCLUDE .\_major.tmp
16+
! IF [$(RM) .\_major.tmp]
17+
! ENDIF
18+
! ELSE
19+
MAJOR = 9
20+
! ENDIF
21+
!ENDIF
22+
23+
!IFNDEF MINOR
24+
! IF ![for /F "tokens=3" %G in \
25+
('findstr /RC:"VIM_VERSION_MINOR[ ^]*[0-9^]" ..\src\version.h') \
26+
do @(echo:MINOR=%G>> .\_minor.tmp)]
27+
! INCLUDE .\_minor.tmp
28+
! IF [$(RM) .\_minor.tmp]
29+
! ENDIF
30+
! ELSE
31+
MINOR = 1
32+
! ENDIF
33+
!ENDIF
34+
35+
# Read PATCHLEVEL from version.c
36+
!IFNDEF PATCHLEVEL
37+
! IF ![for /F %G in \
38+
('findstr /NBLC:"static int included_patches" ..\src\version.c \
39+
^| (set /p "_t=" ^& set /a _t+=2 ^)') do \
40+
@$(CMD) $(CMDFLAGS) "for /F "skip=%G delims=, " %H in \
41+
(..\src\version.c) do (echo:PATCHLEVEL=%H> .\_patchlvl.tmp & exit /b)"]
42+
! INCLUDE .\_patchlvl.tmp
43+
! IF [$(RM) .\_patchlvl.tmp]
44+
! ENDIF
45+
! ELSE
46+
PATCHLEVEL = 0
47+
! ENDIF
48+
!ENDIF
49+
50+
!IF $(PATCHLEVEL) < 10
51+
PATCHLEVEL = 000$(PATCHLEVEL)
52+
!ELSEIF $(PATCHLEVEL) < 100
53+
PATCHLEVEL = 00$(PATCHLEVEL)
54+
!ELSEIF $(PATCHLEVEL) < 1000
55+
PATCHLEVEL = 0$(PATCHLEVEL)
56+
!ENDIF
857

958
.SUFFIXES :
1059

@@ -60,65 +109,32 @@ XX = /X"$(X:;=" /X")"
60109

61110
# If necessary, correct the full path of the NSIS compiler in the next line.
62111
# Please do not enclose the path in quotation marks.
63-
MKNSIS = $(ProgFiles)\NSIS
64-
65-
PS = powershell.exe
66-
RM = del /f /q
67-
RD = rmdir /s /q
112+
MKNSIS = $(ProgFiles)\NSIS\makensis.exe
68113

69114
MKNSISFLAGS = /INPUTCHARSET UTF8 $(MKNSISFLAGS)
70-
PSFLAGS = -NoLogo -NoProfile -Command
71-
72-
# Read MAJOR and MINOR from version.h.
73-
!IF ![for /F "tokens=2,3" %G in ( \
74-
'findstr /rc:"VIM_VERSION_MINOR[ ^]*[0-9^]" \
75-
/rc:"VIM_VERSION_MAJOR[ ^]*[0-9^]" ..\src\version.h') do \
76-
@if "VIM_VERSION_MAJOR"=="%G" (echo MAJOR=%H>>_ver.tmp) \
77-
else echo MINOR=%H>>_ver.tmp]
78-
! INCLUDE .\_ver.tmp
79-
! IF [$(RM) .\_ver.tmp]
80-
! ENDIF
81-
!ENDIF
82-
83-
# Read PATCHLEVEL from version.c
84-
!IF ![for /F %G in ( \
85-
'findstr /nblc:"static int included_patches[^]" ..\src\version.c \
86-
^| (set /p "_t=" ^& set /a _t+=2 ^)') do \
87-
@cmd /q /c "for /F "skip=%G delims=, " %H in (..\src\version.c) do \
88-
(echo PATCH=%H>_patchlvl.tmp & exit /b)"]
89-
! INCLUDE .\_patchlvl.tmp
90-
! IF [$(RM) .\_patchlvl.tmp]
91-
! ENDIF
92-
!ENDIF
93-
!IF $(PATCH) < 10
94-
PATCH = 000$(PATCH)
95-
!ELSEIF $(PATCH) < 100
96-
PATCH = 00$(PATCH)
97-
!ELSEIF $(PATCH) < 1000
98-
PATCH = 0$(PATCH)
99-
!ENDIF
100115

101116

102117
all : makeinst
103118

104119
makeinst : prepare
105-
^"$(MKNSIS)\makensis.exe" $(MKNSISFLAGS) gvim.nsi $(XX)
120+
^"$(MKNSIS)" $(MKNSISFLAGS) gvim.nsi $(XX)
106121

107122
prepare : unzipicons gvim_version.nsh license rename
108123

109124
unzipicons : icons.zip
110125
@ if exist %|fF\nul $(RD) %|fF
111126
@ $(PS) $(PSFLAGS) \
112127
Add-Type -AssemblyName 'System.IO.Compression.FileSystem'; \
113-
[System.IO.Compression.ZipFile]::ExtractToDirectory(\"$**\", \".\")
128+
[System.IO.Compression.ZipFile]::ExtractToDirectory(\"$**\", \
129+
\".\")
114130

115131
gvim_version.nsh : Make_mvc.mak
116132
@ 1> $@ echo:^# Generated from Makefile: define the version numbers
117133
@ 1>> $@ echo:^!ifndef __GVIM_VER__NSH__
118134
@ 1>> $@ echo:^!define __GVIM_VER__NSH__
119135
@ 1>> $@ echo:^!define VER_MAJOR $(MAJOR)
120136
@ 1>> $@ echo:^!define VER_MINOR $(MINOR)
121-
@ 1>> $@ echo:^!define PATCHLEVEL $(PATCH)
137+
@ 1>> $@ echo:^!define PATCHLEVEL $(PATCHLEVEL)
122138
@ 1>> $@ echo:^!endif
123139

124140
license : ..\lang\LICENSE.*.txt ..\LICENSE
@@ -135,4 +151,4 @@ clean :
135151
@ if exist .\icons\nul $(RD) .\icons
136152
@ if exist .\gvim??.exe $(RM) .\gvim??.exe
137153

138-
# vim: set noet sw=8 ts=8 sts=0 wm=0 tw=0 ft=make:
154+
# vim: set noet sw=8 ts=8 sts=0 wm=0 tw=79 ft=make:

runtime/autoload/dist/ft.vim

Lines changed: 90 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ vim9script
33
# Vim functions for file type detection
44
#
55
# Maintainer: The Vim Project <https://github.com/vim/vim>
6-
# Last Change: 2025 Jul 09
6+
# Last Change: 2025 Sep 08
77
# Former Maintainer: Bram Moolenaar <Bram@vim.org>
88

99
# These functions are moved here from runtime/filetype.vim to make startup
@@ -441,29 +441,29 @@ export def FTfs()
441441
endif
442442
enddef
443443

444-
# Recursively search for Hare source files in a directory and any
445-
# subdirectories, up to a given depth.
444+
# Recursively searches for Hare source files within a directory, up to a given
445+
# depth.
446446
def IsHareModule(dir: string, depth: number): bool
447-
if depth <= 0
448-
return !empty(glob(dir .. '/*.ha'))
447+
if depth < 1
448+
return false
449+
elseif depth == 1
450+
return !glob(dir .. '/*.ha')->empty()
449451
endif
450452

451-
return reduce(sort(glob(dir .. '/*', true, true),
452-
(a, b) => isdirectory(a) - isdirectory(b)),
453-
(acc, n) => acc
453+
# Check all files in the directory before recursing into subdirectories.
454+
return glob(dir .. '/*', true, true)
455+
->sort((a, b) => isdirectory(a) - isdirectory(b))
456+
->reduce((acc, n) => acc
454457
|| n =~ '\.ha$'
455-
|| isdirectory(n)
456-
&& IsHareModule(n, depth - 1),
458+
|| isdirectory(n) && IsHareModule(n, depth - 1),
457459
false)
458460
enddef
459461

460-
# Determine if a README file exists within a Hare module and should be given the
461-
# Haredoc filetype.
462+
# Determines whether a README file is inside a Hare module and should receive
463+
# the 'haredoc' filetype.
462464
export def FTharedoc()
463-
if exists('g:filetype_haredoc')
464-
if IsHareModule('<afile>:h', get(g:, 'haredoc_search_depth', 1))
465-
setf haredoc
466-
endif
465+
if IsHareModule('<afile>:h', get(g:, 'filetype_haredoc', 1))
466+
setf haredoc
467467
endif
468468
enddef
469469

@@ -599,6 +599,55 @@ export def FTm()
599599
endif
600600
enddef
601601

602+
# For files ending in *.m4, distinguish:
603+
# – *.html.m4 files
604+
# - *fvwm2rc*.m4 files
605+
# – files in the Autoconf M4 dialect
606+
# – files in POSIX M4
607+
export def FTm4()
608+
var fname = expand('%:t')
609+
var path = expand('%:p:h')
610+
611+
if fname =~# 'html\.m4$'
612+
setf htmlm4
613+
return
614+
endif
615+
616+
if fname =~# 'fvwm2rc'
617+
setf fvwm2m4
618+
return
619+
endif
620+
621+
# Canonical Autoconf file
622+
if fname ==# 'aclocal.m4'
623+
setf config
624+
return
625+
endif
626+
627+
# Repo heuristic for Autoconf M4 (nearby configure.ac)
628+
if filereadable(path .. '/../configure.ac') || filereadable(path .. '/configure.ac')
629+
setf config
630+
return
631+
endif
632+
633+
# Content heuristic for Autoconf M4 (scan first ~200 lines)
634+
# Signals:
635+
# - Autoconf macro prefixes: AC_/AM_/AS_/AU_/AT_
636+
var n = 1
637+
var max = min([200, line('$')])
638+
while n <= max
639+
var line = getline(n)
640+
if line =~# '^\s*A[CMSUT]_'
641+
setf config
642+
return
643+
endif
644+
n += 1
645+
endwhile
646+
647+
# Default to POSIX M4
648+
setf m4
649+
enddef
650+
602651
export def FTmake()
603652
# Check if it is a BSD, GNU, or Microsoft Makefile
604653
unlet! b:make_flavor
@@ -779,26 +828,32 @@ export def FTinc()
779828
if exists("g:filetype_inc")
780829
exe "setf " .. g:filetype_inc
781830
else
782-
var lines = getline(1) .. getline(2) .. getline(3)
783-
if lines =~? "perlscript"
784-
setf aspperl
785-
elseif lines =~ "<%"
786-
setf aspvbs
787-
elseif lines =~ "<?"
788-
setf php
789-
# Pascal supports // comments but they're vary rarely used for file
790-
# headers so assume POV-Ray
791-
elseif lines =~ '^\s*\%({\|(\*\)' || lines =~? ft_pascal_keywords
792-
setf pascal
793-
elseif lines =~# '\<\%(require\|inherit\)\>' || lines =~# '[A-Z][A-Za-z0-9_:${}]*\s\+\%(??\|[?:+]\)\?= '
794-
setf bitbake
795-
else
796-
FTasmsyntax()
797-
if exists("b:asmsyntax")
798-
exe "setf " .. fnameescape(b:asmsyntax)
799-
else
800-
setf pov
831+
for lnum in range(1, min([line("$"), 20]))
832+
var line = getline(lnum)
833+
if line =~? "perlscript"
834+
setf aspperl
835+
return
836+
elseif line =~ "<%"
837+
setf aspvbs
838+
return
839+
elseif line =~ "<?"
840+
setf php
841+
return
842+
# Pascal supports // comments but they're vary rarely used for file
843+
# headers so assume POV-Ray
844+
elseif line =~ '^\s*\%({\|(\*\)' || line =~? ft_pascal_keywords
845+
setf pascal
846+
return
847+
elseif line =~# '\<\%(require\|inherit\)\>' || line =~# '[A-Z][A-Za-z0-9_:${}/]*\s\+\%(??\|[?:+.]\)\?=.\? '
848+
setf bitbake
849+
return
801850
endif
851+
endfor
852+
FTasmsyntax()
853+
if exists("b:asmsyntax")
854+
exe "setf " .. fnameescape(b:asmsyntax)
855+
else
856+
setf pov
802857
endif
803858
endif
804859
enddef

runtime/autoload/dist/vim9.vim

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ vim9script
33
# Vim runtime support library
44
#
55
# Maintainer: The Vim Project <https://github.com/vim/vim>
6-
# Last Change: 2025 Jan 29
6+
# Last Change: 2025 Aug 15
77

88
export def IsSafeExecutable(filetype: string, executable: string): bool
99
if empty(exepath(executable))
@@ -121,6 +121,11 @@ def Viewer(): string
121121
enddef
122122

123123
export def Open(file: string)
124+
# disable shellslash for shellescape, required on Windows #17995
125+
if exists('+shellslash') && &shellslash
126+
&shellslash = false
127+
defer setbufvar('%', '&shellslash', true)
128+
endif
124129
Launch($"{Viewer()} {shellescape(file, 1)}")
125130
enddef
126131

0 commit comments

Comments
 (0)