In my theme, I've set the background color for comments. But the color is applied to the entire row, rather than just the area with text. Is there a theme setting I can use to fix that?
The Sublime Text theme engine relies on the scopes defined in the language syntax.
Executing view.scope_name(view.sel()[0].begin()) in the Sublime Console when the cursor is inside the comment shows source.python string.quoted.double.block.python - and is the same when the cursor is in a whitespace section of the string and when it isn't.
This means you would need to alter the python language definition that Sublime uses to report a different scope when relevant, for example, string.quoted.double.block.whitespace.python, before you can use it in your theme.
Related
I use a particular color theme in the appearance preferences of LiClipse to change the appearance of the text in my editor for my PyDev projects.
I can easily change the color of any type of data that the editor interprets, except for strings. (Perhaps there's more but I have yet to discover them)
I am able in the Preference setting window to set any colors for strings, and I do see it being applied in the preview that the window shows, but when I click Apply, the strings in my code stays plain white. I've tried editing a couple of other data's color, and they all work great.
Following is two screenshots showing the settings window just before pressing "Apply", and my resulting code, in that order.
In the Preferences window, we can see in the preview that the "String" part is colored. Any color works. But then in my editor we can see that it did not apply, but all the other word object colors did.
My guess is that perhaps the strings in the PyDev editor are not interpreted as string, but instead something else.
I'm using LiClipse 4.5.2.201803171104
On Windows 7.
After a couple of trial and errors, I found out that by default, strings in the LiClipse PyDev editor are interpreted as constant.
Therefore, editing the color of constant changes the display colors of strings in the editor.
I have read the documentation for the Color Schemes. I realized all settings except invisibles and shadow (+shadowWidth). I can translate from English, but I do not see anywhere where the elements, the color of which changes settings. Does anyone could show me the screenshots, where there are elements which change color? Thanks.
From the unofficial documentation on color schemes, linked to in your question, we can see that invisibles is ignored, so changing it has no effect on the appearance of any elements in ST3. The tmTheme format is borrowed from a different text editor, to make it easier to use the same color scheme in different editors. So maybe it does something in other text editors, but not in ST. EDIT: support for invisibles has been added to ST in build 3149 - https://github.com/SublimeTextIssues/Core/issues/1992.
The effect of the shadow setting can be seen below, it is the pink parts on the far sides:
It is only visible when the text in the document is wider than the window - it will appear on the left when the view can be scrolled to the left and it will appear on the right when the view can be scrolled to the right.
From my testing, including shadowWidth in the tmTheme file will cause the shadow to not appear. I have logged an issue in the unofficial documentation here, maybe someone will update it with details of how to get this working.
Note:
When making changes to atmTheme file, it is often necessary to close all open documents, and restart Sublime Text, before the change will become visible.
Is there a method to extract the code's color scheme from paypal code expamples and place it in sublime text?
Here is a link: Paypal link
That page is made using Groc, that put comments next to code in a beautiful way. Groc seems to use two projects that I have used before: highlight.js and maybe pygments, to highlight the code, but they don't use any of the default stylesheets, I think they use their own stylesheet.
Inside the Groc project you can see this sass file which contains almost all the info you need (color for variables, strings, keywords, etc.) to manually add the values to a custom color scheme. In addition Groc style documentation shows other useful values of the Color Scheme such as the background. You can get other values inspecting DOM.
I think you would have to manually do it. You can use this Sublime Text Color Scheme Generator. In the Paypal window, you can use developer tools (Ctrl + Shift + C if you're using Chrome) and click on the words to see the exact color value, and then just use those in the color scheme generator.
EDIT: Please take a look at #sergioFC's answer, he gave an easier way of finding all the color values.
Right now types like i32 etc. are being shown as Italics.
I wish to avoid that, but the only Rust preferences I see are in compiled form in ~/Library!
You will need to edit your color scheme to change the syntax highlighting. Look for the scope storage or storage.type and remove the italic setting. This resource is great for editing color schemes. If you're using Monokai, it comes up automatically. If not, click the Gallery button and select the color scheme you're using.
I have a TRichEdit control containing source code. I want to set the background color of a single line.
I know how to set the text color, but isn't there a way to set the background color as well? I'm not talking about the entire background colour for the whole control, only how to change one single line.
Do I really have to write a custom control to do this?
There is no TRichEdit property for setting the background color of individual characters/lines. However, you can use the Win32 API SendMessage() function, or the TRichEdit's own Perform() method, to send it an EM_SETCHARFORMAT message, specifying a CHARFORMAT2 structure whose crBackColor field is set to the desired color. You can apply formatting to existing characters by highlighting them first, or you can apply formatting to the current caret position if there is no selection.
The MSDN on RTF specifies \cbN, where N is the color index.
Other searches suggest this is not supported by a lot of applications (OS X's native RTF viewer, Microsoft Word) so maybe you should look for a custom solution.