Skip to content

Commit 12916b7

Browse files
landismmilas
authored andcommitted
tilt: ignore a few more vim swap files (docker#2190)
1 parent e3948f6 commit 12916b7

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

pkg/watch/ephemeral.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,12 @@ var ephemeralPathMatcher = initEphemeralPathMatcher()
1919
func initEphemeralPathMatcher() model.PathMatcher {
2020
golandPatterns := []string{"**/*___jb_old___", "**/*___jb_tmp___", "**/.idea/**"}
2121
emacsPatterns := []string{"**/.#*"}
22-
vimPatterns := []string{"**/4913", "**/*~", "**/.*.swp", "**/.*.swx"}
22+
// if .swp is taken (presumably because multiple vims are running in that dir),
23+
// vim will go with .swo, .swn, etc, and then even .svz, .svy!
24+
// https://github.com/vim/vim/blob/ea781459b9617aa47335061fcc78403495260315/src/memline.c#L5076
25+
// ignoring .sw? seems dangerous, since things like .swf or .swi exist, but ignoring the first few
26+
// seems safe and should catch most cases
27+
vimPatterns := []string{"**/4913", "**/*~", "**/.*.swp", "**/.*.swx", "**/.*.swo", "**/.*.swn"}
2328

2429
allPatterns := []string{}
2530
allPatterns = append(allPatterns, golandPatterns...)

0 commit comments

Comments
 (0)