terminalfi / coloredcomments Goto Github PK
View Code? Open in Web Editor NEWColored Comments is a SublimeText plugin to provide Comment Colorization
License: Other
Colored Comments is a SublimeText plugin to provide Comment Colorization
License: Other
Hi there!
It seems something in Colored Comments is interfering with the undo stack. By default, I expect one undo step to process entire words or at least larger chunks. With the plugin enabled, each undo step process one individual keystroke. I recorded a video demonstrating the issue:
Iโm running Sublime Text 4 build 4112.
Hello,
I am really glad that I found this in ST3. However, I have suggestion for a package which helps team to write consistent code across all editors.
As you are inspired by this package it will be great if you follow it's comment convention like for todo it is TODO:
and in our side we have TODO
without colon(:
)
So, if you can make highlighting words the same as vs-code, team working on project with different editors can highlight comments in both vs-code and sublime.
BTW, it's really great ๐
Awaiting for your thought on this
~ Regards
Reload bug if "prompt_new_color_scheme"
is missing from user custom settings, the settings are constantly reloaded.
Sorry for several creating issues at once, I thought each issues as a separate ticket may be easier to manage. ๐ค
Maybe I've missed something obvious, but applying a foreground
color (in the theme override file) seems to apply it to the background
?
{
"name": "SECTION COMMENTS",
"scope": "comments.section",
"foreground": "#896afc",
"background": "var(--background)",
},
Hi, how do I get this set up? I installed via Package Manager and expected to run Colored Comments: Generate Color Scheme
, but don't have that command available.
Hi @TheSecEng
I have trouble setting up ne latest version (I hope it is not a duplicate of #4):
I use this minimal configuration (esp. to eliminate the risk of JSON errors)
{
"prompt_new_color_scheme": true,
"continued_matching": false,
"tags": {
"TODO": {
"identifier": "TODO",
"color": {
"name": "todo",
"foreground": "#ff9900",
"background": "rgba(1, 22, 38, 0.1)"
}
}
}
}
which results in errors like this:
raceback (most recent call last):
File "/opt/sublime_text/Lib/python33/sublime_plugin.py", line 1314, in run_
return self.run(edit)
File "/home/mysweethome/.config/sublime-text-3/Installed Packages/Colored Comments.sublime-package/colored_comments.py", line 32, in run
File "/home/mysweethome/.config/sublime-text-3/Installed Packages/Colored Comments.sublime-package/color_manager.py", line 110, in create_user_custom_theme
File "./python3.3/json/__init__.py", line 316, in loads
File "./python3.3/json/decoder.py", line 351, in decode
File "./python3.3/json/decoder.py", line 369, in raw_decode
ValueError: No JSON object could be decoded
Traceback (most recent call last):
File "./python3.3/json/decoder.py", line 367, in raw_decode
StopIteration
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/opt/sublime_text/Lib/python33/sublime_plugin.py", line 1314, in run_
return self.run(edit)
File "/home/mysweethome/.config/sublime-text-3/Installed Packages/Colored Comments.sublime-package/colored_comments.py", line 32, in run
File "/home/mysweethome/.config/sublime-text-3/Installed Packages/Colored Comments.sublime-package/color_manager.py", line 110, in create_user_custom_theme
File "./python3.3/json/__init__.py", line 316, in loads
File "./python3.3/json/decoder.py", line 351, in decode
File "./python3.3/json/decoder.py", line 369, in raw_decode
ValueError: No JSON object could be decoded
I tried several UI Color schemas and tried to Regenerate them using the command.
Usually I use the toxin color schema.
Any hints what's I could do?
Thanks in advance and again thanks for your work on this plugin!
st3
"simple clone" is a sublime text3 plugin simple clone
I am always getting this error:
Traceback (most recent call last):
File "C:\Apps\Sublime Text\Lib\python38\sublime_plugin.py", line 1518, in run_
return self.run(edit)
File "C:\Apps\Sublime Text\Data\Installed Packages\Colored Comments.sublime-package\colored_comments.py", line 79, in run
AttributeError: 'NoneType' object has no attribute 'create_user_custom_theme'
When a file has a lot of comments, it can cause the highlighting to be laggy.
Possible solution is to take the results of regions = self.view.find_by_selector(comment_selector)
and split that into a few threads.
Hi
I am a bit of a noob to coding, only taught myself to write my thesis and this is partially a problem asked in #34 already - how do I set this up properly for LaTeX? It's not clear to me whether this package supports LaTeX syntax and how to configure it.
I ran the 'Override' command as recommended in #34, but not sure how to proceed in the next window.
@TheSecEng
Hi, I have installed the package on Sublime text 3 and the coloring doesn't work as expected even after running Colored Comments: Generate Color Scheme
many times, and then I have realized that it only works with the default sublime colorschemes (ex: Monokai...). And I use Dracula colorscheme, so I'm happy to request the support for it on this life saving package.
Thanks.
Hi,
I just installed this package, and I like that the first thing it did was ask me:
Would you like to change your color scheme to [...]?
To permanently disable this prompt, set 'prompt_new_color_scheme' to false in the Colored Comments settings
๐
However, I pressed Cancel, as I don't want any packages to interfere with my color scheme - even a copy of it - I'd rather add what I want directly & manually. Then, I opened the Colored Comments preferences, and upon opening the new window with the side by side settings view, I received this prompt 3 more times.
Then, as I tried writing "prompt_new_color_scheme": false,
in the right hand / user preferences pane, for every keystroke, I received the same prompt, followed by "colored_comments.sublime-settings
has changed on disk, do you wish to reload it?"
Please could you investigate a solution to prompt less often? Maybe only prompt again after some time has elapsed, or perhaps only when switching tabs etc. so it wouldn't interfere with typing in the preferences to disable the prompt? :)
Also, I noticed that comments were only colored after I made a change in the view/buffer - my expectation was that it would color them as soon as the plugin is loaded. (I'm referring to files I had open already. They didn't get automatic comment coloring when this plugin was installed, nor when ST was restarted.)
Thanks for your hard work on this plugin btw. :)
Is there a way to see a list of all comments in some kind of panel or something?
Similar to #6 I think, but lines starting with * are being tagged as deprecated
Hi, Thanks for considering the previous suggestion.
I installed your plugin and I want to change the highlight color of TODO because it isn't suiting my current color scheme. So, I made following changes:
{
"old_color_scheme": "Packages/Dracula Color Scheme/Dracula.tmTheme",
"prompt_new_color_scheme": false,
"tags":
{
"TODO":
{
"color":
{
"background": "rgba(1,22,38, 0.1)",
"foreground": "#fff",
"name": "todo"
}
}
}
}
But even after I close and restart sublime text it isn't working.
~ Regards
I've not created a PR yet, as I'm not super familiar with ST4 plugins or this code base and this is more a config enhancement suggestion.
A fair amount of projects use the comment/anchor syntax from Starlane Studios Comment Anchors plugin for VS Code. I've built a config to support this sort of comment highlighting into Colored Comments for SublimeText.
I copied their colors and identifiers from here.
File: colored_comments.sublime-settings
(P.S. it would be nice to be able to append to "tags" rather than overriding it completely and having to include the defaults manually also, maybe use a "tags" for default and merge in a "custom_tags" from the user file?)
{
"tags": {
// SECTION defauls included
// Friendly name for you to know what the purpose is
// and used in the OrderedDict
// These should be unique
"Important": {
// The name of the scope being use in your color scheme file
"scope": "comments.important",
// The actual identifier used to highlight the comments
"identifier": "!",
// Enables sublime.DRAW_SOLID_UNDERLINE
// Only noticable if outline = true
"underline": false,
// Enables sublime.DRAW_STIPPLED_UNDERLINE
// Only noticable if outline = true
"stippled_underline": false,
// Enables sublime.DRAW_SSQUIGGLY_UNDERLINE
// Only noticable if outline = true
"squiggly_underline": false,
// Enables sublime.DRAW_NO_FILL
// This disables coloring of text
// and allows for the outline of the text
"outline": false,
// Treats the identifier
// as an regular expression
"is_regex": false,
// Enables ignorecase for the ideentifier
"ignorecase": true,
},
"Deprecated": {
"scope": "comments.deprecated",
"identifier": "*",
},
"Question": {
"scope": "comments.question",
"identifier": "?",
},
"TODO": {
"scope": "comments.todo",
"identifier": "TODO[:]?|todo[:]?",
"is_regex": true,
"ignorecase": true,
},
"FIXME": {
"scope": "comments.fixme",
"identifier": "FIXME[:]?|fixme[:]?",
"is_regex": true
},
"UNDEFINED": {
"scope": "comments.undefined",
"identifier": "//[:]?",
"is_regex": true
},
// SECTION VS Code Comment Anchors Syntax Support
// LINK https://github.com/StarlaneStudios/vscode-comment-anchors/
"ANCHOR": {
"scope": "comments.anchor",
"identifier": "ANCHOR",
"ignorecase": true,
},
"STUB": {
"scope": "comments.stub",
"identifier": "STUB",
"ignorecase": true,
},
"NOTE": {
"scope": "comments.note",
"identifier": "NOTE",
"ignorecase": true,
},
"REVIEW": {
"scope": "comments.review",
"identifier": "REVIEW",
"ignorecase": true,
},
"SECTION": {
"scope": "comments.section",
"identifier": "SECTION[:]?|!SECTION[:]?",
"is_regex": true,
"ignorecase": true,
},
"LINK": {
"scope": "comments.link",
"identifier": "LINK",
"ignorecase": true,
},
}
}
then file: One Dark.sublime-color-scheme
(I'm using a theme but the Starlane Anchor Comments colors are their own/universal):
{
// http://www.sublimetext.com/docs/3/color_schemes.html
"variables": {
"important_comment": "var(--orangish)",
"deprecated_comment": "var(--purplish)",
"question_comment": "var(--greenish)",
"todo_comment": "var(--bluish)",
"fixme_comment": "var(--redish)",
"undefined_comment": "var(--pinkish)",
},
"globals": {
// "foreground": "var(green)",
},
"rules": [
// NOTE default colors, modified for Theme One (One Dark) ST4 Theme
{
"name": "IMPORTANT COMMENTS",
"scope": "comments.important",
"foreground": "var(important_comment)",
"background": "var(--background)",
},
{
"name": "DEPRECATED COMMENTS",
"scope": "comments.deprecated",
"foreground": "var(deprecated_comment)",
"background": "var(--background)",
},
{
"name": "QUESTION COMMENTS",
"scope": "comments.question",
"foreground": "var(question_comment)",
"background": "var(--background)",
},
{
"name": "TODO COMMENTS",
"scope": "comments.todo",
"foreground": "var(todo_comment)",
"background": "var(--background)",
},
{
"name": "FIXME COMMENTS",
"scope": "comments.fixme",
"foreground": "var(fixme_comment)",
"background": "var(--background)",
},
{
"name": "UNDEFINED COMMENTS",
"scope": "comments.undefined",
"foreground": "var(undefined_comment)",
"background": "var(--background)",
},
// SECTION added colors for "StarlaneStudios/vscode-comment-anchors" syntax support
// LINK https://github.com/StarlaneStudios/vscode-comment-anchors/blob/f5a1471bb91e6de42c123fa982019be62d57f826/src/util/defaultTags.ts
{
"name": "ANCHOR COMMENTS",
"scope": "comments.anchor",
"foreground": "#A8C023",
"background": "var(--background)",
},
{
"name": "STUB COMMENTS",
"scope": "comments.stub",
"foreground": "#BA68C8",
"background": "var(--background)",
},
{
"name": "NOTE COMMENTS",
"scope": "comments.note",
"foreground": "#64DD17",
"background": "var(--background)",
},
{
"name": "REVIEW COMMENTS",
"scope": "comments.review",
"foreground": "#64DD17",
"background": "var(--background)",
},
{
"name": "SECTION COMMENTS",
"scope": "comments.section",
"foreground": "#896afc",
"background": "var(--background)",
},
{
"name": "LINK COMMENTS",
"scope": "comments.link",
"foreground": "#2ecc71",
"background": "var(--background)",
},
],
}
First of call, great plugin! ๐ ๐ฅ
While tinkering I noticed that the the README could do with an update in the New Highlights section as well as the installation instruction #34.
It currently reads as though all the params for adding a new comment type including color.name and color.foreground should be applied in the user settings. When it seems the color info is applied in the manual theme override section in theme_name.sublime-color-scheme
as
{
"name": "REVIEW COMMENTS",
"scope": "comments.review",
"foreground": "var(undefined_comment)",
"background": "var(--background)",
},
And the new highlight settings are applied in the user settings for the plugin:
"REVIEW": {
"scope": "comments.review",
"identifier": "REVIEW",
"ignorecase": true,
},
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.