This revision was automatically updated to reflect the committed changes. Closed by commit rG6bf9e88ae4a4: [clang-format] update comments in clang-format.py for python3 compatibility (authored by MyDeveloperDay).
Changed prior to commit: https://reviews.llvm.org/D38446?vs=117280&id=228419#toc Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D38446/new/ https://reviews.llvm.org/D38446 Files: clang/tools/clang-format/clang-format.py Index: clang/tools/clang-format/clang-format.py =================================================================== --- clang/tools/clang-format/clang-format.py +++ clang/tools/clang-format/clang-format.py @@ -2,11 +2,19 @@ # - Change 'binary' if clang-format is not on the path (see below). # - Add to your .vimrc: # -# map <C-I> :pyf <path-to-this-file>/clang-format.py<cr> -# imap <C-I> <c-o>:pyf <path-to-this-file>/clang-format.py<cr> +# if has('python') +# map <C-I> :pyf <path-to-this-file>/clang-format.py<cr> +# imap <C-I> <c-o>:pyf <path-to-this-file>/clang-format.py<cr> +# elseif has('python3') +# map <C-I> :py3f <path-to-this-file>/clang-format.py<cr> +# imap <C-I> <c-o>:py3f <path-to-this-file>/clang-format.py<cr> +# endif # -# The first line enables clang-format for NORMAL and VISUAL mode, the second -# line adds support for INSERT mode. Change "C-I" to another binding if you +# The if-elseif-endif conditional should pick either the python3 or python2 +# integration depending on your vim setup. +# +# The first mapping enables clang-format for NORMAL and VISUAL mode, the second +# mapping adds support for INSERT mode. Change "C-I" to another binding if you # need clang-format on a different key (C-I stands for Ctrl+i). # # With this integration you can press the bound key and clang-format will @@ -20,7 +28,11 @@ # like: # :function FormatFile() # : let l:lines="all" -# : 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 +# : endif # :endfunction # # It operates on the current, potentially unsaved buffer and does not create
Index: clang/tools/clang-format/clang-format.py =================================================================== --- clang/tools/clang-format/clang-format.py +++ clang/tools/clang-format/clang-format.py @@ -2,11 +2,19 @@ # - Change 'binary' if clang-format is not on the path (see below). # - Add to your .vimrc: # -# map <C-I> :pyf <path-to-this-file>/clang-format.py<cr> -# imap <C-I> <c-o>:pyf <path-to-this-file>/clang-format.py<cr> +# if has('python') +# map <C-I> :pyf <path-to-this-file>/clang-format.py<cr> +# imap <C-I> <c-o>:pyf <path-to-this-file>/clang-format.py<cr> +# elseif has('python3') +# map <C-I> :py3f <path-to-this-file>/clang-format.py<cr> +# imap <C-I> <c-o>:py3f <path-to-this-file>/clang-format.py<cr> +# endif # -# The first line enables clang-format for NORMAL and VISUAL mode, the second -# line adds support for INSERT mode. Change "C-I" to another binding if you +# The if-elseif-endif conditional should pick either the python3 or python2 +# integration depending on your vim setup. +# +# The first mapping enables clang-format for NORMAL and VISUAL mode, the second +# mapping adds support for INSERT mode. Change "C-I" to another binding if you # need clang-format on a different key (C-I stands for Ctrl+i). # # With this integration you can press the bound key and clang-format will @@ -20,7 +28,11 @@ # like: # :function FormatFile() # : let l:lines="all" -# : 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 +# : endif # :endfunction # # It operates on the current, potentially unsaved buffer and does not create
_______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits