vedeu 0.6.29 → 0.6.30
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.yardopts +1 -0
- data/Guardfile +6 -5
- data/README.md +50 -4
- data/Rakefile +16 -4
- data/docs/dsl.md +3 -3
- data/lib/vedeu/all.rb +6 -8
- data/lib/vedeu/bindings/all.rb +43 -13
- data/lib/vedeu/borders/border.rb +26 -3
- data/lib/vedeu/borders/refresh.rb +5 -0
- data/lib/vedeu/buffers/refresh.rb +10 -0
- data/lib/vedeu/cursors/cursor.rb +59 -0
- data/lib/vedeu/cursors/refresh.rb +5 -0
- data/lib/vedeu/distributed/server.rb +12 -0
- data/lib/vedeu/distributed/subprocess.rb +7 -2
- data/lib/vedeu/editor/editor.rb +5 -0
- data/lib/vedeu/editor/repository.rb +41 -0
- data/lib/vedeu/geometry/geometry.rb +19 -8
- data/lib/vedeu/geometry/repository.rb +25 -0
- data/lib/vedeu/groups/clear.rb +3 -0
- data/lib/vedeu/groups/group.rb +9 -0
- data/lib/vedeu/groups/refresh.rb +5 -0
- data/lib/vedeu/input/dsl.rb +4 -4
- data/lib/vedeu/input/mapper.rb +3 -0
- data/lib/vedeu/interfaces/all.rb +1 -0
- data/lib/vedeu/interfaces/dsl.rb +1 -1
- data/lib/vedeu/interfaces/interface.rb +12 -0
- data/lib/vedeu/logging/log.rb +3 -0
- data/lib/vedeu/menus/repository.rb +40 -0
- data/lib/vedeu/models/focus.rb +9 -0
- data/lib/vedeu/output/clear/interface.rb +9 -1
- data/lib/vedeu/output/refresh/refresh.rb +3 -0
- data/lib/vedeu/repositories/model.rb +1 -9
- data/lib/vedeu/runtime/application.rb +7 -0
- data/lib/vedeu/runtime/flags.rb +3 -0
- data/lib/vedeu/runtime/launcher.rb +2 -0
- data/lib/vedeu/runtime/router.rb +7 -0
- data/lib/vedeu/terminal/buffer.rb +11 -0
- data/lib/vedeu/terminal/terminal.rb +3 -0
- data/lib/vedeu/version.rb +1 -1
- data/test/lib/vedeu/bindings/all_test.rb +19 -0
- data/test/lib/vedeu/borders/border_test.rb +0 -4
- data/test/lib/vedeu/borders/refresh_test.rb +4 -0
- data/test/lib/vedeu/buffers/refresh_test.rb +5 -0
- data/test/lib/vedeu/cursors/cursor_test.rb +21 -0
- data/test/lib/vedeu/cursors/refresh_test.rb +4 -0
- data/test/lib/vedeu/distributed/server_test.rb +7 -0
- data/test/lib/vedeu/editor/editor_test.rb +4 -0
- data/test/lib/vedeu/editor/repository_test.rb +12 -0
- data/test/lib/vedeu/events/aliases_test.rb +0 -1
- data/test/lib/vedeu/geometry/geometry_test.rb +0 -3
- data/test/lib/vedeu/geometry/repository_test.rb +13 -0
- data/test/lib/vedeu/groups/clear_test.rb +4 -0
- data/test/lib/vedeu/groups/group_test.rb +6 -0
- data/test/lib/vedeu/groups/refresh_test.rb +4 -0
- data/test/lib/vedeu/input/dsl_test.rb +3 -3
- data/test/lib/vedeu/input/mapper_test.rb +4 -0
- data/test/lib/vedeu/interfaces/interface_test.rb +9 -0
- data/test/lib/vedeu/logging/log_test.rb +4 -0
- data/test/lib/vedeu/menus/repository_test.rb +13 -0
- data/test/lib/vedeu/models/focus_test.rb +6 -0
- data/test/lib/vedeu/output/clear/interface_test.rb +5 -0
- data/test/lib/vedeu/output/refresh/refresh_test.rb +4 -0
- data/test/lib/vedeu/repositories/model_test.rb +0 -15
- data/test/lib/vedeu/runtime/application_test.rb +5 -0
- data/test/lib/vedeu/runtime/flags_test.rb +4 -0
- data/test/lib/vedeu/runtime/router_test.rb +26 -0
- data/test/lib/vedeu/terminal/buffer_test.rb +8 -0
- data/test/lib/vedeu/terminal/terminal_test.rb +4 -0
- data/test/support/examples/material_colours_app.rb +24 -4
- data/test/test_helper.rb +23 -23
- metadata +4 -40
- data/lib/vedeu/bindings/application.rb +0 -41
- data/lib/vedeu/bindings/bindings.rb +0 -46
- data/lib/vedeu/bindings/cursors.rb +0 -101
- data/lib/vedeu/bindings/document.rb +0 -97
- data/lib/vedeu/bindings/drb.rb +0 -78
- data/lib/vedeu/bindings/focus.rb +0 -46
- data/lib/vedeu/bindings/menus.rb +0 -99
- data/lib/vedeu/bindings/movement.rb +0 -51
- data/lib/vedeu/bindings/refresh.rb +0 -74
- data/lib/vedeu/bindings/system.rb +0 -81
- data/lib/vedeu/bindings/view.rb +0 -50
- data/lib/vedeu/bindings/visibility.rb +0 -118
- data/test/lib/vedeu/bindings/application_test.rb +0 -39
- data/test/lib/vedeu/bindings/bindings_test.rb +0 -109
- data/test/lib/vedeu/bindings/cursors_test.rb +0 -24
- data/test/lib/vedeu/bindings/document_test.rb +0 -25
- data/test/lib/vedeu/bindings/drb_test.rb +0 -27
- data/test/lib/vedeu/bindings/focus_test.rb +0 -19
- data/test/lib/vedeu/bindings/menus_test.rb +0 -26
- data/test/lib/vedeu/bindings/movement_test.rb +0 -24
- data/test/lib/vedeu/bindings/refresh_test.rb +0 -22
- data/test/lib/vedeu/bindings/system_test.rb +0 -24
- data/test/lib/vedeu/bindings/view_test.rb +0 -19
- data/test/lib/vedeu/bindings/visibility_test.rb +0 -52
- data/test/support/all_seeds.sh +0 -9
@@ -38,6 +38,7 @@ class VedeuMaterialColoursApp
|
|
38
38
|
y 2
|
39
39
|
yn 13
|
40
40
|
end
|
41
|
+
group :my_group
|
41
42
|
zindex 2
|
42
43
|
end
|
43
44
|
|
@@ -85,6 +86,7 @@ class VedeuMaterialColoursApp
|
|
85
86
|
y(5)
|
86
87
|
yn(13)
|
87
88
|
end
|
89
|
+
group :my_group
|
88
90
|
zindex(1)
|
89
91
|
end
|
90
92
|
|
@@ -116,6 +118,10 @@ class VedeuMaterialColoursApp
|
|
116
118
|
key('d') { Vedeu.trigger(:_view_up_, 'main_interface') }
|
117
119
|
key('f') { Vedeu.trigger(:_view_right_, 'main_interface') }
|
118
120
|
|
121
|
+
key('w') { Vedeu.trigger(:_toggle_group_, :my_group) }
|
122
|
+
key('e') { Vedeu.trigger(:_hide_group_, :my_group) }
|
123
|
+
key('r') { Vedeu.trigger(:_show_group_, :my_group) }
|
124
|
+
|
119
125
|
key('h') { Vedeu.trigger(:_view_left_, 'other_interface') }
|
120
126
|
key('j') { Vedeu.trigger(:_view_down_, 'other_interface') }
|
121
127
|
key('k') { Vedeu.trigger(:_view_up_, 'other_interface') }
|
@@ -185,13 +191,27 @@ class VedeuMaterialColoursApp
|
|
185
191
|
end
|
186
192
|
|
187
193
|
view 'keys_interface' do
|
188
|
-
line {
|
189
|
-
|
194
|
+
line {
|
195
|
+
stream {
|
196
|
+
left "\u2190, \u2193, \u2191, \u2192", width: 20
|
197
|
+
}
|
198
|
+
stream {
|
199
|
+
left "Move cursor"
|
200
|
+
}
|
201
|
+
}
|
202
|
+
line {
|
203
|
+
stream {
|
204
|
+
left "q", width: 20
|
205
|
+
}
|
206
|
+
stream {
|
207
|
+
left "Exit"
|
208
|
+
}
|
209
|
+
}
|
190
210
|
line { left 'escape - mode switch'}
|
191
211
|
line { left 'shift+tab - focus previous'}
|
192
212
|
line { left 'tab - focus next'}
|
193
|
-
line { left 'a,s,d,f - Move Rainbow! left, down, up, right' }
|
194
|
-
line { left 'h,j,k,l - Move Wow! left, down, up, right' }
|
213
|
+
line { left 'a, s, d, f - Move Rainbow! left, down, up, right' }
|
214
|
+
line { left 'h, j, k, l - Move Wow! left, down, up, right' }
|
195
215
|
line { left 't - Toggle Rainbow!/Wow!' }
|
196
216
|
line { left '1,2 - Hide/Show Rainbow!'}
|
197
217
|
line { left '3,4 - Hide/Show Wow!'}
|
data/test/test_helper.rb
CHANGED
@@ -1,17 +1,7 @@
|
|
1
|
-
|
1
|
+
if ENV['SIMPLECOV'] || ENV['CONSOLE_COVERAGE']
|
2
2
|
require 'simplecov'
|
3
3
|
require 'simplecov-console' if ENV['CONSOLE_COVERAGE']
|
4
|
-
end
|
5
4
|
|
6
|
-
require 'pry'
|
7
|
-
require 'minitest/autorun'
|
8
|
-
require 'minitest/pride' unless ENV['NO_COLOR']
|
9
|
-
require 'minitest/hell'
|
10
|
-
|
11
|
-
# GC.disable # Uncomment to remove ~20ms from test run speed; left uncommented
|
12
|
-
# though makes tests slower over time with 'guard'.
|
13
|
-
|
14
|
-
unless ENV['NO_SIMPLECOV']
|
15
5
|
SimpleCov.start do
|
16
6
|
formatter SimpleCov::Formatter::Console if ENV['CONSOLE_COVERAGE']
|
17
7
|
command_name 'MiniTest::Spec'
|
@@ -45,6 +35,16 @@ unless ENV['NO_SIMPLECOV']
|
|
45
35
|
end
|
46
36
|
end
|
47
37
|
|
38
|
+
require 'pry'
|
39
|
+
require 'minitest/autorun'
|
40
|
+
require 'minitest/pride'
|
41
|
+
require 'minitest/hell'
|
42
|
+
|
43
|
+
# Appears to remove ~20ms from test run speed.
|
44
|
+
if ENV['DISABLE_GC']
|
45
|
+
GC.disable
|
46
|
+
end
|
47
|
+
|
48
48
|
module VedeuMiniTestPlugin
|
49
49
|
# def before_setup
|
50
50
|
# # Vedeu::Repositories.reset!
|
@@ -90,17 +90,17 @@ require 'mocha/setup'
|
|
90
90
|
require 'vedeu'
|
91
91
|
require 'support/helpers/model_test_class'
|
92
92
|
|
93
|
-
|
94
|
-
require 'minitest/reporters
|
95
|
-
|
96
|
-
|
97
|
-
Minitest::Reporters
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
93
|
+
if ENV['PERFORMANCE']
|
94
|
+
require 'minitest/reporters'
|
95
|
+
require 'minitest/reporters/mean_time_reporter'
|
96
|
+
|
97
|
+
Minitest::Reporters.use!(
|
98
|
+
Minitest::Reporters::MeanTimeReporter.new({
|
99
|
+
previous_runs_filename: "/tmp/durations",
|
100
|
+
report_filename: "/tmp/durations_results"
|
101
|
+
})
|
102
|
+
)
|
103
|
+
end
|
104
104
|
|
105
105
|
def test_configuration
|
106
106
|
Vedeu::Configuration.reset!
|
@@ -119,7 +119,7 @@ def test_configuration
|
|
119
119
|
# log '/tmp/vedeu_test_helper.log'
|
120
120
|
end
|
121
121
|
|
122
|
-
Vedeu::Repositories.reset!
|
122
|
+
# Vedeu::Repositories.reset!
|
123
123
|
end
|
124
124
|
|
125
125
|
test_configuration
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: vedeu
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.6.
|
4
|
+
version: 0.6.30
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Gavin Laking
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-10-
|
11
|
+
date: 2015-10-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: guard
|
@@ -298,18 +298,6 @@ files:
|
|
298
298
|
- lib/vedeu/application/helper.rb
|
299
299
|
- lib/vedeu/application/view.rb
|
300
300
|
- lib/vedeu/bindings/all.rb
|
301
|
-
- lib/vedeu/bindings/application.rb
|
302
|
-
- lib/vedeu/bindings/bindings.rb
|
303
|
-
- lib/vedeu/bindings/cursors.rb
|
304
|
-
- lib/vedeu/bindings/document.rb
|
305
|
-
- lib/vedeu/bindings/drb.rb
|
306
|
-
- lib/vedeu/bindings/focus.rb
|
307
|
-
- lib/vedeu/bindings/menus.rb
|
308
|
-
- lib/vedeu/bindings/movement.rb
|
309
|
-
- lib/vedeu/bindings/refresh.rb
|
310
|
-
- lib/vedeu/bindings/system.rb
|
311
|
-
- lib/vedeu/bindings/view.rb
|
312
|
-
- lib/vedeu/bindings/visibility.rb
|
313
301
|
- lib/vedeu/borders/all.rb
|
314
302
|
- lib/vedeu/borders/border.rb
|
315
303
|
- lib/vedeu/borders/dsl.rb
|
@@ -501,18 +489,7 @@ files:
|
|
501
489
|
- test/lib/vedeu/application/controller_test.rb
|
502
490
|
- test/lib/vedeu/application/helper_test.rb
|
503
491
|
- test/lib/vedeu/application/view_test.rb
|
504
|
-
- test/lib/vedeu/bindings/
|
505
|
-
- test/lib/vedeu/bindings/bindings_test.rb
|
506
|
-
- test/lib/vedeu/bindings/cursors_test.rb
|
507
|
-
- test/lib/vedeu/bindings/document_test.rb
|
508
|
-
- test/lib/vedeu/bindings/drb_test.rb
|
509
|
-
- test/lib/vedeu/bindings/focus_test.rb
|
510
|
-
- test/lib/vedeu/bindings/menus_test.rb
|
511
|
-
- test/lib/vedeu/bindings/movement_test.rb
|
512
|
-
- test/lib/vedeu/bindings/refresh_test.rb
|
513
|
-
- test/lib/vedeu/bindings/system_test.rb
|
514
|
-
- test/lib/vedeu/bindings/view_test.rb
|
515
|
-
- test/lib/vedeu/bindings/visibility_test.rb
|
492
|
+
- test/lib/vedeu/bindings/all_test.rb
|
516
493
|
- test/lib/vedeu/borders/border_test.rb
|
517
494
|
- test/lib/vedeu/borders/dsl_test.rb
|
518
495
|
- test/lib/vedeu/borders/null_test.rb
|
@@ -663,7 +640,6 @@ files:
|
|
663
640
|
- test/lib/vedeu/terminal/mode_test.rb
|
664
641
|
- test/lib/vedeu/terminal/terminal_test.rb
|
665
642
|
- test/lib/vedeu_test.rb
|
666
|
-
- test/support/all_seeds.sh
|
667
643
|
- test/support/colour_support.sh
|
668
644
|
- test/support/coverage.rb
|
669
645
|
- test/support/examples/borders_app.rb
|
@@ -714,18 +690,7 @@ test_files:
|
|
714
690
|
- test/lib/vedeu/application/controller_test.rb
|
715
691
|
- test/lib/vedeu/application/helper_test.rb
|
716
692
|
- test/lib/vedeu/application/view_test.rb
|
717
|
-
- test/lib/vedeu/bindings/
|
718
|
-
- test/lib/vedeu/bindings/bindings_test.rb
|
719
|
-
- test/lib/vedeu/bindings/cursors_test.rb
|
720
|
-
- test/lib/vedeu/bindings/document_test.rb
|
721
|
-
- test/lib/vedeu/bindings/drb_test.rb
|
722
|
-
- test/lib/vedeu/bindings/focus_test.rb
|
723
|
-
- test/lib/vedeu/bindings/menus_test.rb
|
724
|
-
- test/lib/vedeu/bindings/movement_test.rb
|
725
|
-
- test/lib/vedeu/bindings/refresh_test.rb
|
726
|
-
- test/lib/vedeu/bindings/system_test.rb
|
727
|
-
- test/lib/vedeu/bindings/view_test.rb
|
728
|
-
- test/lib/vedeu/bindings/visibility_test.rb
|
693
|
+
- test/lib/vedeu/bindings/all_test.rb
|
729
694
|
- test/lib/vedeu/borders/border_test.rb
|
730
695
|
- test/lib/vedeu/borders/dsl_test.rb
|
731
696
|
- test/lib/vedeu/borders/null_test.rb
|
@@ -876,7 +841,6 @@ test_files:
|
|
876
841
|
- test/lib/vedeu/terminal/mode_test.rb
|
877
842
|
- test/lib/vedeu/terminal/terminal_test.rb
|
878
843
|
- test/lib/vedeu_test.rb
|
879
|
-
- test/support/all_seeds.sh
|
880
844
|
- test/support/colour_support.sh
|
881
845
|
- test/support/coverage.rb
|
882
846
|
- test/support/examples/borders_app.rb
|
@@ -1,41 +0,0 @@
|
|
1
|
-
module Vedeu
|
2
|
-
|
3
|
-
module Bindings
|
4
|
-
|
5
|
-
# System events relating to movement of cursors or interfaces.
|
6
|
-
#
|
7
|
-
module Application
|
8
|
-
|
9
|
-
extend self
|
10
|
-
|
11
|
-
# Setup events relating to client applications. This method is
|
12
|
-
# called by Vedeu.
|
13
|
-
#
|
14
|
-
# @return [TrueClass]
|
15
|
-
def setup!
|
16
|
-
goto!
|
17
|
-
end
|
18
|
-
|
19
|
-
# @return [TrueClass]
|
20
|
-
def setup_aliases!
|
21
|
-
Vedeu.bind_alias(:_action_, :_goto_)
|
22
|
-
end
|
23
|
-
|
24
|
-
private
|
25
|
-
|
26
|
-
# :nocov:
|
27
|
-
|
28
|
-
# See {file:docs/events/application.md#\_goto_}
|
29
|
-
def goto!
|
30
|
-
Vedeu.bind(:_goto_) do |controller, action, **args|
|
31
|
-
Vedeu::Runtime::Router.goto(controller, action, **args)
|
32
|
-
end
|
33
|
-
end
|
34
|
-
|
35
|
-
# :nocov:
|
36
|
-
|
37
|
-
end # Application
|
38
|
-
|
39
|
-
end # Bindings
|
40
|
-
|
41
|
-
end # Vedeu
|
@@ -1,46 +0,0 @@
|
|
1
|
-
module Vedeu
|
2
|
-
|
3
|
-
module Bindings
|
4
|
-
|
5
|
-
extend self
|
6
|
-
|
7
|
-
# Setup events for running Vedeu. This method is called by Vedeu.
|
8
|
-
#
|
9
|
-
# @return [TrueClass]
|
10
|
-
def setup!
|
11
|
-
Vedeu::Events::Repository.reset!
|
12
|
-
|
13
|
-
Vedeu::Bindings::Application.setup!
|
14
|
-
Vedeu::Bindings::Cursors.setup!
|
15
|
-
Vedeu::Bindings::Document.setup!
|
16
|
-
Vedeu::Bindings::DRB.setup!
|
17
|
-
Vedeu::Bindings::Focus.setup!
|
18
|
-
Vedeu::Bindings::Menus.setup!
|
19
|
-
Vedeu::Bindings::Movement.setup!
|
20
|
-
Vedeu::Bindings::Refresh.setup!
|
21
|
-
Vedeu::Bindings::System.setup!
|
22
|
-
Vedeu::Bindings::View.setup!
|
23
|
-
Vedeu::Bindings::Visibility.setup!
|
24
|
-
|
25
|
-
true
|
26
|
-
end
|
27
|
-
|
28
|
-
# Setup aliases for certain registered events.
|
29
|
-
# This method is called by Vedeu.
|
30
|
-
#
|
31
|
-
# @return [TrueClass]
|
32
|
-
def setup_aliases!
|
33
|
-
Vedeu::Bindings::Application.setup_aliases!
|
34
|
-
Vedeu::Bindings::Cursors.setup_aliases!
|
35
|
-
Vedeu::Bindings::Movement.setup_aliases!
|
36
|
-
Vedeu::Bindings::Visibility.setup_aliases!
|
37
|
-
|
38
|
-
true
|
39
|
-
end
|
40
|
-
|
41
|
-
end # Bindings
|
42
|
-
|
43
|
-
Vedeu::Bindings.setup!
|
44
|
-
Vedeu::Bindings.setup_aliases!
|
45
|
-
|
46
|
-
end # Vedeu
|
@@ -1,101 +0,0 @@
|
|
1
|
-
module Vedeu
|
2
|
-
|
3
|
-
module Bindings
|
4
|
-
|
5
|
-
# System events relating to movement of cursors.
|
6
|
-
#
|
7
|
-
module Cursors
|
8
|
-
|
9
|
-
extend self
|
10
|
-
|
11
|
-
# Setup events relating to movement. This method is called by
|
12
|
-
# Vedeu.
|
13
|
-
#
|
14
|
-
# @return [TrueClass]
|
15
|
-
def setup!
|
16
|
-
cursor_left!
|
17
|
-
cursor_down!
|
18
|
-
cursor_up!
|
19
|
-
cursor_right!
|
20
|
-
cursor_origin!
|
21
|
-
cursor_position!
|
22
|
-
cursor_reposition!
|
23
|
-
end
|
24
|
-
|
25
|
-
# @return [TrueClass]
|
26
|
-
def setup_aliases!
|
27
|
-
Vedeu.bind_alias(:_cursor_reset_, :_cursor_origin_)
|
28
|
-
end
|
29
|
-
|
30
|
-
private
|
31
|
-
|
32
|
-
# :nocov:
|
33
|
-
|
34
|
-
# See {file:docs/cursors.md}
|
35
|
-
def cursor_left!
|
36
|
-
Vedeu.bind(:_cursor_left_) do |name|
|
37
|
-
Vedeu.cursors.by_name(name).move_left
|
38
|
-
|
39
|
-
Vedeu.trigger(:_refresh_cursor_, name)
|
40
|
-
end
|
41
|
-
end
|
42
|
-
|
43
|
-
# See {file:docs/cursors.md}
|
44
|
-
def cursor_down!
|
45
|
-
Vedeu.bind(:_cursor_down_) do |name|
|
46
|
-
Vedeu.cursors.by_name(name).move_down
|
47
|
-
|
48
|
-
Vedeu.trigger(:_refresh_cursor_, name)
|
49
|
-
end
|
50
|
-
end
|
51
|
-
|
52
|
-
# See {file:docs/cursors.md}
|
53
|
-
def cursor_up!
|
54
|
-
Vedeu.bind(:_cursor_up_) do |name|
|
55
|
-
Vedeu.cursors.by_name(name).move_up
|
56
|
-
|
57
|
-
Vedeu.trigger(:_refresh_cursor_, name)
|
58
|
-
end
|
59
|
-
end
|
60
|
-
|
61
|
-
# See {file:docs/cursors.md}
|
62
|
-
def cursor_right!
|
63
|
-
Vedeu.bind(:_cursor_right_) do |name|
|
64
|
-
Vedeu.cursors.by_name(name).move_right
|
65
|
-
|
66
|
-
Vedeu.trigger(:_refresh_cursor_, name)
|
67
|
-
end
|
68
|
-
end
|
69
|
-
|
70
|
-
# See {file:docs/cursors.md}
|
71
|
-
def cursor_origin!
|
72
|
-
Vedeu.bind(:_cursor_origin_) do |name|
|
73
|
-
Vedeu.cursors.by_name(name).move_origin
|
74
|
-
end
|
75
|
-
end
|
76
|
-
|
77
|
-
# See {file:docs/cursors.md}
|
78
|
-
def cursor_position!
|
79
|
-
Vedeu.bind(:_cursor_position_) do |name|
|
80
|
-
Vedeu.cursors.by_name(name).to_a
|
81
|
-
end
|
82
|
-
end
|
83
|
-
|
84
|
-
# See {file:docs/cursors.md}
|
85
|
-
def cursor_reposition!
|
86
|
-
Vedeu.bind(:_cursor_reposition_) do |name, y, x|
|
87
|
-
Vedeu.cursors.by_name(name).reposition(y, x)
|
88
|
-
|
89
|
-
Vedeu.trigger(:_clear_view_, name)
|
90
|
-
Vedeu.trigger(:_refresh_view_, name)
|
91
|
-
Vedeu.trigger(:_refresh_cursor_, name)
|
92
|
-
end
|
93
|
-
end
|
94
|
-
|
95
|
-
# :nocov:
|
96
|
-
|
97
|
-
end # Cursors
|
98
|
-
|
99
|
-
end # Bindings
|
100
|
-
|
101
|
-
end # Vedeu
|
@@ -1,97 +0,0 @@
|
|
1
|
-
module Vedeu
|
2
|
-
|
3
|
-
module Bindings
|
4
|
-
|
5
|
-
# System events relating to the document/editor/fake terminal
|
6
|
-
# implementation.
|
7
|
-
#
|
8
|
-
module Document
|
9
|
-
|
10
|
-
extend self
|
11
|
-
|
12
|
-
# Setup events relating to the document/editor/fake terminal.
|
13
|
-
# This method is called by Vedeu.
|
14
|
-
#
|
15
|
-
# @return [TrueClass]
|
16
|
-
def setup!
|
17
|
-
editor_execute!
|
18
|
-
editor_delete_character!
|
19
|
-
editor_delete_line!
|
20
|
-
editor_down!
|
21
|
-
editor_insert_character!
|
22
|
-
editor_insert_line!
|
23
|
-
editor_left!
|
24
|
-
editor_right!
|
25
|
-
editor_up!
|
26
|
-
end
|
27
|
-
|
28
|
-
private
|
29
|
-
|
30
|
-
# :nocov:
|
31
|
-
|
32
|
-
# See {file:docs/events/document.md#\_editor_execute_}
|
33
|
-
def editor_execute!
|
34
|
-
Vedeu.bind(:_editor_execute_) do |name|
|
35
|
-
Vedeu.documents.by_name(name).execute
|
36
|
-
end
|
37
|
-
end
|
38
|
-
|
39
|
-
# See {file:docs/events/document.md#\_editor_delete_character_}
|
40
|
-
def editor_delete_character!
|
41
|
-
Vedeu.bind(:_editor_delete_character_) do |name|
|
42
|
-
Vedeu.documents.by_name(name).delete_character
|
43
|
-
end
|
44
|
-
end
|
45
|
-
|
46
|
-
# See {file:docs/events/document.md#\_editor_delete_line_}
|
47
|
-
def editor_delete_line!
|
48
|
-
Vedeu.bind(:_editor_delete_line_) do |name|
|
49
|
-
Vedeu.documents.by_name(name).delete_line
|
50
|
-
end
|
51
|
-
end
|
52
|
-
|
53
|
-
# See {file:docs/events/document.md#\_editor_down_}
|
54
|
-
def editor_down!
|
55
|
-
Vedeu.bind(:_editor_down_) do |name|
|
56
|
-
Vedeu.documents.by_name(name).down
|
57
|
-
end
|
58
|
-
end
|
59
|
-
|
60
|
-
# See {file:docs/events/document.md#\_editor_insert_character_}
|
61
|
-
def editor_insert_character!
|
62
|
-
Vedeu.bind(:_editor_insert_character_) do |name, character|
|
63
|
-
Vedeu.documents.by_name(name).insert_character(character)
|
64
|
-
end
|
65
|
-
end
|
66
|
-
|
67
|
-
# See {file:docs/events/document.md#\_editor_insert_line_}
|
68
|
-
def editor_insert_line!
|
69
|
-
Vedeu.bind(:_editor_insert_line_) do |name|
|
70
|
-
Vedeu.documents.by_name(name).insert_line
|
71
|
-
end
|
72
|
-
end
|
73
|
-
|
74
|
-
# See {file:docs/events/document.md#\_editor_left_}
|
75
|
-
def editor_left!
|
76
|
-
Vedeu.bind(:_editor_left_) { |name| Vedeu.documents.by_name(name).left }
|
77
|
-
end
|
78
|
-
|
79
|
-
# See {file:docs/events/document.md#\_editor_right_}
|
80
|
-
def editor_right!
|
81
|
-
Vedeu.bind(:_editor_right_) do |name|
|
82
|
-
Vedeu.documents.by_name(name).right
|
83
|
-
end
|
84
|
-
end
|
85
|
-
|
86
|
-
# See {file:docs/events/document.md#\_editor_up_}
|
87
|
-
def editor_up!
|
88
|
-
Vedeu.bind(:_editor_up_) { |name| Vedeu.documents.by_name(name).up }
|
89
|
-
end
|
90
|
-
|
91
|
-
# :nocov:
|
92
|
-
|
93
|
-
end # Document
|
94
|
-
|
95
|
-
end # Bindings
|
96
|
-
|
97
|
-
end # Vedeu
|