From 33c1105df92184412143abb4b1d69e18665f3c6a2c41d3854c6176ff1b1cfbe6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20S=C3=BAkup?= Date: Fri, 17 Feb 2023 12:04:17 +0000 Subject: [PATCH] Accepting request 1066368 from home:pevik:branches:editors - Add patch vim-fix-sh-syntax.patch which fixes broken sh syntax. OBS-URL: https://build.opensuse.org/request/show/1066368 OBS-URL: https://build.opensuse.org/package/show/editors/vim?expand=0&rev=784 --- vim-fix-sh-syntax.patch | 59 +++++++++++++++++++++++++++++++++++++++++ vim.changes | 5 ++++ vim.spec | 2 ++ 3 files changed, 66 insertions(+) create mode 100644 vim-fix-sh-syntax.patch diff --git a/vim-fix-sh-syntax.patch b/vim-fix-sh-syntax.patch new file mode 100644 index 0000000..dd6f327 --- /dev/null +++ b/vim-fix-sh-syntax.patch @@ -0,0 +1,59 @@ +# sh/bash highlight broken since upgrade of sh.vim version 205 +# => upgrade to version 207 which fixes it +# https://github.com/vim/vim/issues/11937#issuecomment-1421116531 +# http://www.drchip.org/astronaut/vim/syntax/sh.vim.gz +--- vim-9.0.1307/runtime/syntax/sh.vim 2023-02-13 17:10:04.000000000 +0100 ++++ /usr/share/vim/vim90/syntax/sh.vim 2023-02-17 12:19:44.967178736 +0100 +@@ -2,8 +2,8 @@ + " Language: shell (sh) Korn shell (ksh) bash (sh) + " Maintainer: Charles E. Campbell + " Previous Maintainer: Lennart Schultz +-" Last Change: Dec 20, 2022 +-" Version: 205 ++" Last Change: Feb 11, 2023 ++" Version: 207 + " URL: http://www.drchip.org/astronaut/vim/index.html#SYNTAX_SH + " For options and settings, please use: :help ft-sh-syntax + " This file includes many ideas from Eric Brunet (eric.brunet@ens.fr) and heredoc fixes from Felipe Contreras +@@ -166,7 +166,7 @@ + syn cluster shLoopoList add=shForPP + endif + syn cluster shPPSLeftList contains=shAlias,shArithmetic,shCmdParenRegion,shCommandSub,shCtrlSeq,shDeref,shDerefSimple,shDoubleQuote,shEcho,shEscape,shExDoubleQuote,shExpr,shExSingleQuote,shHereDoc,shNumber,shOperator,shOption,shPosnParm,shHereString,shRedir,shSingleQuote,shSpecial,shStatement,shSubSh,shTest,shVariable +-syn cluster shPPSRightList contains=shComment,shDeref,shDerefSimple,shEscape,shPosnParm ++syn cluster shPPSRightList contains=shDeref,shDerefSimple,shEscape,shPosnParm + syn cluster shSubShList contains=@shCommandSubList,shCommandSubBQ,shCaseEsac,shColon,shCommandSub,shComment,shDo,shEcho,shExpr,shFor,shIf,shHereString,shRedir,shSetList,shSource,shStatement,shVariable,shCtrlSeq,shOperator + syn cluster shTestList contains=shArithmetic,shCharClass,shCommandSub,shCommandSubBQ,shCtrlSeq,shDeref,shDerefSimple,shDoubleQuote,shSpecialDQ,shExDoubleQuote,shExpr,shExSingleQuote,shNumber,shOperator,shSingleQuote,shTest,shTestOpr + syn cluster shNoZSList contains=shSpecialNoZS +@@ -335,7 +335,7 @@ + " systems too, however, so the following syntax will flag $(..) as + " an Error under /bin/sh. By consensus of vimdev'ers! + if exists("b:is_kornshell") || exists("b:is_bash") || exists("b:is_posix") +- syn region shCommandSub matchgroup=shCmdSubRegion start="\$(\ze[^(]\|$" skip='\\\\\|\\.' end=")" contains=@shCommandSubList ++ syn region shCommandSub matchgroup=shCmdSubRegion start="\$(\ze[^(]" skip='\\\\\|\\.' end=")" contains=@shCommandSubList + syn region shArithmetic matchgroup=shArithRegion start="\$((" skip='\\\\\|\\.' end="))" contains=@shArithList + syn region shArithmetic matchgroup=shArithRegion start="\$\[" skip='\\\\\|\\.' end="\]" contains=@shArithList + syn match shSkipInitWS contained "^\s\+" +@@ -503,7 +503,6 @@ + " ksh: ${.sh.*} variables: {{{1 + " ======================================== + if exists("b:is_kornshell") +-" syn match shDerefVar contained "[.]*" nextgroup=@shDerefVarList + syn match shDerefVar contained "\.\+" nextgroup=@shDerefVarList + endif + +@@ -548,6 +547,7 @@ + " bash : ${parameter,pattern} Case modification + " bash : ${parameter,,pattern} Case modification + " bash : ${@:start:qty} display command line arguments from start to start+qty-1 (inferred) ++" bash : ${parameter@operator} transforms parameter (operator∈[uULqEPARa]) + syn cluster shDerefPatternList contains=shDerefPattern,shDerefString + if !exists("g:sh_no_error") + syn match shDerefOpError contained ":[[:punct:]]" +@@ -563,6 +563,7 @@ + endif + if exists("b:is_bash") + syn match shDerefOp contained "[,^]\{1,2}" nextgroup=@shDerefPatternList ++ syn match shDerefOp contained "@[uULQEPAKa]" + endif + syn region shDerefString contained matchgroup=shDerefDelim start=+\%(\\\)\@ + +- Add patch vim-fix-sh-syntax.patch which fixes broken sh syntax. + ------------------------------------------------------------------- Mon Feb 13 17:22:09 UTC 2023 - Ondřej Súkup diff --git a/vim.spec b/vim.spec index cbe7992..484996c 100644 --- a/vim.spec +++ b/vim.spec @@ -78,6 +78,7 @@ Patch101: vim-8.0.1568-defaults.patch # https://github.com/vim/vim/issues/3348 - problem more probadly in buildenv than in test Patch102: vim-8.1.0297-dump3.patch Patch104: vim-8.2.2411-globalvimrc.patch +Patch105: vim-fix-sh-syntax.patch BuildRequires: autoconf BuildRequires: db-devel BuildRequires: fdupes @@ -216,6 +217,7 @@ cp %{SOURCE23} runtime/syntax/apparmor.vim %patch101 -p1 %patch102 -p1 %patch104 -p1 +%patch105 -p1 cp %{SOURCE3} %{SOURCE4} %{SOURCE5} %{SOURCE8} %{SOURCE10} . # Unreliable tests