From 0b7e1730bcd4c6ec1b55d541bc612445a4ff0c65 Mon Sep 17 00:00:00 2001 From: Christian Clason Date: Wed, 23 Aug 2023 10:09:32 +0900 Subject: [PATCH] vim-patch:e34b51e95fd0 runtime(solidity): add new ftplugin (vim/vim#12877) Set undo_{ftplugin,indent} closes vim/vim#11240 https://github.com/vim/vim/commit/e34b51e95fd0ea7b0e34a625db0f9ed7e051e0dd Co-authored-by: dkearns Co-authored-by: cothi --- runtime/ftplugin/solidity.vim | 15 +++++++++++++++ runtime/indent/solidity.vim | 14 +++++++++----- runtime/syntax/solidity.vim | 10 +++++----- 3 files changed, 29 insertions(+), 10 deletions(-) create mode 100644 runtime/ftplugin/solidity.vim diff --git a/runtime/ftplugin/solidity.vim b/runtime/ftplugin/solidity.vim new file mode 100644 index 0000000000..abe9f2ff26 --- /dev/null +++ b/runtime/ftplugin/solidity.vim @@ -0,0 +1,15 @@ +" Vim filetype plugin file +" Language: Solidity +" Maintainer: Cothi (jiungdev@gmail.com) +" Original Author: tomlion (https://github.com/tomlion/vim-solidity) +" Last Change: 2022 Sep 27 +" 2023 Aug 22 Vim Project (did_ftplugin, undo_ftplugin) + +if exists("b:did_ftplugin") + finish +endif +let b:did_ftplugin = 1 + +setlocal commentstring=//\ %s + +let b:undo_ftplugin = "setlocal commentstring<" diff --git a/runtime/indent/solidity.vim b/runtime/indent/solidity.vim index caed726c0a..55a07c015a 100644 --- a/runtime/indent/solidity.vim +++ b/runtime/indent/solidity.vim @@ -1,9 +1,11 @@ " Vim indent file -" Language: Solidity -" Acknowledgement: Based off of vim-javascript -" Maintainer: Cothi (jiungdev@gmail.com) -" Original Author: tomlion (https://github.com/tomlion/vim-solidity) -" Last Changed: 2022 Sep 27 +" Language: Solidity +" Maintainer: Cothi (jiungdev@gmail.com) +" Original Author: tomlion (https://github.com/tomlion/vim-solidity) +" Last Change: 2022 Sep 27 +" 2023 Aug 22 Vim Project (undo_indent) +" +" Acknowledgement: Based off of vim-javascript " " 0. Initialization {{{1 " ================= @@ -20,6 +22,8 @@ setlocal nosmartindent setlocal indentexpr=GetSolidityIndent() setlocal indentkeys=0{,0},0),0],0\,,!^F,o,O,e +let b:undo_indent = "setlocal indentexpr< indentkeys< smartindent<" + " Only define the function once. if exists("*GetSolidityIndent") finish diff --git a/runtime/syntax/solidity.vim b/runtime/syntax/solidity.vim index e552446e10..a46d041a10 100644 --- a/runtime/syntax/solidity.vim +++ b/runtime/syntax/solidity.vim @@ -1,10 +1,10 @@ " Vim syntax file -" Language: Solidity -" Maintainer: Cothi (jiungdev@gmail.com) -" Original Author: tomlion (https://github.com/tomlion/vim-solidity/blob/master/syntax/solidity.vim) -" Last Changed: 2022 Sep 27 +" Language: Solidity +" Maintainer: Cothi (jiungdev@gmail.com) +" Original Author: tomlion (https://github.com/tomlion/vim-solidity/blob/master/syntax/solidity.vim) +" Last Change: 2022 Sep 27 " -" Additional contributors: +" Contributors: " Modified by thesis (https://github.com/thesis/vim-solidity/blob/main/indent/solidity.vim) if exists("b:current_syntax")