2072 / 2072/vim-syntax-for-PHP

oddities with shorttag off

未关闭
#6 2 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
主要语言
Vim Script
星标
16
派生
4
PR 合并指标
30 天内没有已合并 PR

描述

Found this by accident, after disabling shorttags parsing after working a rather large file that caused syntax parsing to take a few seconds...

shorttags not disabled (that is, the default)

![image](https://github.com/2072/vim-syntax-for-PHP/assets/56283/562a0f1d-faaa-49d3-8dbe-994109422dbb)
(note that these are not short tags, but echo tags)

with `php_noShortTags=1`
![image](https://github.com/2072/vim-syntax-for-PHP/assets/56283/8cbad772-2e38-474d-9669-e359855d4f86)

with `php_noShortTags=1`, if I remove the `` be on a line with code (doesn't have to be a single line with the opening `` closing on its own line. Only after i save and quit and reopen the file (or save and `:e!`). Likewise if i open a file with the bug, removing the trigger won't fix it, until I reload the file. Whatever is causing it is "sticky".

贡献指南

这个仓库没有索引到贡献指南

调研方向

The issue is in the Vim syntax file for PHP, likely in syntax/php.vim. Start by examining how shorttags are toggled with php_noShortTags and how regions for and echo tags are defined. Reproduce the bug with the provided examples to see the sticky highlighting behavior. Look for syntax region definitions that might incorrectly nest or fail to reset when the closing tag is on its own line.

由索引模型根据 Issue 内容生成。

评估

技术栈
php, vim
领域
devtools
Issue 类型
缺陷
难度
3/5
预计耗时
1-2 天
活跃度
停滞
描述清晰度
基本清楚
新手友好度
45/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。