https://github.com/love1angel created 
https://github.com/llvm/llvm-project/pull/109380

latest vim such as 9.1 remove python and add python3 dependency

>From 1dfa78f2f5f0f873ddc41687158dc48588527035 Mon Sep 17 00:00:00 2001
From: helianthus <45203165+love1an...@users.noreply.github.com>
Date: Fri, 20 Sep 2024 14:18:57 +0800
Subject: [PATCH] Update ClangFormat.rst

pyf not work properly in vim 9.0+
---
 clang/docs/ClangFormat.rst | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/clang/docs/ClangFormat.rst b/clang/docs/ClangFormat.rst
index dbd9c91ae508e5..41e06558e1b45c 100644
--- a/clang/docs/ClangFormat.rst
+++ b/clang/docs/ClangFormat.rst
@@ -198,9 +198,12 @@ your `.vimrc`:
 
   function! Formatonsave()
     let l:formatdiff = 1
-    pyf <path-to-this-file>/clang-format.py
+    if has('python')
+      pyf <path-to-this-file>/clang-format.py
+    elseif has('python3')
+      py3f <path-to-this-file>/clang-format.py
   endfunction
-  autocmd BufWritePre *.h,*.cc,*.cpp call Formatonsave()
+  autocmd BufWritePre *.h,*.cc,*.cpp,*.cppm call Formatonsave()
 
 
 Emacs Integration

_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to