検索を実行し、12000行のファイルで置き換えます。
具体的には、のオカレンスがブロックの^ SetFontSize 28後で^Hide次の^Hideorの前に存在する場合は^Show、に変更28し18ます。
元のファイルからの抜粋です。
Hide # Gear - Endgame
ItemLevel >= 77
Rarity = Magic
LinkedSockets >= 3
BaseType "Runic Hatchet"
SetTextColor 140 190 255 # Magic Item Highlight
SetFontSize 28
Hide # Gear - Endgame
ItemLevel >= 77
Rarity = Magic
Sockets >= 3
BaseType "Runic Hatchet"
SetTextColor 140 190 255 # Magic Item Highlight
SetFontSize 28
Show # Gear - Endgame
ItemLevel >= 83
Rarity = Normal
Sockets < 3
BaseType "Tiger Hook"
SetTextColor 240 240 240 # Normal Item Highlight
SetBackgroundColor 70 70 70
SetFontSize 28
いずれかのHideブロックの最終結果は次のようになります。
Hide # Gear - Endgame
ItemLevel >= 77
Rarity = Magic
LinkedSockets >= 3
BaseType "Runic Hatchet"
SetTextColor 140 190 255 # Magic Item Highlight
SetFontSize 18
交換SetFontSize 28するSetFontSize 18が、それはに表示されている場合にのみ^Hideブロック。
私が試した厄介な正規表現は:
:%s/^Hide\(.*\)SetFontSize 28$/Hide\1SetFontSize 18/g
しかし、パターンが見つからないと言われました。追加の情報が必要な場合や、リクエストが不明確な場合はお知らせください。
whatever be the valueは問題を引き起こします。ソリューションは、すべてのHideブロックにSetFontSize行があり、その値が正確28にある場合にのみ機能します。それ以外の場合、28別のブロックまで一致します。
HideブロックにSetFontSize線がありますか(値は何であっても)?もしそうなら、あなたは使うことができます:%s/Hide\_.\{-\}SetFontSize \zs28/18/