2072 / 2072/vim-syntax-for-PHP

oddities with shorttag off

Offen
#6 2 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
Vorherrschende Sprache
Vim Script
Sterne
16
Forks
4
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Beschreibung

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".

Beitragsleitfaden

Für dieses Repository ist kein Beitragsleitfaden indexiert

Rechercherichtung

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.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
php, vim
Bereich
devtools
Issue-Typ
Bug
Schwierigkeit
3/5
Geschätzter Aufwand
1-2 Tage
Aktivitätsstatus
Veraltet
Klarheit
Größtenteils klar
Anfängerfreundlichkeit
45/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.