Skip to content

Commit

Permalink
Update emacs ignore patterns (#5903)
Browse files Browse the repository at this point in the history
Currently the emacs ignore patterns include `**/.#*` (lock files), but
doesn't include `**/#*#` (autosave files;
https://www.emacswiki.org/emacs/AutoSave, not to be confused with
`**/*~` backup files which are ignored.)

Add autosave files.
  • Loading branch information
person142 committed Jul 26, 2022
1 parent 36ff34c commit 1e8fa55
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion internal/ignore/ephemeral.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ var EphemeralPathMatcher = initEphemeralPathMatcher()

func initEphemeralPathMatcher() model.PathMatcher {
golandPatterns := []string{"**/*___jb_old___", "**/*___jb_tmp___", "**/.idea/**"}
emacsPatterns := []string{"**/.#*"}
emacsPatterns := []string{"**/.#*", "**/#*#"}
// if .swp is taken (presumably because multiple vims are running in that dir),
// vim will go with .swo, .swn, etc, and then even .svz, .svy!
// https://github.com/vim/vim/blob/ea781459b9617aa47335061fcc78403495260315/src/memline.c#L5076
Expand Down
6 changes: 6 additions & 0 deletions internal/ignore/path_matcher_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,12 @@ func TestIgnores(t *testing.T) {
ignoreInBuildContext: false,
ignoreInFileChange: true,
},
{
target: target,
change: "dir/#my-machine#",
ignoreInBuildContext: false,
ignoreInFileChange: true,
},
}

for i, c := range cases {
Expand Down

0 comments on commit 1e8fa55

Please sign in to comment.