jfcherng-sublime / ST-ASS

ASS/SSA subtitles syntax highlight for Sublime Text.
MIT License
26 stars 2 forks source link

插件能不能追加一个根据颜色码显示对应的颜色 #2

Closed emako closed 5 years ago

jfcherng commented 6 years ago

No. A possible solution would be asking Color Helper for supporting &HAABBGGRR color format. But I am doubt the author would add that since only a few people use ASS.

jfcherng commented 5 years ago

Done in 2.2.0.

screenshot

Behavior can be modified in ASS.sublime-settings.

{
    // when to show a color phantom beside a color code?
    // can be "never", "always" or "hover"
    "show_color_phantom": "always",
    // the period (in milisecond) that consecutive modifications are treated as typing
    // phantoms will be updated only when the user is not considered typing
    // you can make this value larger if you feel ST gets stucked while typing
    "on_modified_typing_period": 0,
}

Codes are borrowed from my another unpublished plugin OpenUriInBrowser :P

FichteFoll commented 5 years ago

Would you mind sharing your rationale for duplicating this behavior in this package over adding the required settings to ColorHelper?

I tried to find a statement from @facelessuser regarding supporting rarely used syntaxes but I wasn't able to. Ideally, CH would have the capability of honoring view-specific settings that other packages could then provide through syntax-specific settings files.

(related: https://github.com/facelessuser/ColorHelper/issues/60)

jfcherng commented 5 years ago

@FichteFoll Do you mean let's implement the color phantom in CH?

That's what I thought back to 2017. Just add something like "allowed_colors": ["abgr"], and some scopes containing color codes. But CH's codebase is a little too large for me.

I don't mind we move this feature to CH since CH has more features than simply showing the color.

FichteFoll commented 5 years ago

Hm, I don't think it'd be too much work, but I certainly don't have the time to work on it for the forseeable future. Also I'd probably focus on doing that view-specific settings check on CH first because that sure sounds useful.