view runtime/syntax/poefilter.vim @ 35308:22c03485f222 v9.1.0456

patch 9.1.0456: Left shift is incorrect with vartabstop and shiftwidth=0 Commit: https://github.com/vim/vim/commit/88d4f255b7b7a19bb4f6489e0ad0956e47d51fed Author: Gary Johnson <garyjohn@spocom.com> Date: Sat Jun 1 20:51:33 2024 +0200 patch 9.1.0456: Left shift is incorrect with vartabstop and shiftwidth=0 Problem: Left shift is incorrect with vartabstop and shiftwidth=0 Solution: make tabstop_at() function aware of shift direction (Gary Johnson) The problem was that with 'vartabstop' set and 'shiftwidth' equal 0, left shifts using << were shifting the line to the wrong column. The tabstop to the right of the first character in the line was being used as the shift amount instead of the tabstop to the left of that first character. The reason was that the tabstop_at() function always returned the value of the tabstop to the right of the given column and was not accounting for the direction of the shift. The solution was to make tabstop_at() aware of the direction of the shift and to choose the tabtop accordingly. A test was added to check this behavior and make sure it doesn't regress. While at it, also fix a few indentation/alignment issues. fixes: #14864 closes: #14887 Signed-off-by: Gary Johnson <garyjohn@spocom.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
author Christian Brabandt <cb@256bit.org>
date Sat, 01 Jun 2024 21:00:03 +0200
parents a9b5ffbc0428
children
line wrap: on
line source

" Vim syntax file
" Language:	PoE item filter
" Maintainer:	ObserverOfTime <chronobserver@disroot.org>
" Filenames:	*.filter
" Last Change:	2023 Feb 10

if exists('b:current_syntax')
    finish
endif

let s:cpo_save = &cpoptions
set cpoptions&vim

" Comment
syn keyword poefilterTodo TODO NOTE XXX contained
syn match poefilterCommentTag /\[[0-9A-Z\[\]]\+\]/ contained
syn match poefilterComment /#.*$/ contains=poefilterTodo,poefilterCommentTag,@Spell

" Blocks
syn keyword poefilterBlock Show Hide Minimal

" Conditions
syn keyword poefilterCondition
            \ AlternateQuality
            \ AnyEnchantment
            \ BlightedMap
            \ Corrupted
            \ ElderItem
            \ ElderMap
            \ FracturedItem
            \ Identified
            \ Mirrored
            \ Replica
            \ Scourged
            \ ShapedMap
            \ ShaperItem
            \ SynthesisedItem
            \ UberBlightedMap
            \ skipwhite nextgroup=poefilterBoolean
syn keyword poefilterCondition
            \ ArchnemesisMod
            \ BaseType
            \ Class
            \ EnchantmentPassiveNode
            \ HasEnchantment
            \ HasExplicitMod
            \ ItemLevel
            \ SocketGroup
            \ Sockets
            \ skipwhite nextgroup=poefilterOperator,poefilterString
syn keyword poefilterCondition
            \ AreaLevel
            \ BaseArmour
            \ BaseDefencePercentile
            \ BaseEnergyShield
            \ BaseEvasion
            \ BaseWard
            \ CorruptedMods
            \ DropLevel
            \ EnchantmentPassiveNum
            \ GemLevel
            \ HasEaterOfWorldsImplicit
            \ HasSearingExarchImplicit
            \ Height
            \ LinkedSockets
            \ MapTier
            \ Quality
            \ StackSize
            \ Width
            \ skipwhite nextgroup=poefilterOperator,poefilterNumber
syn keyword poefilterCondition
            \ GemQualityType
            \ skipwhite nextgroup=poefilterString,poefilterQuality
syn keyword poefilterCondition
            \ HasInfluence
            \ skipwhite nextgroup=poefilterString,poefilterInfluence
syn keyword poefilterCondition
            \ Rarity
            \ skipwhite nextgroup=poefilterString,poefilterRarity

" Actions
syn keyword poefilterAction
            \ PlayAlertSound
            \ PlayAlertSoundPositional
            \ skipwhite nextgroup=poefilterNumber,poefilterDisable
syn keyword poefilterAction
            \ CustomAlertSound
            \ CustomAlertSoundOptional
            \ skipwhite nextgroup=poefilterString
syn keyword poefilterAction
            \ DisableDropSound
            \ EnableDropSound
            \ DisableDropSoundIfAlertSound
            \ EnableDropSoundIfAlertSound
            \ skipwhite nextgroup=poefilterBoolean
syn keyword poefilterAction
            \ MinimapIcon
            \ SetBackgroundColor
            \ SetBorderColor
            \ SetFontSize
            \ SetTextColor
            \ skipwhite nextgroup=poefilterNumber
syn keyword poefilterAction
            \ PlayEffect
            \ skipwhite nextgroup=poefilterColour

" Operators
syn match poefilterOperator /!\|[<>=]=\?/ contained
            \ skipwhite nextgroup=poefilterString,poefilterNumber,
            \ poefilterQuality,poefilterRarity,poefilterInfluence

" Arguments
syn match poefilterString /[-a-zA-Z0-9:,']/ contained contains=@Spell
            \ skipwhite nextgroup=poefilterString,poefilterNumber,
            \ poefilterQuality,poefilterRarity,poefilterInfluence
syn region poefilterString matchgroup=poefilterQuote keepend
            \ start=/"/ end=/"/ concealends contained contains=@Spell
            \ skipwhite nextgroup=poefilterString,poefilterNumber,
            \ poefilterQuality,poefilterRarity,poefilterInfluence
syn match poefilterNumber /-1\|0\|[1-9][0-9]*/ contained
            \ skipwhite nextgroup=poefilterString,poefilterNumber,
            \ poefilterQuality,poefilterRarity,poefilterInfluence,poefilterColour
syn keyword poefilterBoolean True False contained

" Special arguments (conditions)
syn keyword poefilterQuality Superior Divergent Anomalous Phantasmal
            \ contained skipwhite nextgroup=poefilterString,poefilterQuality
syn keyword poefilterRarity Normal Magic Rare Unique
            \ contained skipwhite nextgroup=poefilterString,poefilterRarity
syn keyword poefilterInfluence Shaper Elder
            \ Crusader Hunter Redeemer Warlord None
            \ contained skipwhite nextgroup=poefilterString,poefilterInfluence

" Special arguments (actions)
syn keyword poefilterColour Red Green Blue Brown
            \ White Yellow Cyan Grey Orange Pink Purple
            \ contained skipwhite nextgroup=poefilterShape,poefilterTemp
syn keyword poefilterShape Circle Diamond Hecagon Square Star Triangle
            \ Cross Moon Raindrop Kite Pentagon UpsideDownHouse contained
syn keyword poefilterDisable None contained
syn keyword poefilterTemp Temp contained

" Colours

hi def link poefilterAction Statement
hi def link poefilterBlock Structure
hi def link poefilterBoolean Boolean
hi def link poefilterColour Special
hi def link poefilterComment Comment
hi def link poefilterCommentTag SpecialComment
hi def link poefilterCondition Conditional
hi def link poefilterDisable Constant
hi def link poefilterInfluence Special
hi def link poefilterNumber Number
hi def link poefilterOperator Operator
hi def link poefilterQuality Special
hi def link poefilterQuote Delimiter
hi def link poefilterRarity Special
hi def link poefilterShape Special
hi def link poefilterString String
hi def link poefilterTemp StorageClass
hi def link poefilterTodo Todo

let b:current_syntax = 'poefilter'

let &cpoptions = s:cpo_save
unlet s:cpo_save