Commit: runtime(preproc_indent): Ignore Swapfiles when loading buffers

2 views
Skip to first unread message

Christian Brabandt

unread,
Apr 2, 2026, 2:02:15 PM (12 hours ago) Apr 2
to vim...@googlegroups.com
runtime(preproc_indent): Ignore Swapfiles when loading buffers

Commit: https://github.com/vim/vim/commit/9d83ca5ca2796680ac90df6332afad2599183b88
Author: Christian Brabandt <c...@256bit.org>
Date: Thu Apr 2 17:52:49 2026 +0000

runtime(preproc_indent): Ignore Swapfiles when loading buffers

Signed-off-by: Christian Brabandt <c...@256bit.org>

diff --git a/runtime/tools/preproc_indent.vim b/runtime/tools/preproc_indent.vim
index 035ca0e24..b6d296a61 100644
--- a/runtime/tools/preproc_indent.vim
+++ b/runtime/tools/preproc_indent.vim
@@ -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
Reply all
Reply to author
Forward
0 new messages