textbringer 23 → 25
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/exe/txtb +1 -0
- data/lib/textbringer/buffer.rb +19 -11
- data/lib/textbringer/commands/dired.rb +31 -0
- data/lib/textbringer/commands/files.rb +4 -0
- data/lib/textbringer/commands/gamegrid.rb +25 -0
- data/lib/textbringer/commands/misc.rb +19 -0
- data/lib/textbringer/commands/tetris.rb +10 -0
- data/lib/textbringer/commands/windows.rb +14 -0
- data/lib/textbringer/config.rb +2 -1
- data/lib/textbringer/face.rb +71 -15
- data/lib/textbringer/faces/gamegrid.rb +23 -0
- data/lib/textbringer/gamegrid.rb +160 -0
- data/lib/textbringer/highlight_context.rb +21 -0
- data/lib/textbringer/keymap.rb +1 -0
- data/lib/textbringer/mode.rb +25 -0
- data/lib/textbringer/modes/dired_mode.rb +322 -0
- data/lib/textbringer/modes/gamegrid_mode.rb +51 -0
- data/lib/textbringer/modes/ruby_mode.rb +298 -181
- data/lib/textbringer/modes/tetris_mode.rb +316 -0
- data/lib/textbringer/theme.rb +180 -0
- data/lib/textbringer/themes/catppuccin.rb +105 -0
- data/lib/textbringer/themes/github.rb +89 -0
- data/lib/textbringer/themes/gruvbox.rb +84 -0
- data/lib/textbringer/themes/molokai.rb +67 -0
- data/lib/textbringer/themes/sonokai.rb +63 -0
- data/lib/textbringer/themes/tokyonight.rb +70 -0
- data/lib/textbringer/version.rb +1 -1
- data/lib/textbringer/window.rb +29 -36
- data/lib/textbringer.rb +9 -0
- data/textbringer.gemspec +1 -0
- metadata +32 -5
- data/lib/textbringer/faces/basic.rb +0 -8
- data/lib/textbringer/faces/completion.rb +0 -4
- data/lib/textbringer/faces/programming.rb +0 -6
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
# Gruvbox theme for Textbringer
|
|
2
|
+
# Based on https://github.com/morhetz/gruvbox
|
|
3
|
+
#
|
|
4
|
+
# Dark: bright accent colors on warm dark background
|
|
5
|
+
# Light: neutral accent colors on warm light background
|
|
6
|
+
|
|
7
|
+
Textbringer::Theme.define "gruvbox" do |t|
|
|
8
|
+
t.palette :dark do |p|
|
|
9
|
+
# Base tones (dark background, light foreground)
|
|
10
|
+
p.color :bg0, hex: "#262626", ansi: "black"
|
|
11
|
+
p.color :bg1, hex: "#3a3a3a", ansi: "brightblack"
|
|
12
|
+
p.color :bg2, hex: "#4e4e4e", ansi: "brightblack"
|
|
13
|
+
p.color :bg3, hex: "#626262", ansi: "brightblack"
|
|
14
|
+
p.color :bg4, hex: "#767676", ansi: "white"
|
|
15
|
+
p.color :fg1, hex: "#ffd7af", ansi: "white"
|
|
16
|
+
p.color :fg4, hex: "#949494", ansi: "white"
|
|
17
|
+
p.color :gray, hex: "#8a8a8a", ansi: "white"
|
|
18
|
+
|
|
19
|
+
# Bright accent colors
|
|
20
|
+
p.color :red, hex: "#d75f5f", ansi: "red"
|
|
21
|
+
p.color :green, hex: "#afaf00", ansi: "green"
|
|
22
|
+
p.color :yellow, hex: "#ffaf00", ansi: "yellow"
|
|
23
|
+
p.color :blue, hex: "#87afaf", ansi: "blue"
|
|
24
|
+
p.color :purple, hex: "#d787af", ansi: "magenta"
|
|
25
|
+
p.color :aqua, hex: "#87af87", ansi: "cyan"
|
|
26
|
+
p.color :orange, hex: "#ff8700", ansi: "yellow"
|
|
27
|
+
end
|
|
28
|
+
|
|
29
|
+
t.palette :light do |p|
|
|
30
|
+
# Base tones (light background, dark foreground)
|
|
31
|
+
p.color :bg0, hex: "#ffffaf", ansi: "white"
|
|
32
|
+
p.color :bg1, hex: "#ffd7af", ansi: "white"
|
|
33
|
+
p.color :bg2, hex: "#bcbcbc", ansi: "white"
|
|
34
|
+
p.color :bg3, hex: "#a8a8a8", ansi: "white"
|
|
35
|
+
p.color :bg4, hex: "#949494", ansi: "brightblack"
|
|
36
|
+
p.color :fg1, hex: "#3a3a3a", ansi: "black"
|
|
37
|
+
p.color :fg4, hex: "#767676", ansi: "brightblack"
|
|
38
|
+
p.color :gray, hex: "#8a8a8a", ansi: "brightblack"
|
|
39
|
+
|
|
40
|
+
# Neutral accent colors
|
|
41
|
+
p.color :red, hex: "#af0000", ansi: "red"
|
|
42
|
+
p.color :green, hex: "#87af00", ansi: "green"
|
|
43
|
+
p.color :yellow, hex: "#d78700", ansi: "yellow"
|
|
44
|
+
p.color :blue, hex: "#5f8787", ansi: "blue"
|
|
45
|
+
p.color :purple, hex: "#af5f87", ansi: "magenta"
|
|
46
|
+
p.color :aqua, hex: "#5faf87", ansi: "cyan"
|
|
47
|
+
p.color :orange, hex: "#d75f00", ansi: "red"
|
|
48
|
+
end
|
|
49
|
+
|
|
50
|
+
t.default_colors foreground: :fg1, background: :bg0
|
|
51
|
+
|
|
52
|
+
# Programming faces
|
|
53
|
+
t.face :comment, foreground: :gray
|
|
54
|
+
t.face :preprocessing_directive, foreground: :aqua
|
|
55
|
+
t.face :keyword, foreground: :red
|
|
56
|
+
t.face :string, foreground: :green
|
|
57
|
+
t.face :number, foreground: :purple
|
|
58
|
+
t.face :constant, foreground: :purple
|
|
59
|
+
t.face :function_name, foreground: :green
|
|
60
|
+
t.face :type, foreground: :yellow
|
|
61
|
+
t.face :variable, foreground: :blue
|
|
62
|
+
t.face :operator
|
|
63
|
+
t.face :punctuation
|
|
64
|
+
t.face :builtin, foreground: :orange
|
|
65
|
+
t.face :property, foreground: :blue
|
|
66
|
+
|
|
67
|
+
# Basic faces
|
|
68
|
+
t.face :mode_line, foreground: :bg2, background: :fg1, reverse: true
|
|
69
|
+
t.face :link, foreground: :blue, underline: true
|
|
70
|
+
t.face :control
|
|
71
|
+
t.face :region, background: :bg3
|
|
72
|
+
t.face :isearch, foreground: :yellow, background: :bg0, reverse: true
|
|
73
|
+
t.face :floating_window, foreground: :fg1, background: :bg1
|
|
74
|
+
|
|
75
|
+
# Completion faces
|
|
76
|
+
t.face :completion_popup, foreground: :fg1, background: :bg2
|
|
77
|
+
t.face :completion_popup_selected, foreground: :bg2, background: :blue, bold: true
|
|
78
|
+
|
|
79
|
+
# Dired faces
|
|
80
|
+
t.face :dired_directory, foreground: :green, bold: true
|
|
81
|
+
t.face :dired_symlink, foreground: :aqua
|
|
82
|
+
t.face :dired_executable, foreground: :green
|
|
83
|
+
t.face :dired_flagged, foreground: :red
|
|
84
|
+
end
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
# Molokai theme for Textbringer
|
|
2
|
+
# Based on https://github.com/tomasr/molokai
|
|
3
|
+
# Original Monokai theme by Wimer Hazenberg; darker variant by Hamish Stuart Macpherson
|
|
4
|
+
#
|
|
5
|
+
# Colors derived from molokai's 256-color (cterm) values.
|
|
6
|
+
# Dark only.
|
|
7
|
+
|
|
8
|
+
Textbringer::Theme.define "molokai" do |t|
|
|
9
|
+
t.palette :dark do |p|
|
|
10
|
+
# Background / foreground (cterm numbers in comments)
|
|
11
|
+
p.color :bg, hex: "#121212", ansi: "black" # 233 Normal bg
|
|
12
|
+
p.color :bg1, hex: "#262626", ansi: "brightblack" # 235 Visual, region
|
|
13
|
+
p.color :bg2, hex: "#303030", ansi: "brightblack" # 236 LineNr bg, floating windows
|
|
14
|
+
p.color :fg, hex: "#d0d0d0", ansi: "white" # 252 Normal fg
|
|
15
|
+
p.color :comment, hex: "#5f5f5f", ansi: "brightblack" # 59 Comment
|
|
16
|
+
p.color :gray, hex: "#444444", ansi: "brightblack" # 238 StatusLine fg
|
|
17
|
+
p.color :silver, hex: "#dadada", ansi: "white" # 253 StatusLine bg
|
|
18
|
+
p.color :mid_gray, hex: "#6c6c6c", ansi: "brightblack" # 242 PmenuSel bg
|
|
19
|
+
|
|
20
|
+
# Accent colors
|
|
21
|
+
p.color :pink, hex: "#d7005f", ansi: "red" # 161 Keyword, Operator
|
|
22
|
+
p.color :green, hex: "#87ff00", ansi: "green" # 118 Function, PreProc
|
|
23
|
+
p.color :yellow, hex: "#afaf87", ansi: "yellow" # 144 String, Character
|
|
24
|
+
p.color :purple, hex: "#af5fff", ansi: "magenta" # 135 Number, Boolean, Constant
|
|
25
|
+
p.color :orange, hex: "#ff8700", ansi: "yellow" # 208 Identifier, StorageClass
|
|
26
|
+
p.color :cyan, hex: "#5fd7ff", ansi: "cyan" # 81 Type, Define, Structure
|
|
27
|
+
p.color :search, hex: "#ffd787", ansi: "yellow" # 222 Search bg
|
|
28
|
+
end
|
|
29
|
+
|
|
30
|
+
t.default_colors foreground: :fg, background: :bg
|
|
31
|
+
|
|
32
|
+
# Programming faces
|
|
33
|
+
t.face :comment, foreground: :comment
|
|
34
|
+
t.face :preprocessing_directive, foreground: :green
|
|
35
|
+
t.face :keyword, foreground: :pink, bold: true
|
|
36
|
+
t.face :string, foreground: :yellow
|
|
37
|
+
t.face :number, foreground: :purple
|
|
38
|
+
t.face :constant, foreground: :purple, bold: true
|
|
39
|
+
t.face :function_name, foreground: :green
|
|
40
|
+
t.face :type, foreground: :cyan
|
|
41
|
+
t.face :variable, foreground: :orange
|
|
42
|
+
t.face :operator, foreground: :pink
|
|
43
|
+
t.face :punctuation
|
|
44
|
+
t.face :builtin, foreground: :cyan
|
|
45
|
+
t.face :property, foreground: :orange
|
|
46
|
+
|
|
47
|
+
# Basic faces
|
|
48
|
+
# StatusLine: ctermfg=238 (#444444) on ctermbg=253 (#DADADA)
|
|
49
|
+
t.face :mode_line, foreground: :gray, background: :silver
|
|
50
|
+
t.face :link, foreground: :cyan, underline: true
|
|
51
|
+
t.face :control
|
|
52
|
+
t.face :region, background: :bg1
|
|
53
|
+
# Search: ctermfg=0 ctermbg=222
|
|
54
|
+
t.face :isearch, foreground: :bg, background: :search
|
|
55
|
+
t.face :floating_window, foreground: :fg, background: :bg2
|
|
56
|
+
|
|
57
|
+
# Completion faces
|
|
58
|
+
# Pmenu: ctermfg=81 ctermbg=16; PmenuSel: ctermfg=252 ctermbg=242
|
|
59
|
+
t.face :completion_popup, foreground: :cyan, background: :bg
|
|
60
|
+
t.face :completion_popup_selected, foreground: :fg, background: :mid_gray
|
|
61
|
+
|
|
62
|
+
# Dired faces
|
|
63
|
+
t.face :dired_directory, foreground: :green, bold: true
|
|
64
|
+
t.face :dired_symlink, foreground: :cyan
|
|
65
|
+
t.face :dired_executable, foreground: :green
|
|
66
|
+
t.face :dired_flagged, foreground: :pink
|
|
67
|
+
end
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
# Sonokai theme for Textbringer (default style)
|
|
2
|
+
# Based on https://github.com/sainnhe/sonokai
|
|
3
|
+
#
|
|
4
|
+
# A dark theme only. Falls back to dark palette on light terminals.
|
|
5
|
+
|
|
6
|
+
Textbringer::Theme.define "sonokai" do |t|
|
|
7
|
+
t.palette :dark do |p|
|
|
8
|
+
# Base tones
|
|
9
|
+
p.color :black, hex: "#080808", ansi: "black"
|
|
10
|
+
p.color :bg_dim, hex: "#080808", ansi: "black"
|
|
11
|
+
p.color :bg0, hex: "#262626", ansi: "black"
|
|
12
|
+
p.color :bg1, hex: "#303030", ansi: "brightblack"
|
|
13
|
+
p.color :bg2, hex: "#303030", ansi: "brightblack"
|
|
14
|
+
p.color :bg3, hex: "#3a3a3a", ansi: "brightblack"
|
|
15
|
+
p.color :bg4, hex: "#3a3a3a", ansi: "brightblack"
|
|
16
|
+
p.color :fg, hex: "#bcbcbc", ansi: "white"
|
|
17
|
+
p.color :grey, hex: "#949494", ansi: "white"
|
|
18
|
+
p.color :grey_dim, hex: "#585858", ansi: "brightblack"
|
|
19
|
+
|
|
20
|
+
# Accent colors
|
|
21
|
+
p.color :red, hex: "#ff5f5f", ansi: "red"
|
|
22
|
+
p.color :orange, hex: "#ffaf5f", ansi: "yellow"
|
|
23
|
+
p.color :yellow, hex: "#d7af5f", ansi: "yellow"
|
|
24
|
+
p.color :green, hex: "#87af5f", ansi: "green"
|
|
25
|
+
p.color :blue, hex: "#87afd7", ansi: "cyan"
|
|
26
|
+
p.color :purple, hex: "#d787d7", ansi: "magenta"
|
|
27
|
+
end
|
|
28
|
+
|
|
29
|
+
t.default_colors foreground: :fg, background: :bg0
|
|
30
|
+
|
|
31
|
+
# Programming faces (from sonokai highlight groups)
|
|
32
|
+
t.face :comment, foreground: :grey
|
|
33
|
+
t.face :preprocessing_directive, foreground: :red
|
|
34
|
+
t.face :keyword, foreground: :red
|
|
35
|
+
t.face :string, foreground: :yellow
|
|
36
|
+
t.face :number, foreground: :purple
|
|
37
|
+
t.face :constant, foreground: :orange
|
|
38
|
+
t.face :function_name, foreground: :green
|
|
39
|
+
t.face :type, foreground: :blue
|
|
40
|
+
t.face :variable, foreground: :orange
|
|
41
|
+
t.face :operator, foreground: :red
|
|
42
|
+
t.face :punctuation
|
|
43
|
+
t.face :builtin, foreground: :green
|
|
44
|
+
t.face :property, foreground: :blue
|
|
45
|
+
|
|
46
|
+
# Basic faces
|
|
47
|
+
t.face :mode_line, foreground: :fg, background: :bg3
|
|
48
|
+
t.face :link, foreground: :blue, underline: true
|
|
49
|
+
t.face :control
|
|
50
|
+
t.face :region, background: :bg4
|
|
51
|
+
t.face :isearch, foreground: :bg0, background: :green
|
|
52
|
+
t.face :floating_window, foreground: :fg, background: :bg_dim
|
|
53
|
+
|
|
54
|
+
# Completion faces
|
|
55
|
+
t.face :completion_popup, foreground: :fg, background: :bg2
|
|
56
|
+
t.face :completion_popup_selected, foreground: :bg0, background: :blue
|
|
57
|
+
|
|
58
|
+
# Dired faces
|
|
59
|
+
t.face :dired_directory, foreground: :green
|
|
60
|
+
t.face :dired_symlink, foreground: :blue
|
|
61
|
+
t.face :dired_executable, foreground: :green
|
|
62
|
+
t.face :dired_flagged, foreground: :red
|
|
63
|
+
end
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
# Tokyo Night theme for Textbringer
|
|
2
|
+
# Based on https://github.com/folke/tokyonight.nvim
|
|
3
|
+
# Night variant (dark only). GUI hex colors — no cterm values in source.
|
|
4
|
+
# Computed colors derived from tokyonight's blend formulas.
|
|
5
|
+
|
|
6
|
+
Textbringer::Theme.define "tokyonight" do |t|
|
|
7
|
+
t.palette :dark do |p|
|
|
8
|
+
# Background / foreground (night variant)
|
|
9
|
+
p.color :bg, hex: "#1a1b26", ansi: "black" # bg
|
|
10
|
+
p.color :bg_dark, hex: "#16161e", ansi: "black" # bg_dark → popups, statusline
|
|
11
|
+
p.color :bg_hl, hex: "#292e42", ansi: "brightblack" # bg_highlight → floating windows
|
|
12
|
+
p.color :bg_vis, hex: "#283457", ansi: "brightblack" # bg_visual = blend(blue0, 0.4, bg)
|
|
13
|
+
p.color :sel_bg, hex: "#343a55", ansi: "brightblack" # PmenuSel bg = blend(fg_gutter, 0.8, bg)
|
|
14
|
+
p.color :search, hex: "#3d59a1", ansi: "blue" # bg_search = blue0
|
|
15
|
+
p.color :fg, hex: "#c0caf5", ansi: "white" # fg
|
|
16
|
+
p.color :fg_dark, hex: "#a9b1d6", ansi: "white" # fg_dark → statusline fg
|
|
17
|
+
p.color :comment, hex: "#565f89", ansi: "brightblack" # comment
|
|
18
|
+
|
|
19
|
+
# Accent colors
|
|
20
|
+
p.color :blue, hex: "#7aa2f7", ansi: "blue" # Function, Directory, link
|
|
21
|
+
p.color :cyan, hex: "#7dcfff", ansi: "cyan" # PreProc, Keyword (base groups)
|
|
22
|
+
p.color :purple, hex: "#9d7cd8", ansi: "magenta" # @keyword (treesitter default)
|
|
23
|
+
p.color :magenta, hex: "#bb9af7", ansi: "magenta" # Identifier, Statement
|
|
24
|
+
p.color :green, hex: "#9ece6a", ansi: "green" # String
|
|
25
|
+
p.color :teal, hex: "#73daca", ansi: "cyan" # @property, @variable.member
|
|
26
|
+
p.color :orange, hex: "#ff9e64", ansi: "yellow" # Constant
|
|
27
|
+
p.color :red, hex: "#f7768e", ansi: "red" # @variable.builtin, flagged files
|
|
28
|
+
p.color :blue1, hex: "#2ac3de", ansi: "cyan" # Type, Special
|
|
29
|
+
p.color :blue5, hex: "#89ddff", ansi: "cyan" # Operator, punctuation delimiters
|
|
30
|
+
end
|
|
31
|
+
|
|
32
|
+
t.default_colors foreground: :fg, background: :bg
|
|
33
|
+
|
|
34
|
+
# Programming faces
|
|
35
|
+
t.face :comment, foreground: :comment
|
|
36
|
+
t.face :preprocessing_directive, foreground: :cyan # PreProc = c.cyan
|
|
37
|
+
t.face :keyword, foreground: :purple # @keyword = c.purple (treesitter)
|
|
38
|
+
t.face :string, foreground: :green # String = c.green
|
|
39
|
+
t.face :number, foreground: :orange # Number → Constant = c.orange
|
|
40
|
+
t.face :constant, foreground: :orange # Constant = c.orange
|
|
41
|
+
t.face :function_name, foreground: :blue # Function = c.blue
|
|
42
|
+
t.face :type, foreground: :blue1 # Type = c.blue1
|
|
43
|
+
t.face :variable, foreground: :magenta # Identifier = c.magenta
|
|
44
|
+
t.face :operator, foreground: :blue5 # Operator = c.blue5
|
|
45
|
+
t.face :punctuation, foreground: :blue5 # @punctuation.delimiter = c.blue5
|
|
46
|
+
t.face :builtin, foreground: :blue1 # Special = c.blue1
|
|
47
|
+
t.face :property, foreground: :teal # @property = c.green1 (teal)
|
|
48
|
+
|
|
49
|
+
# Basic faces
|
|
50
|
+
# StatusLine: fg = fg_dark, bg = bg_dark
|
|
51
|
+
t.face :mode_line, foreground: :fg_dark, background: :bg_dark
|
|
52
|
+
t.face :link, foreground: :blue, underline: true
|
|
53
|
+
t.face :control
|
|
54
|
+
t.face :region, background: :bg_vis # Visual = bg_visual
|
|
55
|
+
# Search: bg = bg_search (blue0 = #3d59a1), fg = fg
|
|
56
|
+
t.face :isearch, foreground: :fg, background: :search
|
|
57
|
+
t.face :floating_window, foreground: :fg, background: :bg_hl
|
|
58
|
+
|
|
59
|
+
# Completion faces
|
|
60
|
+
# Pmenu: bg = bg_dark, fg = fg
|
|
61
|
+
# PmenuSel: bg = blend(fg_gutter, 0.8, bg) ≈ #343a55
|
|
62
|
+
t.face :completion_popup, foreground: :fg, background: :bg_dark
|
|
63
|
+
t.face :completion_popup_selected, foreground: :fg, background: :sel_bg
|
|
64
|
+
|
|
65
|
+
# Dired faces
|
|
66
|
+
t.face :dired_directory, foreground: :blue, bold: true # Directory = c.blue
|
|
67
|
+
t.face :dired_symlink, foreground: :teal
|
|
68
|
+
t.face :dired_executable, foreground: :green
|
|
69
|
+
t.face :dired_flagged, foreground: :red
|
|
70
|
+
end
|
data/lib/textbringer/version.rb
CHANGED
data/lib/textbringer/window.rb
CHANGED
|
@@ -33,6 +33,8 @@ module Textbringer
|
|
|
33
33
|
@@minibuffer_selected = nil
|
|
34
34
|
@@echo_area = nil
|
|
35
35
|
@@has_colors = false
|
|
36
|
+
@@default_fg = "default"
|
|
37
|
+
@@default_bg = "default"
|
|
36
38
|
|
|
37
39
|
def self.list(include_echo_area: false)
|
|
38
40
|
if include_echo_area
|
|
@@ -133,20 +135,24 @@ module Textbringer
|
|
|
133
135
|
end
|
|
134
136
|
|
|
135
137
|
def self.set_default_colors(fg, bg)
|
|
136
|
-
|
|
137
|
-
|
|
138
|
+
new_fg = fg || @@default_fg
|
|
139
|
+
new_bg = bg || @@default_bg
|
|
140
|
+
Curses.assume_default_colors(Color[new_fg], Color[new_bg])
|
|
141
|
+
@@default_fg = new_fg
|
|
142
|
+
@@default_bg = new_bg
|
|
143
|
+
Face.define(:default, foreground: new_fg, background: new_bg)
|
|
144
|
+
Window.redraw if @@started
|
|
138
145
|
end
|
|
139
146
|
|
|
140
147
|
def self.load_faces
|
|
141
|
-
require_relative "faces/
|
|
142
|
-
require_relative "faces/programming"
|
|
143
|
-
require_relative "faces/completion"
|
|
148
|
+
require_relative "faces/gamegrid"
|
|
144
149
|
end
|
|
145
150
|
|
|
146
151
|
def self.start
|
|
147
152
|
if @@started
|
|
148
153
|
raise EditorError, "Already started"
|
|
149
154
|
end
|
|
155
|
+
Theme.detect_background
|
|
150
156
|
Curses.init_screen
|
|
151
157
|
Curses.noecho
|
|
152
158
|
Curses.raw
|
|
@@ -403,34 +409,17 @@ module Textbringer
|
|
|
403
409
|
@highlight_on = {}
|
|
404
410
|
@highlight_off = {}
|
|
405
411
|
return if !@@has_colors || !CONFIG[:syntax_highlight] || @buffer.binary?
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
"(?<#{name}>#{re})"
|
|
418
|
-
}.join("|")
|
|
419
|
-
re = Regexp.new(re_str)
|
|
420
|
-
names = syntax_table.keys
|
|
421
|
-
s.scan(re) do
|
|
422
|
-
b = base_pos + $`.bytesize
|
|
423
|
-
e = b + $&.bytesize
|
|
424
|
-
if b < @buffer.point && @buffer.point < e
|
|
425
|
-
b = @buffer.point
|
|
426
|
-
end
|
|
427
|
-
name = names.find { |n| $~[n] }
|
|
428
|
-
face = Face[name]
|
|
429
|
-
if face
|
|
430
|
-
@highlight_on[b] = face
|
|
431
|
-
@highlight_off[e] = true
|
|
432
|
-
end
|
|
433
|
-
end
|
|
412
|
+
ctx = HighlightContext.new(
|
|
413
|
+
buffer: @buffer,
|
|
414
|
+
highlight_start: @buffer.point,
|
|
415
|
+
# Use * 4 (max UTF-8 bytes per character) to ensure multi-byte
|
|
416
|
+
# characters near the bottom of the window are fully covered.
|
|
417
|
+
highlight_end: [@buffer.point + columns * (lines - 1) * 4,
|
|
418
|
+
@buffer.point_max].min,
|
|
419
|
+
highlight_on: @highlight_on,
|
|
420
|
+
highlight_off: @highlight_off
|
|
421
|
+
)
|
|
422
|
+
@buffer.mode.highlight(ctx)
|
|
434
423
|
end
|
|
435
424
|
|
|
436
425
|
def redisplay
|
|
@@ -726,7 +715,8 @@ module Textbringer
|
|
|
726
715
|
@mode_line.addstr(" #{line},#{column}")
|
|
727
716
|
@mode_line.addstr(" (#{@buffer.mode_names.join(' ')})")
|
|
728
717
|
@mode_line.addstr(" " * (columns - @mode_line.curx))
|
|
729
|
-
|
|
718
|
+
default = Face[:default]
|
|
719
|
+
@mode_line.attr_set(default&.text_attrs || 0, default&.color_pair || 0)
|
|
730
720
|
@mode_line.noutrefresh
|
|
731
721
|
end
|
|
732
722
|
|
|
@@ -966,6 +956,7 @@ module Textbringer
|
|
|
966
956
|
end
|
|
967
957
|
|
|
968
958
|
def apply_face_attrs(win, face)
|
|
959
|
+
face ||= Face[:default]
|
|
969
960
|
win.attr_set(face&.text_attrs || 0, face&.color_pair || 0)
|
|
970
961
|
end
|
|
971
962
|
|
|
@@ -985,7 +976,8 @@ module Textbringer
|
|
|
985
976
|
end
|
|
986
977
|
win.attr_set(text_attrs, face.color_pair)
|
|
987
978
|
else
|
|
988
|
-
|
|
979
|
+
default = Face[:default]
|
|
980
|
+
win.attr_set(default&.text_attrs || 0, default&.color_pair || 0)
|
|
989
981
|
end
|
|
990
982
|
end
|
|
991
983
|
end
|
|
@@ -1034,7 +1026,8 @@ module Textbringer
|
|
|
1034
1026
|
@window.addstr(@buffer.input_method_status)
|
|
1035
1027
|
end
|
|
1036
1028
|
@window.setpos(0, 0)
|
|
1037
|
-
|
|
1029
|
+
default = Face[:default]
|
|
1030
|
+
@window.attr_set(default&.text_attrs || 0, default&.color_pair || 0)
|
|
1038
1031
|
@in_region = false
|
|
1039
1032
|
@in_isearch = false
|
|
1040
1033
|
@current_hl_face = nil
|
data/lib/textbringer.rb
CHANGED
|
@@ -9,9 +9,12 @@ require_relative "textbringer/keymap"
|
|
|
9
9
|
require_relative "textbringer/utils"
|
|
10
10
|
require_relative "textbringer/color"
|
|
11
11
|
require_relative "textbringer/face"
|
|
12
|
+
require_relative "textbringer/highlight_context"
|
|
13
|
+
require_relative "textbringer/theme"
|
|
12
14
|
require_relative "textbringer/completion_popup"
|
|
13
15
|
require_relative "textbringer/lsp/client"
|
|
14
16
|
require_relative "textbringer/lsp/server_registry"
|
|
17
|
+
require_relative "textbringer/gamegrid"
|
|
15
18
|
require_relative "textbringer/commands"
|
|
16
19
|
require_relative "textbringer/commands/buffers"
|
|
17
20
|
require_relative "textbringer/commands/windows"
|
|
@@ -33,6 +36,9 @@ require_relative "textbringer/commands/ucs_normalize"
|
|
|
33
36
|
require_relative "textbringer/commands/help"
|
|
34
37
|
require_relative "textbringer/commands/completion"
|
|
35
38
|
require_relative "textbringer/commands/lsp"
|
|
39
|
+
require_relative "textbringer/commands/dired"
|
|
40
|
+
require_relative "textbringer/commands/gamegrid"
|
|
41
|
+
require_relative "textbringer/commands/tetris"
|
|
36
42
|
require_relative "textbringer/mode"
|
|
37
43
|
require_relative "textbringer/modes/fundamental_mode"
|
|
38
44
|
require_relative "textbringer/modes/programming_mode"
|
|
@@ -42,6 +48,9 @@ require_relative "textbringer/modes/backtrace_mode"
|
|
|
42
48
|
require_relative "textbringer/modes/completion_list_mode"
|
|
43
49
|
require_relative "textbringer/modes/buffer_list_mode"
|
|
44
50
|
require_relative "textbringer/modes/help_mode"
|
|
51
|
+
require_relative "textbringer/modes/dired_mode"
|
|
52
|
+
require_relative "textbringer/modes/gamegrid_mode"
|
|
53
|
+
require_relative "textbringer/modes/tetris_mode"
|
|
45
54
|
require_relative "textbringer/minor_mode"
|
|
46
55
|
require_relative "textbringer/global_minor_mode"
|
|
47
56
|
require_relative "textbringer/modes/overwrite_mode"
|
data/textbringer.gemspec
CHANGED
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: textbringer
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: '
|
|
4
|
+
version: '25'
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Shugo Maeda
|
|
@@ -9,6 +9,20 @@ bindir: exe
|
|
|
9
9
|
cert_chain: []
|
|
10
10
|
date: 1980-01-02 00:00:00.000000000 Z
|
|
11
11
|
dependencies:
|
|
12
|
+
- !ruby/object:Gem::Dependency
|
|
13
|
+
name: prism
|
|
14
|
+
requirement: !ruby/object:Gem::Requirement
|
|
15
|
+
requirements:
|
|
16
|
+
- - ">="
|
|
17
|
+
- !ruby/object:Gem::Version
|
|
18
|
+
version: '0'
|
|
19
|
+
type: :runtime
|
|
20
|
+
prerelease: false
|
|
21
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
22
|
+
requirements:
|
|
23
|
+
- - ">="
|
|
24
|
+
- !ruby/object:Gem::Version
|
|
25
|
+
version: '0'
|
|
12
26
|
- !ruby/object:Gem::Dependency
|
|
13
27
|
name: rdoc
|
|
14
28
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -363,8 +377,10 @@ files:
|
|
|
363
377
|
- lib/textbringer/commands/completion.rb
|
|
364
378
|
- lib/textbringer/commands/ctags.rb
|
|
365
379
|
- lib/textbringer/commands/dabbrev.rb
|
|
380
|
+
- lib/textbringer/commands/dired.rb
|
|
366
381
|
- lib/textbringer/commands/files.rb
|
|
367
382
|
- lib/textbringer/commands/fill.rb
|
|
383
|
+
- lib/textbringer/commands/gamegrid.rb
|
|
368
384
|
- lib/textbringer/commands/help.rb
|
|
369
385
|
- lib/textbringer/commands/input_method.rb
|
|
370
386
|
- lib/textbringer/commands/isearch.rb
|
|
@@ -376,6 +392,7 @@ files:
|
|
|
376
392
|
- lib/textbringer/commands/register.rb
|
|
377
393
|
- lib/textbringer/commands/replace.rb
|
|
378
394
|
- lib/textbringer/commands/server.rb
|
|
395
|
+
- lib/textbringer/commands/tetris.rb
|
|
379
396
|
- lib/textbringer/commands/ucs_normalize.rb
|
|
380
397
|
- lib/textbringer/commands/windows.rb
|
|
381
398
|
- lib/textbringer/completion_popup.rb
|
|
@@ -384,11 +401,11 @@ files:
|
|
|
384
401
|
- lib/textbringer/default_output.rb
|
|
385
402
|
- lib/textbringer/errors.rb
|
|
386
403
|
- lib/textbringer/face.rb
|
|
387
|
-
- lib/textbringer/faces/
|
|
388
|
-
- lib/textbringer/faces/completion.rb
|
|
389
|
-
- lib/textbringer/faces/programming.rb
|
|
404
|
+
- lib/textbringer/faces/gamegrid.rb
|
|
390
405
|
- lib/textbringer/floating_window.rb
|
|
406
|
+
- lib/textbringer/gamegrid.rb
|
|
391
407
|
- lib/textbringer/global_minor_mode.rb
|
|
408
|
+
- lib/textbringer/highlight_context.rb
|
|
392
409
|
- lib/textbringer/input_method.rb
|
|
393
410
|
- lib/textbringer/input_methods/hangul_input_method.rb
|
|
394
411
|
- lib/textbringer/input_methods/hiragana_input_method.rb
|
|
@@ -404,14 +421,24 @@ files:
|
|
|
404
421
|
- lib/textbringer/modes/buffer_list_mode.rb
|
|
405
422
|
- lib/textbringer/modes/c_mode.rb
|
|
406
423
|
- lib/textbringer/modes/completion_list_mode.rb
|
|
424
|
+
- lib/textbringer/modes/dired_mode.rb
|
|
407
425
|
- lib/textbringer/modes/fundamental_mode.rb
|
|
426
|
+
- lib/textbringer/modes/gamegrid_mode.rb
|
|
408
427
|
- lib/textbringer/modes/help_mode.rb
|
|
409
428
|
- lib/textbringer/modes/overwrite_mode.rb
|
|
410
429
|
- lib/textbringer/modes/programming_mode.rb
|
|
411
430
|
- lib/textbringer/modes/ruby_mode.rb
|
|
431
|
+
- lib/textbringer/modes/tetris_mode.rb
|
|
412
432
|
- lib/textbringer/modes/transient_mark_mode.rb
|
|
413
433
|
- lib/textbringer/plugin.rb
|
|
414
434
|
- lib/textbringer/ring.rb
|
|
435
|
+
- lib/textbringer/theme.rb
|
|
436
|
+
- lib/textbringer/themes/catppuccin.rb
|
|
437
|
+
- lib/textbringer/themes/github.rb
|
|
438
|
+
- lib/textbringer/themes/gruvbox.rb
|
|
439
|
+
- lib/textbringer/themes/molokai.rb
|
|
440
|
+
- lib/textbringer/themes/sonokai.rb
|
|
441
|
+
- lib/textbringer/themes/tokyonight.rb
|
|
415
442
|
- lib/textbringer/utils.rb
|
|
416
443
|
- lib/textbringer/version.rb
|
|
417
444
|
- lib/textbringer/window.rb
|
|
@@ -488,7 +515,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
488
515
|
- !ruby/object:Gem::Version
|
|
489
516
|
version: '0'
|
|
490
517
|
requirements: []
|
|
491
|
-
rubygems_version: 4.0.
|
|
518
|
+
rubygems_version: 4.0.6
|
|
492
519
|
specification_version: 4
|
|
493
520
|
summary: An Emacs-like text editor
|
|
494
521
|
test_files: []
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
module Textbringer
|
|
2
|
-
Face.define :mode_line, reverse: true
|
|
3
|
-
Face.define :link, foreground: "blue", bold: true
|
|
4
|
-
Face.define :control
|
|
5
|
-
Face.define :region, background: "blue", foreground: "white"
|
|
6
|
-
Face.define :isearch, background: "yellow", foreground: "black"
|
|
7
|
-
Face.define :floating_window, background: "cyan", foreground: "black"
|
|
8
|
-
end
|