Skip to content

Commit

Permalink
[fmtc] Add more tags
Browse files Browse the repository at this point in the history
  • Loading branch information
andyone committed Nov 20, 2023
1 parent 17e653e commit efa22b7
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 2 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
## Changelog

### 12.87.0

* `[fmtc]` Added tag for italic text (`{&}`)
* `[fmtc]` Added tag for striked text (`{=}`)
* `[fmtc]` Added tag for hidden text (`{+}`)

### 12.86.0

* `[usage]` `Info.AddCommand` now returns pointer to added command
Expand Down
2 changes: 1 addition & 1 deletion ek.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import (
// ////////////////////////////////////////////////////////////////////////////////// //

// VERSION is current ek package version
const VERSION = "12.86.0"
const VERSION = "12.87.0"

// ////////////////////////////////////////////////////////////////////////////////// //

Expand Down
3 changes: 3 additions & 0 deletions fmtc/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,12 @@ If you are using SublimeText 4 (`4075+`), we strongly recommend that you install
| Reset | `{!}` || `0` |
| Bold | `{*}` | `{!*}` | `1` |
| Dim | `{^}` | `{!^}` | `2` |
| Italic | `{&}` | `{!&}` | `3` |
| Underline | `{_}` | `{!_}` | `4` |
| Blink | `{~}` | `{!~}` | `5` |
| Reverse | `{@}` | `{!@}` | `7` |
| Hidden | `{+}` | `{!+}` | `8` |
| Strike | `{=}` | `{!=}` | `9` |

#### 8/16 Colors

Expand Down
8 changes: 7 additions & 1 deletion fmtc/fmtc.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,12 @@ var codes = map[rune]int{
'!': 0, // Default
'*': 1, // Bold
'^': 2, // Dim
'&': 3, // Italic
'_': 4, // Underline
'~': 5, // Blink
'@': 7, // Reverse
'+': 8, // Hidden
'=': 9, // Strike

// Text
'd': 30, // Black (Dark)
Expand Down Expand Up @@ -126,10 +129,13 @@ func RemoveColor(name string) {
// - Light colors
// ! Default
// * Bold
// & Italic
// ^ Dim
// _ Underline
// = Strike
// ~ Blink
// @ Reverse
// + Hidden
//
// Foreground colors:
// d Black (Dark)
Expand Down Expand Up @@ -393,7 +399,7 @@ func tag2ANSI(tag string, clean bool) string {
case '-', '!':
continue

case '*', '^', '_', '~', '@':
case '*', '&', '^', '_', '=', '~', '@', '+':
if reset {
chars += getResetCode(code)
} else {
Expand Down

0 comments on commit efa22b7

Please sign in to comment.