textmate / ini.tmbundle

TextMate support for Ini
15 stars 9 forks source link

Apostrophe breaks syntax highlighting for Ini files #3

Open aeschli opened 7 years ago

aeschli commented 7 years ago

From @thijsvandien on March 2, 2017 17:13

Extension Author Version
python donjayamanne 0.5.9
vim vscodevim 0.5.3 ;

Steps to Reproduce:

  1. Create an ini file where a text value contains an apostrophe in the middle, e.g.:
[Sample]
SomeKey=Someone's Value
SomeOtherKey=42
  1. Note that from the apostrophe onward, the rest of the file is considered a string.

Different ini implementations have their own interpretations of values. E.g., Windows does not consider the apostrophes of a quoted value part of that value. I'm not aware of the exact rules, but at least the current highlighting behavior is wrong. I think it would be better to stick to the universally valid rules – sections, keys and values – and not to consider apostrophes special at all.

Copied from original issue: Microsoft/vscode#21804

myfonj commented 5 years ago

This issue is addressed in PR #1 from 2015, maybe time has come to finally merge at least parts of it?

jmiguel-hdez commented 5 years ago

can PR #1 from 2015 be merged? or perhaps some other appropriate fix for syntax highlighting

geerligs commented 2 years ago

I would like to have this issue solved as well. Seems a fix is available (see https://github.com/textmate/ini.tmbundle/issues/3#issuecomment-536350190)

diatomicDisaster commented 2 years ago

This is a really simple issue, no idea why it's been open for 5 years. A fix was provided 7 years ago, can it please be merged?

edgetools commented 8 months ago

It's 2024 and we're likely to see vscode replaced before this gets merged 😆

ExtReMLapin commented 4 months ago

MERGE IT ALREADY

Holf commented 2 months ago

Until this does get fixed, a workaround to stop your entire .ini file losing its formatting is to immediately add a comment containing the closing ':

[section_1]
this_id = 281474976818284
that_id = 281474977838819
string_with_apostrophe = Mark's Keyboard Repair
# '

[section_2]
this_id = 281474976816734
that_id = 281474978538200
string_with_apostrophe = Pepper's Ghost
# '

Somewhat entertainingly, on writing out the example .ini file content for this comment I see the GitHub comment parser has exactly the same issue.