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
This commit is contained in:
Ondřej Súkup 2023-02-17 12:04:17 +00:00 committed by Git OBS Bridge
parent 860d57a7f5
commit 33c1105df9
3 changed files with 66 additions and 0 deletions

59
vim-fix-sh-syntax.patch Normal file
View File

@ -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 <NcampObell@SdrPchip.AorgM-NOSPAM>
" Previous Maintainer: Lennart Schultz <Lennart.Schultz@ecmwf.int>
-" 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=+\%(\\\)\@<!'+ end=+'+ contains=shStringSpecial
syn region shDerefString contained matchgroup=shDerefDelim start=+\%(\\\)\@<!"+ skip=+\\"+ end=+"+ contains=@shDblQuoteList,shStringSpecial

View File

@ -1,3 +1,8 @@
-------------------------------------------------------------------
Fri Feb 17 11:45:06 UTC 2023 - Petr Vorel <pvorel@suse.cz>
- Add patch vim-fix-sh-syntax.patch which fixes broken sh syntax.
-------------------------------------------------------------------
Mon Feb 13 17:22:09 UTC 2023 - Ondřej Súkup <mimi.vx@gmail.com>

View File

@ -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