]> git.ipfire.org Git - thirdparty/vim.git/commitdiff
runtime(preproc_indent): Ignore Swapfiles when loading buffers
authorChristian Brabandt <cb@256bit.org>
Thu, 2 Apr 2026 17:52:49 +0000 (17:52 +0000)
committerChristian Brabandt <cb@256bit.org>
Thu, 2 Apr 2026 17:53:30 +0000 (17:53 +0000)
Signed-off-by: Christian Brabandt <cb@256bit.org>
runtime/tools/preproc_indent.vim

index 035ca0e247502b50c070284b7d40a960efb3d5a5..b6d296a61e96bc41ae879756f5e06f225911b45c 100644 (file)
@@ -16,7 +16,7 @@ vim9script
 #   deleted.
 #
 # Author: Hirohito Higashi (@h-east)
-# Last Update: 2026 Jan 12
+# Last Update: 2026 Apr 02
 
 def Get_C_source_files(): list<string>
   var list_of_c_files: list<string> = []
@@ -30,7 +30,7 @@ def Get_C_source_files(): list<string>
 enddef
 
 def FixPreprocessorIndent(fname: string)
-  execute 'edit! ' .. fname
+  execute 'noswapfile edit! ' .. fname
 
   var nest: number = 0
   var indent_offset: number = 0  # -1 if whole-file guard detected