runtime(solidity): add new ftplugin (#12877)

Commit: 
https://github.com/vim/vim/commit/e34b51e95fd0ea7b0e34a625db0f9ed7e051e0dd
Author: dkearns <[email protected]>
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 <[email protected]>

diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS
index 03c269cf1..213b9af86 100644
--- 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
diff --git a/runtime/ftplugin/solidity.vim b/runtime/ftplugin/solidity.vim
new file mode 100644
index 000000000..abe9f2ff2
--- /dev/null
+++ b/runtime/ftplugin/solidity.vim
@@ -0,0 +1,15 @@
+" Vim filetype plugin file
+" Language:            Solidity
+" Maintainer:          Cothi ([email protected])
+" 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 caed726c0..55a07c015 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 ([email protected])
-" Original Author:     tomlion (https://github.com/tomlion/vim-solidity)
-" Last Changed:        2022 Sep 27
+" Language:            Solidity
+" Maintainer:          Cothi ([email protected])
+" 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 e552446e1..a46d041a1 100644
--- a/runtime/syntax/solidity.vim
+++ b/runtime/syntax/solidity.vim
@@ -1,10 +1,10 @@
 " Vim syntax file
-" Language:            Solidity
-" Maintainer:          Cothi ([email protected])
-" Original Author:     tomlion 
(https://github.com/tomlion/vim-solidity/blob/master/syntax/solidity.vim)
-" Last Changed:        2022 Sep 27
+" Language:            Solidity
+" Maintainer:          Cothi ([email protected])
+" 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")

-- 
-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_dev/E1qYW8k-00DmIq-4N%40256bit.org.

Raspunde prin e-mail lui