textbringer 26 → 28
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/README.md +7 -1
- data/lib/textbringer/commands/clipboard.rb +7 -4
- data/lib/textbringer/commands/fill.rb +152 -59
- data/lib/textbringer/commands/misc.rb +30 -0
- data/lib/textbringer/face.rb +18 -0
- data/lib/textbringer/input_methods/skk_input_method.rb +710 -74
- data/lib/textbringer/keymap.rb +2 -0
- data/lib/textbringer/mode.rb +19 -0
- data/lib/textbringer/modes/c_mode.rb +6 -0
- data/lib/textbringer/modes/programming_mode.rb +3 -6
- data/lib/textbringer/modes/ruby_mode.rb +27 -11
- data/lib/textbringer/themes/iceberg.rb +88 -0
- data/lib/textbringer/themes/kanagawa.rb +94 -0
- data/lib/textbringer/version.rb +1 -1
- data/lib/textbringer/window.rb +4 -1
- data/textbringer.gemspec +1 -2
- metadata +14 -26
data/lib/textbringer/keymap.rb
CHANGED
|
@@ -167,6 +167,8 @@ module Textbringer
|
|
|
167
167
|
GLOBAL_MAP.define_key(:npage, :scroll_up)
|
|
168
168
|
GLOBAL_MAP.define_key("\M-v", :scroll_down)
|
|
169
169
|
GLOBAL_MAP.define_key(:ppage, :scroll_down)
|
|
170
|
+
GLOBAL_MAP.define_key("\C-x]", :forward_page)
|
|
171
|
+
GLOBAL_MAP.define_key("\C-x[", :backward_page)
|
|
170
172
|
GLOBAL_MAP.define_key("\C-x0", :delete_window)
|
|
171
173
|
GLOBAL_MAP.define_key("\C-x1", :delete_other_windows)
|
|
172
174
|
GLOBAL_MAP.define_key("\C-x2", :split_window)
|
data/lib/textbringer/mode.rb
CHANGED
|
@@ -78,6 +78,25 @@ module Textbringer
|
|
|
78
78
|
self.class.mode_name
|
|
79
79
|
end
|
|
80
80
|
|
|
81
|
+
# The string that starts a line comment in this mode, or nil if the
|
|
82
|
+
# mode has no line comments.
|
|
83
|
+
def comment_start
|
|
84
|
+
nil
|
|
85
|
+
end
|
|
86
|
+
|
|
87
|
+
# A regexp matching what begins a comment line: the indentation, the
|
|
88
|
+
# comment leader, and the blanks after it. indent_new_comment_line
|
|
89
|
+
# repeats the match on the new line, and fill_paragraph uses it to
|
|
90
|
+
# tell comment lines from code and to keep the leader on each filled
|
|
91
|
+
# line. nil if the mode has no comment lines. Modes whose block
|
|
92
|
+
# comments continue with a leader of their own, as C's do with " * ",
|
|
93
|
+
# override this.
|
|
94
|
+
def comment_prefix_regexp
|
|
95
|
+
if comment_start
|
|
96
|
+
/[ \t]*#{Regexp.quote(comment_start)}+[ \t]*/
|
|
97
|
+
end
|
|
98
|
+
end
|
|
99
|
+
|
|
81
100
|
def syntax_table
|
|
82
101
|
self.class.syntax_table
|
|
83
102
|
end
|
|
@@ -38,6 +38,12 @@ module Textbringer
|
|
|
38
38
|
"//"
|
|
39
39
|
end
|
|
40
40
|
|
|
41
|
+
# "//" comments, and the " * " lines of a block comment. The "/*"
|
|
42
|
+
# and " */" lines are not matched, so they bound the paragraph.
|
|
43
|
+
def comment_prefix_regexp
|
|
44
|
+
/[ \t]*(?:\/\/+|\*+(?![*\/]))[ \t]*/
|
|
45
|
+
end
|
|
46
|
+
|
|
41
47
|
def initialize(buffer)
|
|
42
48
|
super(buffer)
|
|
43
49
|
@buffer[:indent_level] = CONFIG[:c_indent_level]
|
|
@@ -98,13 +98,14 @@ module Textbringer
|
|
|
98
98
|
end
|
|
99
99
|
|
|
100
100
|
def indent_new_comment_line
|
|
101
|
-
|
|
101
|
+
re = comment_prefix_regexp
|
|
102
|
+
if re.nil?
|
|
102
103
|
@buffer.newline
|
|
103
104
|
return
|
|
104
105
|
end
|
|
105
106
|
s = @buffer.save_excursion {
|
|
106
107
|
@buffer.beginning_of_line
|
|
107
|
-
if @buffer.looking_at?(
|
|
108
|
+
if @buffer.looking_at?(re)
|
|
108
109
|
@buffer.match_string(0)
|
|
109
110
|
else
|
|
110
111
|
""
|
|
@@ -113,10 +114,6 @@ module Textbringer
|
|
|
113
114
|
@buffer.insert("\n" + s)
|
|
114
115
|
end
|
|
115
116
|
|
|
116
|
-
def comment_start
|
|
117
|
-
nil
|
|
118
|
-
end
|
|
119
|
-
|
|
120
117
|
private
|
|
121
118
|
|
|
122
119
|
def calculate_indentation
|
|
@@ -8,7 +8,7 @@ module Textbringer
|
|
|
8
8
|
class RubyMode < ProgrammingMode
|
|
9
9
|
self.file_name_pattern =
|
|
10
10
|
/\A(?:.*\.(?:rb|ru|rake|thor|jbuilder|gemspec|podspec)|
|
|
11
|
-
(?:Gem|Rake|Cap|Thor|Vagrant|Guard|Pod)file)\z/ix
|
|
11
|
+
(?:Gem|Rake|Cap|Thor|Vagrant|Guard|Pod)file|.irbrc)\z/ix
|
|
12
12
|
self.interpreter_name_pattern = /ruby/i
|
|
13
13
|
|
|
14
14
|
def comment_start
|
|
@@ -153,6 +153,7 @@ module Textbringer
|
|
|
153
153
|
KEYWORD_BEGIN_UPCASE: :keyword, KEYWORD_BREAK: :keyword,
|
|
154
154
|
KEYWORD_CASE: :keyword, KEYWORD_CLASS: :keyword, KEYWORD_DEF: :keyword,
|
|
155
155
|
KEYWORD_DEFINED: :keyword, KEYWORD_DO: :keyword,
|
|
156
|
+
KEYWORD_DO_BLOCK: :keyword, KEYWORD_DO_LAMBDA: :keyword,
|
|
156
157
|
KEYWORD_DO_LOOP: :keyword, KEYWORD_ELSE: :keyword,
|
|
157
158
|
KEYWORD_ELSIF: :keyword, KEYWORD_END: :keyword,
|
|
158
159
|
KEYWORD_END_UPCASE: :keyword, KEYWORD_ENSURE: :keyword,
|
|
@@ -182,7 +183,7 @@ module Textbringer
|
|
|
182
183
|
SYMBOL_BEGIN: :string, REGEXP_BEGIN: :string, REGEXP_END: :string,
|
|
183
184
|
PERCENT_LOWER_I: :string, PERCENT_UPPER_I: :string,
|
|
184
185
|
PERCENT_LOWER_W: :string, PERCENT_UPPER_W: :string,
|
|
185
|
-
PERCENT_LOWER_X: :string,
|
|
186
|
+
PERCENT_LOWER_X: :string, XSTRING_BEGIN: :string,
|
|
186
187
|
HEREDOC_START: :string, HEREDOC_END: :string,
|
|
187
188
|
LABEL: :property,
|
|
188
189
|
|
|
@@ -225,10 +226,12 @@ module Textbringer
|
|
|
225
226
|
# Punctuation
|
|
226
227
|
DOT: :punctuation, COLON_COLON: :punctuation,
|
|
227
228
|
SEMICOLON: :punctuation, COMMA: :punctuation,
|
|
228
|
-
PARENTHESIS_LEFT: :punctuation,
|
|
229
|
+
PARENTHESIS_LEFT: :punctuation, PARENTHESIS_LEFT_GROUPING: :punctuation,
|
|
230
|
+
PARENTHESIS_RIGHT: :punctuation,
|
|
229
231
|
BRACKET_LEFT: :punctuation, BRACKET_LEFT_ARRAY: :punctuation,
|
|
230
232
|
BRACKET_RIGHT: :punctuation,
|
|
231
|
-
BRACE_LEFT: :punctuation,
|
|
233
|
+
BRACE_LEFT: :punctuation, BRACE_LEFT_HASH: :punctuation,
|
|
234
|
+
BRACE_LEFT_ARGUMENT: :punctuation, BRACE_RIGHT: :punctuation,
|
|
232
235
|
QUESTION_MARK: :punctuation, COLON: :punctuation,
|
|
233
236
|
LAMBDA_BEGIN: :punctuation,
|
|
234
237
|
|
|
@@ -268,6 +271,17 @@ module Textbringer
|
|
|
268
271
|
LAMBDA_BEGIN: :BRACE_RIGHT,
|
|
269
272
|
}
|
|
270
273
|
|
|
274
|
+
# Newer versions of Prism split some token types. Map them to the
|
|
275
|
+
# original types for indentation.
|
|
276
|
+
NORMALIZED_TOKEN_TYPES = {
|
|
277
|
+
BRACE_LEFT_HASH: :BRACE_LEFT,
|
|
278
|
+
BRACE_LEFT_ARGUMENT: :BRACE_LEFT,
|
|
279
|
+
PARENTHESIS_LEFT_GROUPING: :PARENTHESIS_LEFT,
|
|
280
|
+
KEYWORD_DO_BLOCK: :KEYWORD_DO,
|
|
281
|
+
KEYWORD_DO_LAMBDA: :KEYWORD_DO,
|
|
282
|
+
NEWLINE_TERMINATOR: :NEWLINE,
|
|
283
|
+
}.freeze
|
|
284
|
+
|
|
271
285
|
INDENT_BEG_RE = /^([ \t]*)(class|module|def|if|unless|case|while|until|for|begin)\b/
|
|
272
286
|
|
|
273
287
|
def space_width(s)
|
|
@@ -292,6 +306,7 @@ module Textbringer
|
|
|
292
306
|
Prism.lex(source).value.filter_map { |token, _state|
|
|
293
307
|
type = token.type
|
|
294
308
|
next if type == :EOF
|
|
309
|
+
type = NORMALIZED_TOKEN_TYPES.fetch(type, type)
|
|
295
310
|
loc = token.location
|
|
296
311
|
[[loc.start_line, loc.start_column], type, token.value]
|
|
297
312
|
}
|
|
@@ -512,13 +527,14 @@ module Textbringer
|
|
|
512
527
|
elsif node.type == :alias_method_node
|
|
513
528
|
add_alias_method_name_locs(node.new_name)
|
|
514
529
|
add_alias_method_name_locs(node.old_name)
|
|
515
|
-
elsif (node.type == :call_node &&
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
530
|
+
elsif ((node.type == :call_node &&
|
|
531
|
+
!(node.call_operator_loc.nil? && OPERATORS.include?(node.name)) && # exclude operators
|
|
532
|
+
!((node.call_operator_loc.nil? || node.call_operator_loc.slice == "::") && # exclude constants
|
|
533
|
+
/\A\p{Upper}/.match?(node.name))) ||
|
|
534
|
+
node.type == :call_operator_write_node ||
|
|
535
|
+
node.type == :call_and_write_node ||
|
|
536
|
+
node.type == :call_or_write_node) &&
|
|
537
|
+
node.message_loc
|
|
522
538
|
@prism_method_name_locs[node.message_loc.start_offset] = true
|
|
523
539
|
end
|
|
524
540
|
node.compact_child_nodes.each { |child| collect_method_name_locs(child) }
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
# Iceberg theme for Textbringer
|
|
2
|
+
# Based on https://github.com/cocopon/iceberg.vim
|
|
3
|
+
# A well-designed dark blue color scheme.
|
|
4
|
+
#
|
|
5
|
+
# GUI hex values from the source's guifg/guibg definitions.
|
|
6
|
+
|
|
7
|
+
Textbringer::Theme.define "iceberg" do |t|
|
|
8
|
+
t.palette :dark do |p|
|
|
9
|
+
# Background / foreground
|
|
10
|
+
p.color :bg, hex: "#161821", ansi: "black" # Normal guibg
|
|
11
|
+
p.color :bg1, hex: "#1e2132", ansi: "black" # terminal color0
|
|
12
|
+
p.color :bg_vis, hex: "#272c42", ansi: "brightblack" # Visual guibg
|
|
13
|
+
p.color :bg_popup, hex: "#3d425b", ansi: "brightblack" # Pmenu guibg
|
|
14
|
+
p.color :bg_sel, hex: "#5b6389", ansi: "brightblack" # PmenuSel guibg
|
|
15
|
+
p.color :fg, hex: "#c6c8d1", ansi: "white" # Normal guifg
|
|
16
|
+
p.color :fg_sel, hex: "#eff0f4", ansi: "white" # PmenuSel guifg
|
|
17
|
+
p.color :comment, hex: "#6b7089", ansi: "brightblack" # Comment guifg
|
|
18
|
+
p.color :status_bg, hex: "#818596", ansi: "white" # StatusLine (reverse)
|
|
19
|
+
p.color :status_fg, hex: "#17171b", ansi: "black" # StatusLine (reverse)
|
|
20
|
+
|
|
21
|
+
# Accent colors
|
|
22
|
+
p.color :blue, hex: "#84a0c6", ansi: "blue" # Statement/Keyword guifg
|
|
23
|
+
p.color :cyan, hex: "#89b8c2", ansi: "cyan" # String/Identifier guifg
|
|
24
|
+
p.color :green, hex: "#b4be82", ansi: "green" # PreProc/Special guifg
|
|
25
|
+
p.color :purple, hex: "#a093c7", ansi: "magenta" # Constant guifg
|
|
26
|
+
p.color :orange, hex: "#e4aa80", ansi: "yellow" # Search guibg
|
|
27
|
+
p.color :search_fg, hex: "#392313", ansi: "black" # Search guifg
|
|
28
|
+
p.color :red, hex: "#e27878", ansi: "red" # terminal color1
|
|
29
|
+
end
|
|
30
|
+
|
|
31
|
+
t.palette :light do |p|
|
|
32
|
+
# Background / foreground
|
|
33
|
+
p.color :bg, hex: "#e8e9ec", ansi: "white" # Normal guibg
|
|
34
|
+
p.color :bg1, hex: "#dcdfe7", ansi: "white" # terminal color0
|
|
35
|
+
p.color :bg_vis, hex: "#c9cdd7", ansi: "white" # Visual guibg
|
|
36
|
+
p.color :bg_popup, hex: "#cad0de", ansi: "white" # Pmenu guibg
|
|
37
|
+
p.color :bg_sel, hex: "#a7b2cd", ansi: "white" # PmenuSel guibg
|
|
38
|
+
p.color :fg, hex: "#33374c", ansi: "black" # Normal guifg
|
|
39
|
+
p.color :fg_sel, hex: "#33374c", ansi: "black" # PmenuSel guifg
|
|
40
|
+
p.color :comment, hex: "#8389a3", ansi: "brightblack" # Comment guifg
|
|
41
|
+
p.color :status_bg, hex: "#757ca3", ansi: "brightblack" # StatusLine (reverse)
|
|
42
|
+
p.color :status_fg, hex: "#e8e9ec", ansi: "white" # StatusLine (reverse)
|
|
43
|
+
|
|
44
|
+
# Accent colors
|
|
45
|
+
p.color :blue, hex: "#2d539e", ansi: "blue" # Statement/Keyword guifg
|
|
46
|
+
p.color :cyan, hex: "#3f83a6", ansi: "cyan" # String/Identifier guifg
|
|
47
|
+
p.color :green, hex: "#668e3d", ansi: "green" # PreProc/Special guifg
|
|
48
|
+
p.color :purple, hex: "#7759b4", ansi: "magenta" # Constant guifg
|
|
49
|
+
p.color :orange, hex: "#eac6ad", ansi: "yellow" # Search guibg
|
|
50
|
+
p.color :search_fg, hex: "#85512c", ansi: "black" # Search guifg
|
|
51
|
+
p.color :red, hex: "#cc517a", ansi: "red" # terminal color1
|
|
52
|
+
end
|
|
53
|
+
|
|
54
|
+
t.default_colors foreground: :fg, background: :bg
|
|
55
|
+
|
|
56
|
+
# Programming faces
|
|
57
|
+
t.face :comment, foreground: :comment
|
|
58
|
+
t.face :preprocessing_directive, foreground: :green # PreProc
|
|
59
|
+
t.face :keyword, foreground: :blue # Statement
|
|
60
|
+
t.face :string, foreground: :cyan # String
|
|
61
|
+
t.face :number, foreground: :purple # Constant
|
|
62
|
+
t.face :constant, foreground: :purple # Constant
|
|
63
|
+
t.face :function_name, foreground: :blue # Function
|
|
64
|
+
t.face :type, foreground: :blue # Type
|
|
65
|
+
t.face :variable, foreground: :cyan # Identifier
|
|
66
|
+
t.face :operator, foreground: :blue # Operator
|
|
67
|
+
t.face :punctuation # Delimiter = fg
|
|
68
|
+
t.face :builtin, foreground: :green # Special
|
|
69
|
+
t.face :property, foreground: :cyan # Identifier
|
|
70
|
+
|
|
71
|
+
# Basic faces
|
|
72
|
+
t.face :mode_line, foreground: :status_fg, background: :status_bg
|
|
73
|
+
t.face :link, foreground: :cyan, underline: true
|
|
74
|
+
t.face :control
|
|
75
|
+
t.face :region, background: :bg_vis
|
|
76
|
+
t.face :isearch, foreground: :search_fg, background: :orange
|
|
77
|
+
t.face :floating_window, foreground: :fg, background: :bg_popup
|
|
78
|
+
|
|
79
|
+
# Completion faces
|
|
80
|
+
t.face :completion_popup, foreground: :fg, background: :bg_popup
|
|
81
|
+
t.face :completion_popup_selected, foreground: :fg_sel, background: :bg_sel
|
|
82
|
+
|
|
83
|
+
# Dired faces
|
|
84
|
+
t.face :dired_directory, foreground: :cyan # Directory
|
|
85
|
+
t.face :dired_symlink, foreground: :green # Tag → Special
|
|
86
|
+
t.face :dired_executable, foreground: :green
|
|
87
|
+
t.face :dired_flagged, foreground: :red
|
|
88
|
+
end
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
# Kanagawa theme for Textbringer
|
|
2
|
+
# Based on https://github.com/rebelot/kanagawa.nvim
|
|
3
|
+
# Wave (dark) and Lotus (light) variants.
|
|
4
|
+
#
|
|
5
|
+
# GUI hex values from the source palette and theme definitions.
|
|
6
|
+
|
|
7
|
+
Textbringer::Theme.define "kanagawa" do |t|
|
|
8
|
+
t.palette :dark do |p|
|
|
9
|
+
# Background / foreground (wave variant)
|
|
10
|
+
p.color :bg, hex: "#1f1f28", ansi: "black" # sumiInk3 – Normal bg
|
|
11
|
+
p.color :bg_dark, hex: "#181820", ansi: "black" # sumiInk1 – StatusLine bg
|
|
12
|
+
p.color :bg_popup, hex: "#223249", ansi: "brightblack" # waveBlue1 – Pmenu bg
|
|
13
|
+
p.color :bg_vis, hex: "#223249", ansi: "brightblack" # waveBlue1 – Visual bg
|
|
14
|
+
p.color :bg_sel, hex: "#2d4f67", ansi: "brightblack" # waveBlue2 – PmenuSel bg, Search bg
|
|
15
|
+
p.color :bg_float, hex: "#16161d", ansi: "black" # sumiInk0 – float bg
|
|
16
|
+
p.color :fg, hex: "#dcd7ba", ansi: "white" # fujiWhite – Normal fg
|
|
17
|
+
p.color :fg_dim, hex: "#c8c093", ansi: "white" # oldWhite – StatusLine fg, float fg
|
|
18
|
+
|
|
19
|
+
# Syntax colors
|
|
20
|
+
p.color :comment, hex: "#727169", ansi: "brightblack" # fujiGray – Comment
|
|
21
|
+
p.color :string, hex: "#98bb6c", ansi: "green" # springGreen – String
|
|
22
|
+
p.color :pink, hex: "#d27e99", ansi: "magenta" # sakuraPink – Number
|
|
23
|
+
p.color :orange, hex: "#ffa066", ansi: "yellow" # surimiOrange – Constant
|
|
24
|
+
p.color :yellow, hex: "#e6c384", ansi: "yellow" # carpYellow – Identifier
|
|
25
|
+
p.color :blue, hex: "#7e9cd8", ansi: "blue" # crystalBlue – Function
|
|
26
|
+
p.color :violet, hex: "#957fb8", ansi: "magenta" # oniViolet – Keyword/Statement
|
|
27
|
+
p.color :gold, hex: "#c0a36e", ansi: "yellow" # boatYellow2 – Operator
|
|
28
|
+
p.color :red, hex: "#e46876", ansi: "red" # waveRed – PreProc
|
|
29
|
+
p.color :aqua, hex: "#7aa89f", ansi: "cyan" # waveAqua2 – Type
|
|
30
|
+
p.color :light_blue, hex: "#9cabca", ansi: "cyan" # springViolet2 – Punctuation
|
|
31
|
+
p.color :spring_blue, hex: "#7fb4ca", ansi: "cyan" # springBlue – Special/Builtin
|
|
32
|
+
end
|
|
33
|
+
|
|
34
|
+
t.palette :light do |p|
|
|
35
|
+
# Background / foreground (lotus variant)
|
|
36
|
+
p.color :bg, hex: "#f2ecbc", ansi: "white" # lotusWhite3 – Normal bg
|
|
37
|
+
p.color :bg_dark, hex: "#dcd7ba", ansi: "white" # lotusGray – StatusLine bg
|
|
38
|
+
p.color :bg_popup, hex: "#c7d7e0", ansi: "white" # lotusBlue1 – Pmenu bg
|
|
39
|
+
p.color :bg_sel, hex: "#9fb5c9", ansi: "white" # lotusBlue3 – PmenuSel bg, Search bg
|
|
40
|
+
p.color :bg_float, hex: "#d5cea3", ansi: "white" # lotusWhite0 – float bg
|
|
41
|
+
p.color :bg_vis, hex: "#c9cbd1", ansi: "white" # lotusViolet3 – Visual bg
|
|
42
|
+
p.color :fg, hex: "#545464", ansi: "black" # lotusInk1 – Normal fg
|
|
43
|
+
p.color :fg_dim, hex: "#43436c", ansi: "black" # lotusInk2 – StatusLine fg
|
|
44
|
+
|
|
45
|
+
# Syntax colors
|
|
46
|
+
p.color :comment, hex: "#8a8980", ansi: "brightblack" # lotusGray3 – Comment
|
|
47
|
+
p.color :string, hex: "#6f894e", ansi: "green" # lotusGreen – String
|
|
48
|
+
p.color :pink, hex: "#b35b79", ansi: "magenta" # lotusPink – Number
|
|
49
|
+
p.color :orange, hex: "#cc6d00", ansi: "yellow" # lotusOrange – Constant
|
|
50
|
+
p.color :yellow, hex: "#77713f", ansi: "yellow" # lotusYellow – Identifier
|
|
51
|
+
p.color :blue, hex: "#4d699b", ansi: "blue" # lotusBlue4 – Function
|
|
52
|
+
p.color :violet, hex: "#624c83", ansi: "magenta" # lotusViolet4 – Keyword/Statement
|
|
53
|
+
p.color :gold, hex: "#836f4a", ansi: "yellow" # lotusYellow2 – Operator
|
|
54
|
+
p.color :red, hex: "#c84053", ansi: "red" # lotusRed – PreProc
|
|
55
|
+
p.color :aqua, hex: "#597b75", ansi: "cyan" # lotusAqua – Type
|
|
56
|
+
p.color :light_blue, hex: "#4e8ca2", ansi: "cyan" # lotusTeal1 – Punctuation
|
|
57
|
+
p.color :spring_blue, hex: "#6693bf", ansi: "cyan" # lotusTeal2 – Special/Builtin
|
|
58
|
+
end
|
|
59
|
+
|
|
60
|
+
t.default_colors foreground: :fg, background: :bg
|
|
61
|
+
|
|
62
|
+
# Programming faces
|
|
63
|
+
t.face :comment, foreground: :comment
|
|
64
|
+
t.face :string, foreground: :string # syn.string
|
|
65
|
+
t.face :number, foreground: :pink # syn.number
|
|
66
|
+
t.face :constant, foreground: :orange # syn.constant
|
|
67
|
+
t.face :keyword, foreground: :violet, bold: true # syn.keyword + statementStyle
|
|
68
|
+
t.face :preprocessing_directive, foreground: :red # syn.preproc
|
|
69
|
+
t.face :function_name, foreground: :blue # syn.fun
|
|
70
|
+
t.face :type, foreground: :aqua # syn.type
|
|
71
|
+
t.face :variable, foreground: :yellow # syn.identifier
|
|
72
|
+
t.face :operator, foreground: :gold # syn.operator
|
|
73
|
+
t.face :punctuation, foreground: :light_blue # syn.punct
|
|
74
|
+
t.face :builtin, foreground: :spring_blue # syn.special1
|
|
75
|
+
t.face :property, foreground: :yellow # syn.identifier (carpYellow)
|
|
76
|
+
|
|
77
|
+
# Basic faces
|
|
78
|
+
t.face :mode_line, foreground: :fg_dim, background: :bg_dark
|
|
79
|
+
t.face :link, foreground: :blue, underline: true
|
|
80
|
+
t.face :control
|
|
81
|
+
t.face :region, background: :bg_vis # Visual = waveBlue1 / lotusViolet3
|
|
82
|
+
t.face :isearch, foreground: :fg, background: :bg_sel # bg_search
|
|
83
|
+
t.face :floating_window, foreground: :fg_dim, background: :bg_float
|
|
84
|
+
|
|
85
|
+
# Completion faces
|
|
86
|
+
t.face :completion_popup, foreground: :fg, background: :bg_popup
|
|
87
|
+
t.face :completion_popup_selected, foreground: :fg, background: :bg_sel
|
|
88
|
+
|
|
89
|
+
# Dired faces
|
|
90
|
+
t.face :dired_directory, foreground: :blue, bold: true # Directory
|
|
91
|
+
t.face :dired_symlink, foreground: :spring_blue # special1
|
|
92
|
+
t.face :dired_executable, foreground: :string # springGreen / lotusGreen
|
|
93
|
+
t.face :dired_flagged, foreground: :red
|
|
94
|
+
end
|
data/lib/textbringer/version.rb
CHANGED
data/lib/textbringer/window.rb
CHANGED
|
@@ -137,9 +137,12 @@ module Textbringer
|
|
|
137
137
|
def self.set_default_colors(fg, bg)
|
|
138
138
|
new_fg = fg || @@default_fg
|
|
139
139
|
new_bg = bg || @@default_bg
|
|
140
|
-
|
|
140
|
+
fg_num = Color[new_fg]
|
|
141
|
+
bg_num = Color[new_bg]
|
|
142
|
+
Curses.assume_default_colors(fg_num, bg_num)
|
|
141
143
|
@@default_fg = new_fg
|
|
142
144
|
@@default_bg = new_bg
|
|
145
|
+
Face.set_default_color_numbers(fg_num, bg_num)
|
|
143
146
|
Face.define(:default, foreground: new_fg, background: new_bg)
|
|
144
147
|
Window.redraw if @@started
|
|
145
148
|
end
|
data/textbringer.gemspec
CHANGED
|
@@ -27,11 +27,10 @@ Gem::Specification.new do |spec|
|
|
|
27
27
|
spec.add_runtime_dependency "irb"
|
|
28
28
|
spec.add_runtime_dependency "nkf"
|
|
29
29
|
spec.add_runtime_dependency "drb"
|
|
30
|
+
spec.add_runtime_dependency "fiddle" # for reline on Windows
|
|
30
31
|
spec.add_runtime_dependency "curses", ">= 1.2.7"
|
|
31
32
|
spec.add_runtime_dependency "unicode-display_width", ">= 1.1"
|
|
32
33
|
spec.add_runtime_dependency "clipboard", ">= 1.1"
|
|
33
|
-
spec.add_runtime_dependency "fiddle"
|
|
34
|
-
spec.add_runtime_dependency "fiddley", ">= 0.0.5"
|
|
35
34
|
spec.add_runtime_dependency "editorconfig"
|
|
36
35
|
spec.add_runtime_dependency "warning"
|
|
37
36
|
spec.add_runtime_dependency "unicode-name"
|
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: '28'
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Shugo Maeda
|
|
@@ -94,35 +94,35 @@ dependencies:
|
|
|
94
94
|
- !ruby/object:Gem::Version
|
|
95
95
|
version: '0'
|
|
96
96
|
- !ruby/object:Gem::Dependency
|
|
97
|
-
name:
|
|
97
|
+
name: fiddle
|
|
98
98
|
requirement: !ruby/object:Gem::Requirement
|
|
99
99
|
requirements:
|
|
100
100
|
- - ">="
|
|
101
101
|
- !ruby/object:Gem::Version
|
|
102
|
-
version:
|
|
102
|
+
version: '0'
|
|
103
103
|
type: :runtime
|
|
104
104
|
prerelease: false
|
|
105
105
|
version_requirements: !ruby/object:Gem::Requirement
|
|
106
106
|
requirements:
|
|
107
107
|
- - ">="
|
|
108
108
|
- !ruby/object:Gem::Version
|
|
109
|
-
version:
|
|
109
|
+
version: '0'
|
|
110
110
|
- !ruby/object:Gem::Dependency
|
|
111
|
-
name:
|
|
111
|
+
name: curses
|
|
112
112
|
requirement: !ruby/object:Gem::Requirement
|
|
113
113
|
requirements:
|
|
114
114
|
- - ">="
|
|
115
115
|
- !ruby/object:Gem::Version
|
|
116
|
-
version:
|
|
116
|
+
version: 1.2.7
|
|
117
117
|
type: :runtime
|
|
118
118
|
prerelease: false
|
|
119
119
|
version_requirements: !ruby/object:Gem::Requirement
|
|
120
120
|
requirements:
|
|
121
121
|
- - ">="
|
|
122
122
|
- !ruby/object:Gem::Version
|
|
123
|
-
version:
|
|
123
|
+
version: 1.2.7
|
|
124
124
|
- !ruby/object:Gem::Dependency
|
|
125
|
-
name:
|
|
125
|
+
name: unicode-display_width
|
|
126
126
|
requirement: !ruby/object:Gem::Requirement
|
|
127
127
|
requirements:
|
|
128
128
|
- - ">="
|
|
@@ -136,33 +136,19 @@ dependencies:
|
|
|
136
136
|
- !ruby/object:Gem::Version
|
|
137
137
|
version: '1.1'
|
|
138
138
|
- !ruby/object:Gem::Dependency
|
|
139
|
-
name:
|
|
140
|
-
requirement: !ruby/object:Gem::Requirement
|
|
141
|
-
requirements:
|
|
142
|
-
- - ">="
|
|
143
|
-
- !ruby/object:Gem::Version
|
|
144
|
-
version: '0'
|
|
145
|
-
type: :runtime
|
|
146
|
-
prerelease: false
|
|
147
|
-
version_requirements: !ruby/object:Gem::Requirement
|
|
148
|
-
requirements:
|
|
149
|
-
- - ">="
|
|
150
|
-
- !ruby/object:Gem::Version
|
|
151
|
-
version: '0'
|
|
152
|
-
- !ruby/object:Gem::Dependency
|
|
153
|
-
name: fiddley
|
|
139
|
+
name: clipboard
|
|
154
140
|
requirement: !ruby/object:Gem::Requirement
|
|
155
141
|
requirements:
|
|
156
142
|
- - ">="
|
|
157
143
|
- !ruby/object:Gem::Version
|
|
158
|
-
version:
|
|
144
|
+
version: '1.1'
|
|
159
145
|
type: :runtime
|
|
160
146
|
prerelease: false
|
|
161
147
|
version_requirements: !ruby/object:Gem::Requirement
|
|
162
148
|
requirements:
|
|
163
149
|
- - ">="
|
|
164
150
|
- !ruby/object:Gem::Version
|
|
165
|
-
version:
|
|
151
|
+
version: '1.1'
|
|
166
152
|
- !ruby/object:Gem::Dependency
|
|
167
153
|
name: editorconfig
|
|
168
154
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -436,6 +422,8 @@ files:
|
|
|
436
422
|
- lib/textbringer/themes/catppuccin.rb
|
|
437
423
|
- lib/textbringer/themes/github.rb
|
|
438
424
|
- lib/textbringer/themes/gruvbox.rb
|
|
425
|
+
- lib/textbringer/themes/iceberg.rb
|
|
426
|
+
- lib/textbringer/themes/kanagawa.rb
|
|
439
427
|
- lib/textbringer/themes/molokai.rb
|
|
440
428
|
- lib/textbringer/themes/sonokai.rb
|
|
441
429
|
- lib/textbringer/themes/tokyonight.rb
|
|
@@ -515,7 +503,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
515
503
|
- !ruby/object:Gem::Version
|
|
516
504
|
version: '0'
|
|
517
505
|
requirements: []
|
|
518
|
-
rubygems_version: 4.0.
|
|
506
|
+
rubygems_version: 4.0.20
|
|
519
507
|
specification_version: 4
|
|
520
508
|
summary: An Emacs-like text editor
|
|
521
509
|
test_files: []
|