Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

oddities with shorttag off #6

Open
gcb opened this issue Oct 2, 2023 · 2 comments
Open

oddities with shorttag off #6

gcb opened this issue Oct 2, 2023 · 2 comments

Comments

@gcb
Copy link

gcb commented Oct 2, 2023

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
(note that these are not short tags, but echo tags)

with php_noShortTags=1
image

with php_noShortTags=1, if I remove the <?php tag
image

or make the end tag ?> be on a line with code (doesn't have to be a single line with the opening <?php tag. that code block can be any size, only the closing tag matters to not be alone on its own line)
image

short tags are also fine in terms of not messing with the other echo tags
image

but having that php tag anywhere breaks the echo tags parsing
image

note that this doesn't change when editing file. E.g. if I load a file in a working state (i.e. without the bug happening), it won't trigger the bug as i edit file, even if i add <?php and ?> 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".

gcb added a commit to gcb/vim-syntax-for-PHP that referenced this issue Oct 2, 2023
@gcb
Copy link
Author

gcb commented Oct 2, 2023

it's not just user error as i assumed on the patch above... Some of the above was because of another script (rainbowTags) was marking things with its own PhpRegion_lv0... syntax. With all other removed, a clean vimrc with just the syntax file and

" .vimrc
set nocompatible
syntax on
"let php_noShortTags=1

without the php_noShortTags=1 (i.e. default), all the echo tags are phpRegion. With or without <?php.
image

with php_noShortTags=1, now I get the inverse of the "bug" I was getting when comining with rainbowTags :)

php_noShortTags=1 and with <?php ?> same line i get nothing marked with any synID. all blank. only the stuff inside the php main tag! that is syntaxed as php. the html and echo tags are all unsyntaxed.
image

Same thing for php_noShortTags=1 and No php tag.

With php_noShortTags=1 and a php tag closing on its on line also opposite from before. I get the surrounding of the php tag marked as html, and the echo tags as htmlTag
image

having to save and reload the file is still the same as describe above. That is, after you open the file with or without the bug happening, editing the trigger condition will not change anything, until you reload it.

@gcb
Copy link
Author

gcb commented Oct 2, 2023

tried to replace all <?php with <?\(=\|php\) on the matchers for phpRegion but that made all html to be treated as php for some reason.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant