changeset 32956:32c896b7e001

runtime(solidity): add new ftplugin (#12877) Commit: https://github.com/vim/vim/commit/e34b51e95fd0ea7b0e34a625db0f9ed7e051e0dd Author: dkearns <dougkearns@gmail.com> Date: Wed Aug 23 04:28:42 2023 +1000 runtime(solidity): add new ftplugin (https://github.com/vim/vim/issues/12877) Set undo_{ftplugin,indent} closes #11240 Co-authored-by: cothi <jiungdev@gmail.com>
author Christian Brabandt <cb@256bit.org>
date Tue, 22 Aug 2023 20:30:06 +0200
parents 2cbc8ebb8de5
children a5bd10de6c37
files .github/CODEOWNERS runtime/ftplugin/solidity.vim runtime/indent/solidity.vim runtime/syntax/solidity.vim
diffstat 4 files changed, 32 insertions(+), 10 deletions(-) [+]
line wrap: on
line diff
--- a/.github/CODEOWNERS
+++ b/.github/CODEOWNERS
@@ -210,6 +210,7 @@ runtime/ftplugin/scss.vim		@tpope
 runtime/ftplugin/sdoc.vim		@gpanders
 runtime/ftplugin/sed.vim		@dkearns
 runtime/ftplugin/sh.vim			@dkearns
+runtime/ftplugin/solidity.vim		@cothi
 runtime/ftplugin/solution.vim		@dkearns
 runtime/ftplugin/spec.vim		@ignatenkobrain
 runtime/ftplugin/ssa.vim		@ObserverOfTime
@@ -299,6 +300,7 @@ runtime/indent/sass.vim			@tpope
 runtime/indent/scala.vim		@derekwyatt
 runtime/indent/scss.vim			@tpope
 runtime/indent/sh.vim			@chrisbra
+runtime/indent/solidity.vim		@cothi
 runtime/indent/systemverilog.vim	@Kocha
 runtime/indent/tcl.vim			@dkearns
 runtime/indent/tcsh.vim			@dkearns
@@ -470,6 +472,7 @@ runtime/syntax/sdoc.vim			@gpanders
 runtime/syntax/sed.vim			@dkearns
 runtime/syntax/sh.vim			@cecamp
 runtime/syntax/sm.vim			@cecamp
+runtime/syntax/solidity.vim		@cothi
 runtime/syntax/spec.vim			@ignatenkobrain
 runtime/syntax/sqloracle.vim		@chrisbra
 runtime/syntax/squirrel.vim		@zenmatic
new file mode 100644
--- /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<"
--- 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
--- 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")