9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
|
# File 'lib/ruco/editor/colors.rb', line 9
def style_map
$ruco_screen && $ruco_screen.options[:foreground] = theme.foreground
$ruco_screen && $ruco_screen.options[:background] = theme.background
map = super
return map if @colors_took_too_long or not @options[:language]
begin
syntax = Timeout.timeout(STYLING_TIMEOUT) do
syntax_info[@window.visible_lines]
end
rescue Timeout::Error
STDERR.puts "Styling takes too long, go on without me!"
@colors_took_too_long = true
return map
end
if syntax
add_syntax_highlighting_to_style_map(map, syntax)
@window.add_selection_styles(map, @selection) if @selection
end
map
end
|