diff options
-rw-r--r-- | .github/workflows/backport.yml | 11 | ||||
-rw-r--r-- | .github/workflows/labeler_pr.yml | 19 | ||||
-rw-r--r-- | runtime/syntax/mysql.vim | 314 | ||||
-rw-r--r-- | runtime/syntax/yaml.vim | 2 | ||||
-rw-r--r-- | src/nvim/extmark.c | 22 | ||||
-rw-r--r-- | test/functional/api/extmark_spec.lua | 33 |
6 files changed, 215 insertions, 186 deletions
diff --git a/.github/workflows/backport.yml b/.github/workflows/backport.yml index de62ffb59d..0c3ba6be34 100644 --- a/.github/workflows/backport.yml +++ b/.github/workflows/backport.yml @@ -26,14 +26,3 @@ jobs: pull_title: "${pull_title}" label_pattern: "^ci:backport ([^ ]+)$" github_token: ${{ steps.app-token.outputs.token }} - - - if: ${{steps.backport.outputs.was_successful == 'true'}} - uses: actions/github-script@v7 - with: - script: | - github.rest.issues.addLabels({ - issue_number: ${{steps.backport.outputs.created_pull_numbers}}, - owner: context.repo.owner, - repo: context.repo.repo, - labels: ['target:release'] - }) diff --git a/.github/workflows/labeler_pr.yml b/.github/workflows/labeler_pr.yml index 8fd93bfb6d..5d402c3c03 100644 --- a/.github/workflows/labeler_pr.yml +++ b/.github/workflows/labeler_pr.yml @@ -33,8 +33,25 @@ jobs: - name: "Extract if the PR is a breaking change and add it as label" run: gh pr edit "$PR_NUMBER" --add-label "$(echo "$PR_TITLE" | sed -E 's|[[:alpha:]]+(\(.*\))?!:.*|breaking-change|')" || true - request-reviewer: + target-release: needs: ["changed-files", "type-scope"] + runs-on: ubuntu-latest + permissions: + pull-requests: write + steps: + - if: startsWith(github.base_ref, 'release') + uses: actions/github-script@v7 + with: + script: | + github.rest.issues.addLabels({ + issue_number: context.issue.number, + owner: context.repo.owner, + repo: context.repo.repo, + labels: ['target:release'] + }) + + request-reviewer: + needs: ["changed-files", "type-scope", "target-release"] permissions: pull-requests: write uses: ./.github/workflows/reviewers_add.yml diff --git a/runtime/syntax/mysql.vim b/runtime/syntax/mysql.vim index 8bd7b6459a..49b53313c9 100644 --- a/runtime/syntax/mysql.vim +++ b/runtime/syntax/mysql.vim @@ -1,10 +1,13 @@ " Vim syntax file " Language: mysql " Maintainer: Kenneth J. Pronovici <pronovic@ieee.org> -" Last Change: $LastChangedDate: 2016-04-11 10:31:04 -0500 (Mon, 11 Apr 2016) $ " Filenames: *.mysql -" URL: ftp://cedar-solutions.com/software/mysql.vim -" Note: The definitions below are taken from the mysql user manual as of April 2002, for version 3.23 +" URL: ftp://cedar-solutions.com/software/mysql.vim (https://github.com/pronovic/vim-syntax/blob/master/mysql.vim) +" Note: The definitions below are taken from the mysql user manual as of April 2002, for version 3.23 and have been updated +" in July 2024 with the docs for version 8.4 +" Last Change: 2016 Apr 11 +" 2024-07-21: update MySQL functions as of MySQL 8.4 (by Vim Project) +" " quit when a syntax file was already loaded if exists("b:current_syntax") @@ -92,23 +95,23 @@ syn keyword mysqlType tinytext mediumtext longtext text syn keyword mysqlType tinyblob mediumblob longblob blob syn region mysqlType start="float\W" end="."me=s-1 syn region mysqlType start="float$" end="."me=s-1 -syn region mysqlType start="float(" end=")" contains=mysqlNumber,mysqlVariable +syn region mysqlType start="\<float(" end=")" contains=mysqlNumber,mysqlVariable syn region mysqlType start="double\W" end="."me=s-1 syn region mysqlType start="double$" end="."me=s-1 -syn region mysqlType start="double(" end=")" contains=mysqlNumber,mysqlVariable +syn region mysqlType start="\<double(" end=")" contains=mysqlNumber,mysqlVariable syn region mysqlType start="double precision\W" end="."me=s-1 syn region mysqlType start="double precision$" end="."me=s-1 syn region mysqlType start="double precision(" end=")" contains=mysqlNumber,mysqlVariable syn region mysqlType start="real\W" end="."me=s-1 syn region mysqlType start="real$" end="."me=s-1 -syn region mysqlType start="real(" end=")" contains=mysqlNumber,mysqlVariable -syn region mysqlType start="numeric(" end=")" contains=mysqlNumber,mysqlVariable +syn region mysqlType start="\<real(" end=")" contains=mysqlNumber,mysqlVariable +syn region mysqlType start="\<numeric(" end=")" contains=mysqlNumber,mysqlVariable syn region mysqlType start="dec\W" end="."me=s-1 syn region mysqlType start="dec$" end="."me=s-1 -syn region mysqlType start="dec(" end=")" contains=mysqlNumber,mysqlVariable +syn region mysqlType start="\<dec(" end=")" contains=mysqlNumber,mysqlVariable syn region mysqlType start="decimal\W" end="."me=s-1 syn region mysqlType start="decimal$" end="."me=s-1 -syn region mysqlType start="decimal(" end=")" contains=mysqlNumber,mysqlVariable +syn region mysqlType start="\<decimal(" end=")" contains=mysqlNumber,mysqlVariable syn region mysqlType start="\Wtimestamp\W" end="."me=s-1 syn region mysqlType start="\Wtimestamp$" end="."me=s-1 syn region mysqlType start="\Wtimestamp(" end=")" contains=mysqlNumber,mysqlVariable @@ -117,25 +120,42 @@ syn region mysqlType start="^timestamp$" end="."me=s-1 syn region mysqlType start="^timestamp(" end=")" contains=mysqlNumber,mysqlVariable syn region mysqlType start="\Wyear(" end=")" contains=mysqlNumber,mysqlVariable syn region mysqlType start="^year(" end=")" contains=mysqlNumber,mysqlVariable -syn region mysqlType start="char(" end=")" contains=mysqlNumber,mysqlVariable -syn region mysqlType start="varchar(" end=")" contains=mysqlNumber,mysqlVariable -syn region mysqlType start="enum(" end=")" contains=mysqlString,mysqlVariable +syn region mysqlType start="\<char(" end=")" contains=mysqlNumber,mysqlVariable +syn region mysqlType start="\<varchar(" end=")" contains=mysqlNumber,mysqlVariable +syn region mysqlType start="\<enum(" end=")" contains=mysqlString,mysqlVariable syn region mysqlType start="\Wset(" end=")" contains=mysqlString,mysqlVariable syn region mysqlType start="^set(" end=")" contains=mysqlString,mysqlVariable " Logical, string and numeric operators syn keyword mysqlOperator between not and or is in like regexp rlike binary exists -syn region mysqlOperator start="isnull(" end=")" contains=ALL -syn region mysqlOperator start="coalesce(" end=")" contains=ALL -syn region mysqlOperator start="interval(" end=")" contains=ALL +syn region mysqlOperatorFunction start="\<isnull(" end=")" contains=ALL +syn region mysqlOperatorFunction start="\<coalesce(" end=")" contains=ALL +syn region mysqlOperatorFunction start="\<interval(" end=")" contains=ALL -" Control flow functions -syn keyword mysqlFlow case when then else end -syn region mysqlFlow start="ifnull(" end=")" contains=ALL -syn region mysqlFlow start="nullif(" end=")" contains=ALL -syn region mysqlFlow start="if(" end=")" contains=ALL +" Flow control functions +" https://docs.oracle.com/cd/E17952_01/mysql-8.4-en/flow-control-functions.html +syn keyword mysqlFlowLabel case when then else end +syn region mysqlFlowFunction start="\<ifnull(" end=")" contains=ALL +syn region mysqlFlowFunction start="\<nullif(" end=")" contains=ALL +syn region mysqlFlowFunction start="\<if(" end=")" contains=ALL -" General Functions +" Window functions +" https://docs.oracle.com/cd/E17952_01/mysql-8.4-en/window-functions-usage.html +syn keyword mysqlWindowKeyword over partition window +" https://docs.oracle.com/cd/E17952_01/mysql-8.4-en/window-function-descriptions.html +syn region mysqlWindowFunction start="\<cume_dist(" end=")" contains=ALL +syn region mysqlWindowFunction start="\<dense_rank(" end=")" contains=ALL +syn region mysqlWindowFunction start="\<first_value(" end=")" contains=ALL +syn region mysqlWindowFunction start="\<lag(" end=")" contains=ALL +syn region mysqlWindowFunction start="\<last_value(" end=")" contains=ALL +syn region mysqlWindowFunction start="\<lead(" end=")" contains=ALL +syn region mysqlWindowFunction start="\<nth_value(" end=")" contains=ALL +syn region mysqlWindowFunction start="\<ntile(" end=")" contains=ALL +syn region mysqlWindowFunction start="\<percent_rank(" end=")" contains=ALL +syn region mysqlWindowFunction start="\<rank(" end=")" contains=ALL +syn region mysqlWindowFunction start="\<row_number(" end=")" contains=ALL + +" General functions " " I'm leery of just defining keywords for functions, since according to the MySQL manual: " @@ -147,140 +167,144 @@ syn region mysqlFlow start="if(" end=")" contains=ALL " region to define them, not just a keyword. This will probably cause the syntax file " to load more slowly, but at least it will be 'correct'. -syn region mysqlFunction start="abs(" end=")" contains=ALL -syn region mysqlFunction start="acos(" end=")" contains=ALL -syn region mysqlFunction start="adddate(" end=")" contains=ALL -syn region mysqlFunction start="ascii(" end=")" contains=ALL -syn region mysqlFunction start="asin(" end=")" contains=ALL -syn region mysqlFunction start="atan(" end=")" contains=ALL -syn region mysqlFunction start="atan2(" end=")" contains=ALL -syn region mysqlFunction start="avg(" end=")" contains=ALL -syn region mysqlFunction start="benchmark(" end=")" contains=ALL -syn region mysqlFunction start="bin(" end=")" contains=ALL -syn region mysqlFunction start="bit_and(" end=")" contains=ALL -syn region mysqlFunction start="bit_count(" end=")" contains=ALL -syn region mysqlFunction start="bit_or(" end=")" contains=ALL -syn region mysqlFunction start="ceiling(" end=")" contains=ALL -syn region mysqlFunction start="character_length(" end=")" contains=ALL -syn region mysqlFunction start="char_length(" end=")" contains=ALL -syn region mysqlFunction start="concat(" end=")" contains=ALL -syn region mysqlFunction start="concat_ws(" end=")" contains=ALL -syn region mysqlFunction start="connection_id(" end=")" contains=ALL -syn region mysqlFunction start="conv(" end=")" contains=ALL -syn region mysqlFunction start="cos(" end=")" contains=ALL -syn region mysqlFunction start="cot(" end=")" contains=ALL -syn region mysqlFunction start="count(" end=")" contains=ALL -syn region mysqlFunction start="curdate(" end=")" contains=ALL -syn region mysqlFunction start="curtime(" end=")" contains=ALL -syn region mysqlFunction start="date_add(" end=")" contains=ALL -syn region mysqlFunction start="date_format(" end=")" contains=ALL -syn region mysqlFunction start="date_sub(" end=")" contains=ALL -syn region mysqlFunction start="dayname(" end=")" contains=ALL -syn region mysqlFunction start="dayofmonth(" end=")" contains=ALL -syn region mysqlFunction start="dayofweek(" end=")" contains=ALL -syn region mysqlFunction start="dayofyear(" end=")" contains=ALL -syn region mysqlFunction start="decode(" end=")" contains=ALL -syn region mysqlFunction start="degrees(" end=")" contains=ALL -syn region mysqlFunction start="elt(" end=")" contains=ALL -syn region mysqlFunction start="encode(" end=")" contains=ALL -syn region mysqlFunction start="encrypt(" end=")" contains=ALL -syn region mysqlFunction start="exp(" end=")" contains=ALL -syn region mysqlFunction start="export_set(" end=")" contains=ALL -syn region mysqlFunction start="extract(" end=")" contains=ALL -syn region mysqlFunction start="field(" end=")" contains=ALL -syn region mysqlFunction start="find_in_set(" end=")" contains=ALL -syn region mysqlFunction start="floor(" end=")" contains=ALL -syn region mysqlFunction start="format(" end=")" contains=ALL -syn region mysqlFunction start="from_days(" end=")" contains=ALL -syn region mysqlFunction start="from_unixtime(" end=")" contains=ALL -syn region mysqlFunction start="get_lock(" end=")" contains=ALL -syn region mysqlFunction start="greatest(" end=")" contains=ALL -syn region mysqlFunction start="group_unique_users(" end=")" contains=ALL -syn region mysqlFunction start="hex(" end=")" contains=ALL -syn region mysqlFunction start="inet_aton(" end=")" contains=ALL -syn region mysqlFunction start="inet_ntoa(" end=")" contains=ALL -syn region mysqlFunction start="instr(" end=")" contains=ALL -syn region mysqlFunction start="lcase(" end=")" contains=ALL -syn region mysqlFunction start="least(" end=")" contains=ALL -syn region mysqlFunction start="length(" end=")" contains=ALL -syn region mysqlFunction start="load_file(" end=")" contains=ALL -syn region mysqlFunction start="locate(" end=")" contains=ALL -syn region mysqlFunction start="log(" end=")" contains=ALL -syn region mysqlFunction start="log10(" end=")" contains=ALL -syn region mysqlFunction start="lower(" end=")" contains=ALL -syn region mysqlFunction start="lpad(" end=")" contains=ALL -syn region mysqlFunction start="ltrim(" end=")" contains=ALL -syn region mysqlFunction start="make_set(" end=")" contains=ALL -syn region mysqlFunction start="master_pos_wait(" end=")" contains=ALL -syn region mysqlFunction start="max(" end=")" contains=ALL -syn region mysqlFunction start="md5(" end=")" contains=ALL -syn region mysqlFunction start="mid(" end=")" contains=ALL -syn region mysqlFunction start="min(" end=")" contains=ALL -syn region mysqlFunction start="mod(" end=")" contains=ALL -syn region mysqlFunction start="monthname(" end=")" contains=ALL -syn region mysqlFunction start="now(" end=")" contains=ALL -syn region mysqlFunction start="oct(" end=")" contains=ALL -syn region mysqlFunction start="octet_length(" end=")" contains=ALL -syn region mysqlFunction start="ord(" end=")" contains=ALL -syn region mysqlFunction start="period_add(" end=")" contains=ALL -syn region mysqlFunction start="period_diff(" end=")" contains=ALL -syn region mysqlFunction start="pi(" end=")" contains=ALL -syn region mysqlFunction start="position(" end=")" contains=ALL -syn region mysqlFunction start="pow(" end=")" contains=ALL -syn region mysqlFunction start="power(" end=")" contains=ALL -syn region mysqlFunction start="quarter(" end=")" contains=ALL -syn region mysqlFunction start="radians(" end=")" contains=ALL -syn region mysqlFunction start="rand(" end=")" contains=ALL -syn region mysqlFunction start="release_lock(" end=")" contains=ALL -syn region mysqlFunction start="repeat(" end=")" contains=ALL -syn region mysqlFunction start="reverse(" end=")" contains=ALL -syn region mysqlFunction start="round(" end=")" contains=ALL -syn region mysqlFunction start="rpad(" end=")" contains=ALL -syn region mysqlFunction start="rtrim(" end=")" contains=ALL -syn region mysqlFunction start="sec_to_time(" end=")" contains=ALL -syn region mysqlFunction start="session_user(" end=")" contains=ALL -syn region mysqlFunction start="sign(" end=")" contains=ALL -syn region mysqlFunction start="sin(" end=")" contains=ALL -syn region mysqlFunction start="soundex(" end=")" contains=ALL -syn region mysqlFunction start="space(" end=")" contains=ALL -syn region mysqlFunction start="sqrt(" end=")" contains=ALL -syn region mysqlFunction start="std(" end=")" contains=ALL -syn region mysqlFunction start="stddev(" end=")" contains=ALL -syn region mysqlFunction start="strcmp(" end=")" contains=ALL -syn region mysqlFunction start="subdate(" end=")" contains=ALL -syn region mysqlFunction start="substring(" end=")" contains=ALL -syn region mysqlFunction start="substring_index(" end=")" contains=ALL -syn region mysqlFunction start="subtime(" end=")" contains=ALL -syn region mysqlFunction start="sum(" end=")" contains=ALL -syn region mysqlFunction start="sysdate(" end=")" contains=ALL -syn region mysqlFunction start="system_user(" end=")" contains=ALL -syn region mysqlFunction start="tan(" end=")" contains=ALL -syn region mysqlFunction start="time_format(" end=")" contains=ALL -syn region mysqlFunction start="time_to_sec(" end=")" contains=ALL -syn region mysqlFunction start="to_days(" end=")" contains=ALL -syn region mysqlFunction start="trim(" end=")" contains=ALL -syn region mysqlFunction start="ucase(" end=")" contains=ALL -syn region mysqlFunction start="unique_users(" end=")" contains=ALL -syn region mysqlFunction start="unix_timestamp(" end=")" contains=ALL -syn region mysqlFunction start="upper(" end=")" contains=ALL -syn region mysqlFunction start="user(" end=")" contains=ALL -syn region mysqlFunction start="version(" end=")" contains=ALL -syn region mysqlFunction start="week(" end=")" contains=ALL -syn region mysqlFunction start="weekday(" end=")" contains=ALL -syn region mysqlFunction start="yearweek(" end=")" contains=ALL +syn region mysqlFunction start="\<abs(" end=")" contains=ALL +syn region mysqlFunction start="\<acos(" end=")" contains=ALL +syn region mysqlFunction start="\<adddate(" end=")" contains=ALL +syn region mysqlFunction start="\<ascii(" end=")" contains=ALL +syn region mysqlFunction start="\<asin(" end=")" contains=ALL +syn region mysqlFunction start="\<atan(" end=")" contains=ALL +syn region mysqlFunction start="\<atan2(" end=")" contains=ALL +syn region mysqlFunction start="\<avg(" end=")" contains=ALL +syn region mysqlFunction start="\<benchmark(" end=")" contains=ALL +syn region mysqlFunction start="\<bin(" end=")" contains=ALL +syn region mysqlFunction start="\<bit_and(" end=")" contains=ALL +syn region mysqlFunction start="\<bit_count(" end=")" contains=ALL +syn region mysqlFunction start="\<bit_or(" end=")" contains=ALL +syn region mysqlFunction start="\<ceiling(" end=")" contains=ALL +syn region mysqlFunction start="\<character_length(" end=")" contains=ALL +syn region mysqlFunction start="\<char_length(" end=")" contains=ALL +syn region mysqlFunction start="\<concat(" end=")" contains=ALL +syn region mysqlFunction start="\<concat_ws(" end=")" contains=ALL +syn region mysqlFunction start="\<connection_id(" end=")" contains=ALL +syn region mysqlFunction start="\<conv(" end=")" contains=ALL +syn region mysqlFunction start="\<cos(" end=")" contains=ALL +syn region mysqlFunction start="\<cot(" end=")" contains=ALL +syn region mysqlFunction start="\<count(" end=")" contains=ALL +syn region mysqlFunction start="\<curdate(" end=")" contains=ALL +syn region mysqlFunction start="\<curtime(" end=")" contains=ALL +syn region mysqlFunction start="\<date_add(" end=")" contains=ALL +syn region mysqlFunction start="\<date_format(" end=")" contains=ALL +syn region mysqlFunction start="\<date_sub(" end=")" contains=ALL +syn region mysqlFunction start="\<dayname(" end=")" contains=ALL +syn region mysqlFunction start="\<dayofmonth(" end=")" contains=ALL +syn region mysqlFunction start="\<dayofweek(" end=")" contains=ALL +syn region mysqlFunction start="\<dayofyear(" end=")" contains=ALL +syn region mysqlFunction start="\<decode(" end=")" contains=ALL +syn region mysqlFunction start="\<degrees(" end=")" contains=ALL +syn region mysqlFunction start="\<elt(" end=")" contains=ALL +syn region mysqlFunction start="\<encode(" end=")" contains=ALL +syn region mysqlFunction start="\<encrypt(" end=")" contains=ALL +syn region mysqlFunction start="\<exp(" end=")" contains=ALL +syn region mysqlFunction start="\<export_set(" end=")" contains=ALL +syn region mysqlFunction start="\<extract(" end=")" contains=ALL +syn region mysqlFunction start="\<field(" end=")" contains=ALL +syn region mysqlFunction start="\<find_in_set(" end=")" contains=ALL +syn region mysqlFunction start="\<floor(" end=")" contains=ALL +syn region mysqlFunction start="\<format(" end=")" contains=ALL +syn region mysqlFunction start="\<from_days(" end=")" contains=ALL +syn region mysqlFunction start="\<from_unixtime(" end=")" contains=ALL +syn region mysqlFunction start="\<get_lock(" end=")" contains=ALL +syn region mysqlFunction start="\<greatest(" end=")" contains=ALL +syn region mysqlFunction start="\<group_unique_users(" end=")" contains=ALL +syn region mysqlFunction start="\<hex(" end=")" contains=ALL +syn region mysqlFunction start="\<inet_aton(" end=")" contains=ALL +syn region mysqlFunction start="\<inet_ntoa(" end=")" contains=ALL +syn region mysqlFunction start="\<instr(" end=")" contains=ALL +syn region mysqlFunction start="\<lcase(" end=")" contains=ALL +syn region mysqlFunction start="\<least(" end=")" contains=ALL +syn region mysqlFunction start="\<length(" end=")" contains=ALL +syn region mysqlFunction start="\<load_file(" end=")" contains=ALL +syn region mysqlFunction start="\<locate(" end=")" contains=ALL +syn region mysqlFunction start="\<log(" end=")" contains=ALL +syn region mysqlFunction start="\<log10(" end=")" contains=ALL +syn region mysqlFunction start="\<lower(" end=")" contains=ALL +syn region mysqlFunction start="\<lpad(" end=")" contains=ALL +syn region mysqlFunction start="\<ltrim(" end=")" contains=ALL +syn region mysqlFunction start="\<make_set(" end=")" contains=ALL +syn region mysqlFunction start="\<master_pos_wait(" end=")" contains=ALL +syn region mysqlFunction start="\<max(" end=")" contains=ALL +syn region mysqlFunction start="\<md5(" end=")" contains=ALL +syn region mysqlFunction start="\<mid(" end=")" contains=ALL +syn region mysqlFunction start="\<min(" end=")" contains=ALL +syn region mysqlFunction start="\<mod(" end=")" contains=ALL +syn region mysqlFunction start="\<monthname(" end=")" contains=ALL +syn region mysqlFunction start="\<now(" end=")" contains=ALL +syn region mysqlFunction start="\<oct(" end=")" contains=ALL +syn region mysqlFunction start="\<octet_length(" end=")" contains=ALL +syn region mysqlFunction start="\<ord(" end=")" contains=ALL +syn region mysqlFunction start="\<period_add(" end=")" contains=ALL +syn region mysqlFunction start="\<period_diff(" end=")" contains=ALL +syn region mysqlFunction start="\<pi(" end=")" contains=ALL +syn region mysqlFunction start="\<position(" end=")" contains=ALL +syn region mysqlFunction start="\<pow(" end=")" contains=ALL +syn region mysqlFunction start="\<power(" end=")" contains=ALL +syn region mysqlFunction start="\<quarter(" end=")" contains=ALL +syn region mysqlFunction start="\<radians(" end=")" contains=ALL +syn region mysqlFunction start="\<rand(" end=")" contains=ALL +syn region mysqlFunction start="\<release_lock(" end=")" contains=ALL +syn region mysqlFunction start="\<repeat(" end=")" contains=ALL +syn region mysqlFunction start="\<reverse(" end=")" contains=ALL +syn region mysqlFunction start="\<round(" end=")" contains=ALL +syn region mysqlFunction start="\<rpad(" end=")" contains=ALL +syn region mysqlFunction start="\<rtrim(" end=")" contains=ALL +syn region mysqlFunction start="\<sec_to_time(" end=")" contains=ALL +syn region mysqlFunction start="\<session_user(" end=")" contains=ALL +syn region mysqlFunction start="\<sign(" end=")" contains=ALL +syn region mysqlFunction start="\<sin(" end=")" contains=ALL +syn region mysqlFunction start="\<soundex(" end=")" contains=ALL +syn region mysqlFunction start="\<space(" end=")" contains=ALL +syn region mysqlFunction start="\<sqrt(" end=")" contains=ALL +syn region mysqlFunction start="\<std(" end=")" contains=ALL +syn region mysqlFunction start="\<stddev(" end=")" contains=ALL +syn region mysqlFunction start="\<strcmp(" end=")" contains=ALL +syn region mysqlFunction start="\<subdate(" end=")" contains=ALL +syn region mysqlFunction start="\<substring(" end=")" contains=ALL +syn region mysqlFunction start="\<substring_index(" end=")" contains=ALL +syn region mysqlFunction start="\<subtime(" end=")" contains=ALL +syn region mysqlFunction start="\<sum(" end=")" contains=ALL +syn region mysqlFunction start="\<sysdate(" end=")" contains=ALL +syn region mysqlFunction start="\<system_user(" end=")" contains=ALL +syn region mysqlFunction start="\<tan(" end=")" contains=ALL +syn region mysqlFunction start="\<time_format(" end=")" contains=ALL +syn region mysqlFunction start="\<time_to_sec(" end=")" contains=ALL +syn region mysqlFunction start="\<to_days(" end=")" contains=ALL +syn region mysqlFunction start="\<trim(" end=")" contains=ALL +syn region mysqlFunction start="\<ucase(" end=")" contains=ALL +syn region mysqlFunction start="\<unique_users(" end=")" contains=ALL +syn region mysqlFunction start="\<unix_timestamp(" end=")" contains=ALL +syn region mysqlFunction start="\<upper(" end=")" contains=ALL +syn region mysqlFunction start="\<user(" end=")" contains=ALL +syn region mysqlFunction start="\<version(" end=")" contains=ALL +syn region mysqlFunction start="\<week(" end=")" contains=ALL +syn region mysqlFunction start="\<weekday(" end=")" contains=ALL +syn region mysqlFunction start="\<yearweek(" end=")" contains=ALL " Define the default highlighting. " Only when an item doesn't have highlighting yet -hi def link mysqlKeyword Statement +hi def link mysqlKeyword Keyword hi def link mysqlSpecial Special hi def link mysqlString String hi def link mysqlNumber Number hi def link mysqlVariable Identifier hi def link mysqlComment Comment hi def link mysqlType Type -hi def link mysqlOperator Statement -hi def link mysqlFlow Statement +hi def link mysqlOperator Operator +hi def link mysqlOperatorFunction Function +hi def link mysqlFlowFunction Function +hi def link mysqlFlowLabel Label +hi def link mysqlWindowFunction Function +hi def link mysqlWindowKeyword Keyword hi def link mysqlFunction Function diff --git a/runtime/syntax/yaml.vim b/runtime/syntax/yaml.vim index 6ec806a4cb..e992bc02e6 100644 --- a/runtime/syntax/yaml.vim +++ b/runtime/syntax/yaml.vim @@ -129,7 +129,7 @@ syn region yamlFlowCollection matchgroup=yamlFlowIndicator start='\[' end='\]' c execute 'syn match yamlPlainScalar /'.s:ns_plain_out.'/' execute 'syn match yamlPlainScalar contained /'.s:ns_plain_in.'/' -execute 'syn match yamlFlowMappingKey /'.s:ns_plain_in.'\%(\s\+'.s:ns_plain_in.'\)*\ze\s*:/ contained '. +execute 'syn match yamlFlowMappingKey /'.s:ns_plain_in.'\%(\s\+'.s:ns_plain_in.'\)*\ze\s*:\%(\s\|$\)/ contained '. \'nextgroup=yamlFlowMappingDelimiter skipwhite' syn match yamlFlowMappingKeyStart /?/ contained nextgroup=@yamlFlowNode skipwhite syn match yamlFlowMappingMerge /<<\ze\s*:/ contained nextgroup=yamlFlowMappingDelimiter skipwhite diff --git a/src/nvim/extmark.c b/src/nvim/extmark.c index b592283d92..4ff298cde5 100644 --- a/src/nvim/extmark.c +++ b/src/nvim/extmark.c @@ -116,16 +116,10 @@ static void extmark_setraw(buf_T *buf, uint64_t mark, int row, colnr_T col, bool { MarkTreeIter itr[1] = { 0 }; MTKey key = marktree_lookup(buf->b_marktree, mark, itr); - if (key.pos.row < 0 || (key.pos.row == row && key.pos.col == col)) { - // Does this hold? If it doesn't, we should still revalidate. - assert(!invalid || !mt_invalid(key)); - return; - } - - // Key already revalidated(how?) Avoid adding to decor again. - if (invalid && !mt_invalid(key)) { - invalid = false; - } + bool move = key.pos.row >= 0 && (key.pos.row != row || key.pos.col != col); + // Already valid keys were being revalidated, presumably when encountering a + // SavePos from a modified mark. Avoid adding that to the decor again. + invalid = invalid && mt_invalid(key); // Only the position before undo needs to be redrawn here, // as the position after undo should be marked as changed. @@ -137,19 +131,21 @@ static void extmark_setraw(buf_T *buf, uint64_t mark, int row, colnr_T col, bool int row2 = 0; if (invalid) { mt_itr_rawkey(itr).flags &= (uint16_t) ~MT_FLAG_INVALID; - } else if (key.flags & MT_FLAG_DECOR_SIGNTEXT && buf->b_signcols.autom) { + } else if (move && key.flags & MT_FLAG_DECOR_SIGNTEXT && buf->b_signcols.autom) { MTPos end = marktree_get_altpos(buf->b_marktree, key, NULL); row1 = MIN(end.row, MIN(key.pos.row, row)); row2 = MAX(end.row, MAX(key.pos.row, row)); buf_signcols_count_range(buf, row1, row2, 0, kTrue); } - marktree_move(buf->b_marktree, itr, row, col); + if (move) { + marktree_move(buf->b_marktree, itr, row, col); + } if (invalid) { row2 = mt_paired(key) ? marktree_get_altpos(buf->b_marktree, key, NULL).row : row; buf_put_decor(buf, mt_decor(key), row, row2); - } else if (key.flags & MT_FLAG_DECOR_SIGNTEXT && buf->b_signcols.autom) { + } else if (move && key.flags & MT_FLAG_DECOR_SIGNTEXT && buf->b_signcols.autom) { buf_signcols_count_range(buf, row1, row2, 0, kNone); } } diff --git a/test/functional/api/extmark_spec.lua b/test/functional/api/extmark_spec.lua index 7b2fe209ba..a7f4ba25e0 100644 --- a/test/functional/api/extmark_spec.lua +++ b/test/functional/api/extmark_spec.lua @@ -1758,13 +1758,13 @@ describe('API/extmarks', function() command('1d 2') eq(0, #get_extmarks(-1, 0, -1, {})) -- mark is not removed when deleting bytes before the range - set_extmark( - ns, - 3, - 0, - 4, - { invalidate = true, undo_restore = false, hl_group = 'Error', end_col = 7 } - ) + set_extmark(ns, 3, 0, 4, { + invalidate = true, + undo_restore = true, + hl_group = 'Error', + end_col = 7, + right_gravity = false, + }) feed('dw') eq(3, get_extmark_by_id(ns, 3, { details = true })[3].end_col) -- mark is not removed when deleting bytes at the start of the range @@ -1778,15 +1778,18 @@ describe('API/extmarks', function() eq(1, get_extmark_by_id(ns, 3, { details = true })[3].end_col) -- mark is removed when all bytes in the range are deleted feed('hx') - eq({}, get_extmark_by_id(ns, 3, {})) + eq(true, get_extmark_by_id(ns, 3, { details = true })[3].invalid) + -- mark is restored with undo_restore == true if pos did not change + command('undo') + eq(nil, get_extmark_by_id(ns, 3, { details = true })[3].invalid) -- multiline mark is not removed when start of its range is deleted - set_extmark( - ns, - 4, - 1, - 4, - { undo_restore = false, invalidate = true, hl_group = 'Error', end_col = 7, end_row = 3 } - ) + set_extmark(ns, 4, 1, 4, { + undo_restore = false, + invalidate = true, + hl_group = 'Error', + end_col = 7, + end_row = 3, + }) feed('ddDdd') eq({ 0, 0 }, get_extmark_by_id(ns, 4, {})) -- multiline mark is removed when entirety of its range is deleted |