Merge pull request #159 from SNDST00M/feat-fontstyle-strikethrough
Implement `FontStyle.Strikethrough`
This commit is contained in:
Коммит
4f1272a1fd
|
@ -24,7 +24,7 @@ export const enum TemporaryStandardTokenType {
|
|||
Other = 0,
|
||||
Comment = 1,
|
||||
String = 2,
|
||||
RegEx = 4,
|
||||
RegEx = 3,
|
||||
MetaEmbedded = 8
|
||||
}
|
||||
|
||||
|
|
14
src/main.ts
14
src/main.ts
|
@ -60,7 +60,7 @@ export const enum StandardTokenType {
|
|||
Other = 0,
|
||||
Comment = 1,
|
||||
String = 2,
|
||||
RegEx = 4
|
||||
RegEx = 3
|
||||
}
|
||||
|
||||
export interface IGrammarConfiguration {
|
||||
|
@ -214,24 +214,24 @@ export interface ITokenizeLineResult {
|
|||
* 1098 7654 3210 9876 5432 1098 7654 3210
|
||||
* - -------------------------------------------
|
||||
* xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx
|
||||
* bbbb bbbb bfff ffff ffFF FTTT LLLL LLLL
|
||||
* bbbb bbbb bfff ffff ffFF FFTT LLLL LLLL
|
||||
* - -------------------------------------------
|
||||
* - L = LanguageId (8 bits)
|
||||
* - T = StandardTokenType (3 bits)
|
||||
* - F = FontStyle (3 bits)
|
||||
* - T = StandardTokenType (2 bits)
|
||||
* - F = FontStyle (4 bits)
|
||||
* - f = foreground color (9 bits)
|
||||
* - b = background color (9 bits)
|
||||
*/
|
||||
export const enum MetadataConsts {
|
||||
LANGUAGEID_MASK = 0b00000000000000000000000011111111,
|
||||
TOKEN_TYPE_MASK = 0b00000000000000000000011100000000,
|
||||
FONT_STYLE_MASK = 0b00000000000000000011100000000000,
|
||||
TOKEN_TYPE_MASK = 0b00000000000000000000001100000000,
|
||||
FONT_STYLE_MASK = 0b00000000000000000011110000000000,
|
||||
FOREGROUND_MASK = 0b00000000011111111100000000000000,
|
||||
BACKGROUND_MASK = 0b11111111100000000000000000000000,
|
||||
|
||||
LANGUAGEID_OFFSET = 0,
|
||||
TOKEN_TYPE_OFFSET = 8,
|
||||
FONT_STYLE_OFFSET = 11,
|
||||
FONT_STYLE_OFFSET = 10,
|
||||
FOREGROUND_OFFSET = 14,
|
||||
BACKGROUND_OFFSET = 23
|
||||
}
|
||||
|
|
|
@ -9,7 +9,8 @@ export const enum FontStyle {
|
|||
None = 0,
|
||||
Italic = 1,
|
||||
Bold = 2,
|
||||
Underline = 4
|
||||
Underline = 4,
|
||||
Strikethrough = 8
|
||||
}
|
||||
|
||||
export class ParsedThemeRule {
|
||||
|
@ -119,6 +120,9 @@ export function parseTheme(source: IRawTheme | undefined): ParsedThemeRule[] {
|
|||
case 'underline':
|
||||
fontStyle = fontStyle | FontStyle.Underline;
|
||||
break;
|
||||
case 'strikethrough':
|
||||
fontStyle = fontStyle | FontStyle.Strikethrough;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче