Summary: | [PATCH] Python syntax for string.format | ||
---|---|---|---|
Product: | [Applications] kate | Reporter: | xOneca <xoneca+bugs.kde.org> |
Component: | syntax | Assignee: | KWrite Developers <kwrite-bugs-null> |
Status: | RESOLVED FIXED | ||
Severity: | wishlist | CC: | oss |
Priority: | NOR | ||
Version: | unspecified | ||
Target Milestone: | --- | ||
Platform: | Other | ||
OS: | All | ||
Latest Commit: | http://commits.kde.org/kate/e60dbd2c68c822e6817f7120ba1c8eca87f05bd9 | Version Fixed In: | |
Sentry Crash Report: | |||
Attachments: | Patch with respect syntax file v2.16 |
Description
xOneca
2013-03-20 18:18:50 UTC
Created attachment 78377 [details]
Patch with respect syntax file v2.16
I have made a patch to the syntax file v2.16.
Thanks for the patch. Just had a look and it seems to work. However, in your example: print "My var value: {var}".format(var=10) `format` is colored like the matched {var}. This makes it hard to tell where the string ends. Also, other string methods aren't highlighted either, so imho it probably be better (for consistency) not to match the `format` function as a string substitution. (In reply to comment #2) > Thanks for the patch. Just had a look and it seems to work. However, in your > example: > print "My var value: {var}".format(var=10) > `format` is colored like the matched {var}. This makes it hard to tell where > the string ends. Also, other string methods aren't highlighted either, so > imho it probably be better (for consistency) not to match the `format` > function as a string substitution. That's because format is also a built-in function. (see http://docs.python.org/2/library/functions.html#format -- all functions in that page are colored the same) In fact, they have different color styles: string substitution is 'dsOthers' and built-in functions are 'dsDataType'. (In reply to comment #3) > That's because format is also a built-in function. (see > http://docs.python.org/2/library/functions.html#format -- all functions in > that page are colored the same) Thanks; good point. I had tried two built-in functions (like Python 3's print) and they weren't in that list yet (hence not in the same color). Therefore I was confused. Also the color scheme isn't particularly fortunate having the same color for BIFs. Will sort things out by the end of the week. Git commit e60dbd2c68c822e6817f7120ba1c8eca87f05bd9 by Gerald Senarclens de Grancy. Committed on 15/05/2013 at 20:22. Pushed by geralds into branch 'master'. Python syntax for string.format patch by xOneca M +17 -1 part/syntax/data/python.xml http://commits.kde.org/kate/e60dbd2c68c822e6817f7120ba1c8eca87f05bd9 |