]> git.ipfire.org Git - thirdparty/vim.git/commitdiff
runtime(plsql): move fold option from syntax to filetype plugin
authorLee Lindley <lee.lindley@gmail.com>
Sun, 9 Mar 2025 15:25:17 +0000 (16:25 +0100)
committerChristian Brabandt <cb@256bit.org>
Sun, 9 Mar 2025 15:25:17 +0000 (16:25 +0100)
closes: #16838

Co-authored-by: Konfekt <Konfekt@users.noreply.github.com>
Signed-off-by: Lee Lindley <lee.lindley@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
.github/MAINTAINERS
runtime/doc/filetype.txt
runtime/doc/tags
runtime/ftplugin/plsql.vim [new file with mode: 0755]
runtime/syntax/plsql.vim

index f47bbbbce34022bdcdb803b97fc82b0bd9daaa2c..27c52f5ab08d5e6f998e122d54c345a89957ab13 100644 (file)
@@ -250,6 +250,7 @@ runtime/ftplugin/pbtxt.vim          @lakshayg
 runtime/ftplugin/pdf.vim               @tpope
 runtime/ftplugin/perl.vim              @petdance @dkearns
 runtime/ftplugin/php.vim               @dkearns
+runtime/ftplugin/plsql.vim             @lee-lindley
 runtime/ftplugin/pod.vim               @petdance @dkearns
 runtime/ftplugin/poefilter.vim         @ObserverOfTime
 runtime/ftplugin/postscr.vim           @mrdubya
index a2c757fb4118e144abf45edb5456a4a2a1e0f7a0..39402ee24acdbce6747345216d750b9e13624584 100644 (file)
@@ -1,4 +1,4 @@
-*filetype.txt* For Vim version 9.1.  Last change: 2025 Feb 25
+*filetype.txt* For Vim version 9.1.  Last change: 2025 Mar 09
 
 
                  VIM REFERENCE MANUAL    by Bram Moolenaar
@@ -874,6 +874,12 @@ the PDF.  The following are treated as tags:
 
 These maps can be disabled with >
        :let g:no_pdf_maps = 1
+
+PLSQL                                                  *ft-plsql-plugin*
+
+To enable syntax folding in PL/SQL filetypes, set the following variable: >
+
+       :let g:plsql_fold = 1
 <
 
 PYTHON                                         *ft-python-plugin* *PEP8*
index 6aee799d01dc2635634b7200e88b9560609e1c4a..9c6c9e1e69a591b2faf63b186f0e9ca5126c0cb1 100644 (file)
@@ -7419,6 +7419,7 @@ ft-php-syntax     syntax.txt      /*ft-php-syntax*
 ft-php3-syntax syntax.txt      /*ft-php3-syntax*
 ft-phtml-syntax        syntax.txt      /*ft-phtml-syntax*
 ft-plaintex-syntax     syntax.txt      /*ft-plaintex-syntax*
+ft-plsql-plugin        filetype.txt    /*ft-plsql-plugin*
 ft-posix-syntax        syntax.txt      /*ft-posix-syntax*
 ft-postscr-syntax      syntax.txt      /*ft-postscr-syntax*
 ft-ppwiz-syntax        syntax.txt      /*ft-ppwiz-syntax*
diff --git a/runtime/ftplugin/plsql.vim b/runtime/ftplugin/plsql.vim
new file mode 100755 (executable)
index 0000000..7fcc5d7
--- /dev/null
@@ -0,0 +1,17 @@
+" Vim ftplugin file
+" Language: Oracle Procedural SQL (PL/SQL)
+" Maintainer: Lee Lindley (lee dot lindley at gmail dot com)
+" Previous Maintainer: Jeff Lanzarotta (jefflanzarotta at yahoo dot com)
+" Previous Maintainer: C. Laurence Gonsalves (clgonsal@kami.com)
+" URL: https://github.com/lee-lindley/vim_plsql_syntax
+" Last Change: Feb 19, 2025
+" History:  Enno Konfekt move handling of optional syntax folding from syntax
+"               file to ftplugin
+
+if exists("b:did_ftplugin") | finish | endif
+let b:did_ftplugin = 1
+
+if get(g:,"plsql_fold",0) == 1
+    setlocal foldmethod=syntax
+    let b:undo_ftplugin = "setl fdm< "
+endif
index 9b4df09ac79992deea71a6b7a023240b3f05e9bd..7e44e833349e8d0267c693e1a1887ce6a6cdb7a1 100644 (file)
@@ -4,7 +4,7 @@
 " Previous Maintainer: Jeff Lanzarotta (jefflanzarotta at yahoo dot com)
 " Previous Maintainer: C. Laurence Gonsalves (clgonsal@kami.com)
 " URL: https://github.com/lee-lindley/vim_plsql_syntax
-" Last Change: Sep 19, 2022   
+" Last Change: Mar 09, 2025   
 " History  Carsten Czarski (carsten dot czarski at oracle com)
 "               add handling for typical SQL*Plus commands (rem, start, host, set, etc)
 "               add error highlight for non-breaking space
@@ -694,7 +694,6 @@ syn region plsqlSqlPlusCommand  start="^\(SET\|DEFINE\|PROMPT\|ACCEPT\|EXEC\|HOS
 syn region plsqlSqlPlusRunFile  start="^\(@\|@@\)" skip="\\$" end="$" keepend extend
 
 if get(g:,"plsql_fold",0) == 1
-    setlocal foldmethod=syntax
     syn sync fromstart
 
     syn cluster plsqlProcedureGroup contains=plsqlProcedure