Mercurial > vim
view runtime/syntax/opl.vim @ 33872:2c5ae1ce5af2 v9.0.2146
patch 9.0.2146: text-property without type errors when joining
Commit: https://github.com/vim/vim/commit/0d0b3b19517c321b089d637919e88e49a07a3d85
Author: Christian Brabandt <cb@256bit.org>
Date: Sun Dec 3 17:56:43 2023 +0100
patch 9.0.2146: text-property without type errors when joining
Problem: text-property without type errors when joining
Solution: count all text-properties, with or without type
before joining lines
Error when joining lines with text properties without a proper type
When joining lines, we need to consider all text properties that are
attached to a line, even when those text properties are invalid and do
not have a type attached to them.
However, since patch v9.0.0993
(commit: 89469d157aea01513bde826b4519dd6b5fbceae4)
those text properties won't be counted when joining lines and therefore
this will cause the adjustment for text properties on joining to go
wrong (and may later cause SIGABRT with an invalid free pointer)
I am not sure, why the condition to not count text properties with a
valid type was added in patch v9.0.993, because no test fails if those
condition is removed. So let's just remove this condition and add a test
that verifies, that we are able to join lines, even when the text
properties attached to it do not have a valid type.
fixes: #13609
closes: #13614
Signed-off-by: Christian Brabandt <cb@256bit.org>
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Sun, 10 Dec 2023 15:16:11 +0100 |
parents | 46763b01cd9a |
children |
line wrap: on
line source
" Vim syntax file " Language: OPL " Maintainer: Czo <Olivier.Sirol@lip6.fr> " Last Change: 2012 Feb 03 by Thilo Six " $Id: opl.vim,v 1.1 2004/06/13 17:34:11 vimboss Exp $ " Open Psion Language... (EPOC16/EPOC32) " quit when a syntax file was already loaded if exists("b:current_syntax") finish endif let s:cpo_save = &cpo set cpo&vim " case is not significant syn case ignore " A bunch of useful OPL keywords syn keyword OPLStatement proc endp abs acos addr adjustalloc alert alloc app syn keyword OPLStatement append appendsprite asc asin at atan back beep syn keyword OPLStatement begintrans bookmark break busy byref cache syn keyword OPLStatement cachehdr cacherec cachetidy call cancel caption syn keyword OPLStatement changesprite chr$ clearflags close closesprite cls syn keyword OPLStatement cmd$ committrans compact compress const continue syn keyword OPLStatement copy cos count create createsprite cursor syn keyword OPLStatement datetosecs datim$ day dayname$ days daystodate syn keyword OPLStatement dbuttons dcheckbox dchoice ddate declare dedit syn keyword OPLStatement deditmulti defaultwin deg delete dfile dfloat syn keyword OPLStatement dialog diaminit diampos dinit dir$ dlong do dow syn keyword OPLStatement dposition drawsprite dtext dtime dxinput edit else syn keyword OPLStatement elseif enda endif endv endwh entersend entersend0 syn keyword OPLStatement eof erase err err$ errx$ escape eval exist exp ext syn keyword OPLStatement external find findfield findlib first fix$ flags syn keyword OPLStatement flt font freealloc gat gborder gbox gbutton syn keyword OPLStatement gcircle gclock gclose gcls gcolor gcopy gcreate syn keyword OPLStatement gcreatebit gdrawobject gellipse gen$ get get$ syn keyword OPLStatement getcmd$ getdoc$ getevent getevent32 geteventa32 syn keyword OPLStatement geteventc getlibh gfill gfont ggmode ggrey gheight syn keyword OPLStatement gidentity ginfo ginfo32 ginvert giprint glineby syn keyword OPLStatement glineto gloadbit gloadfont global gmove gorder syn keyword OPLStatement goriginx goriginy goto gotomark gpatt gpeekline syn keyword OPLStatement gpoly gprint gprintb gprintclip grank gsavebit syn keyword OPLStatement gscroll gsetpenwidth gsetwin gstyle gtmode gtwidth syn keyword OPLStatement gunloadfont gupdate guse gvisible gwidth gx syn keyword OPLStatement gxborder gxprint gy hex$ hour iabs icon if include syn keyword OPLStatement input insert int intf intrans key key$ keya keyc syn keyword OPLStatement killmark kmod last lclose left$ len lenalloc syn keyword OPLStatement linklib ln loadlib loadm loc local lock log lopen syn keyword OPLStatement lower$ lprint max mcard mcasc mean menu mid$ min syn keyword OPLStatement minit minute mkdir modify month month$ mpopup syn keyword OPLStatement newobj newobjh next notes num$ odbinfo off onerr syn keyword OPLStatement open openr opx os parse$ path pause peek pi syn keyword OPLStatement pointerfilter poke pos position possprite print syn keyword OPLStatement put rad raise randomize realloc recsize rename syn keyword OPLStatement rept$ return right$ rmdir rnd rollback sci$ screen syn keyword OPLStatement screeninfo second secstodate send setdoc setflags syn keyword OPLStatement setname setpath sin space sqr statuswin syn keyword OPLStatement statwininfo std stop style sum tan testevent trap syn keyword OPLStatement type uadd unloadlib unloadm until update upper$ syn keyword OPLStatement use usr usr$ usub val var vector week while year " syn keyword OPLStatement rem syn match OPLNumber "\<\d\+\>" syn match OPLNumber "\<\d\+\.\d*\>" syn match OPLNumber "\.\d\+\>" syn region OPLString start=+"+ end=+"+ syn region OPLComment start="REM[\t ]" end="$" syn match OPLMathsOperator "-\|=\|[:<>+\*^/\\]" " Define the default highlighting. " Only when an item doesn't have highlighting yet hi def link OPLStatement Statement hi def link OPLNumber Number hi def link OPLString String hi def link OPLComment Comment hi def link OPLMathsOperator Conditional " hi def link OPLError Error let b:current_syntax = "opl" let &cpo = s:cpo_save unlet s:cpo_save " vim: ts=8