ruco 0.2.12 → 0.2.13
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.
- data/Gemfile.lock +1 -1
- data/Readme.md +2 -2
- data/lib/ruco/application.rb +4 -4
- data/lib/ruco/keyboard.rb +13 -7
- data/lib/ruco/version.rb +1 -1
- data/ruco.gemspec +1 -1
- data/spec/ruco/application_spec.rb +1 -1
- data/spec/ruco/array_processor_spec.rb +1 -1
- data/spec/ruco/command_bar_spec.rb +1 -1
- data/spec/ruco/core_ext/array_spec.rb +2 -2
- data/spec/ruco/core_ext/range_spec.rb +1 -1
- data/spec/ruco/core_ext/string_spec.rb +1 -1
- data/spec/ruco/editor_spec.rb +1 -1
- data/spec/ruco/file_store_spec.rb +1 -1
- data/spec/ruco/form_spec.rb +1 -1
- data/spec/ruco/history_spec.rb +2 -2
- data/spec/ruco/keyboard_spec.rb +6 -1
- data/spec/ruco/option_accessor_spec.rb +2 -2
- data/spec/ruco/screen_spec.rb +1 -1
- data/spec/ruco/status_bar_spec.rb +1 -1
- data/spec/ruco/style_map_spec.rb +1 -1
- data/spec/ruco/syntax_parser_spec.rb +1 -1
- data/spec/ruco/text_area_spec.rb +1 -1
- data/spec/ruco/tm_theme_spec.rb +1 -1
- data/spec/ruco/window_spec.rb +2 -2
- data/spec/ruco_spec.rb +1 -1
- metadata +3 -3
data/Gemfile.lock
CHANGED
data/Readme.md
CHANGED
@@ -126,6 +126,7 @@ To build the commandline output Editor/CommandBar return:
|
|
126
126
|
|
127
127
|
TODO
|
128
128
|
=====
|
129
|
+
- Shift+up and Alt+up emit the same keycodes in iTerm
|
129
130
|
- ctrl+right should jump to line end and then to the next line even if the line ends in a "
|
130
131
|
- only do syntax parsing for changed lines + selected lines <-> will not be redrawn anyhow
|
131
132
|
- try to use complete file coloring as removed in 26d6da4
|
@@ -159,6 +160,5 @@ Authors
|
|
159
160
|
|
160
161
|
[Michael Grosser](http://grosser.it)<br/>
|
161
162
|
grosser.michael@gmail.com<br/>
|
162
|
-
|
163
|
-
[](https://flattr.com/submit/auto?user_id=grosser&url=https://github.com/grosser/ruco&title=ruco&language=en_GB&tags=github&category=software)
|
163
|
+
License: MIT<br/>
|
164
164
|
[](http://travis-ci.org/grosser/ruco)
|
data/lib/ruco/application.rb
CHANGED
@@ -49,16 +49,16 @@ module Ruco
|
|
49
49
|
when :left then move_with_select_mode :relative, 0,-1
|
50
50
|
when :page_up then move_with_select_mode :page_up
|
51
51
|
when :page_down then move_with_select_mode :page_down
|
52
|
-
when :"Ctrl+right" then move_with_select_mode :jump, :right
|
53
|
-
when :"Ctrl+left" then move_with_select_mode :jump, :left
|
52
|
+
when :"Ctrl+right", :"Alt+f" then move_with_select_mode :jump, :right
|
53
|
+
when :"Ctrl+left", :"Alt+b" then move_with_select_mode :jump, :left
|
54
54
|
|
55
55
|
# select
|
56
56
|
when :"Shift+down" then @focused.selecting { move(:relative, 1, 0) }
|
57
57
|
when :"Shift+right" then @focused.selecting { move(:relative, 0, 1) }
|
58
58
|
when :"Shift+up" then @focused.selecting { move(:relative, -1, 0) }
|
59
59
|
when :"Shift+left" then @focused.selecting { move(:relative, 0, -1) }
|
60
|
-
when :"Ctrl+Shift+left" then @focused.selecting{ move(:jump, :left) }
|
61
|
-
when :"Ctrl+Shift+right" then @focused.selecting{ move(:jump, :right) }
|
60
|
+
when :"Ctrl+Shift+left", :"Alt+Shift+left" then @focused.selecting{ move(:jump, :left) }
|
61
|
+
when :"Ctrl+Shift+right", :"Alt+Shift+right" then @focused.selecting{ move(:jump, :right) }
|
62
62
|
|
63
63
|
|
64
64
|
# modify
|
data/lib/ruco/keyboard.rb
CHANGED
@@ -39,8 +39,9 @@ class Keyboard
|
|
39
39
|
when Curses::Key::RIGHT then :right
|
40
40
|
when Curses::Key::LEFT then :left
|
41
41
|
|
42
|
-
|
43
|
-
when
|
42
|
+
# code, unix, iTerm
|
43
|
+
when 337, '^[1;2A', "^[A" then :"Shift+up"
|
44
|
+
when 336, '^[1;2B', "^[B" then :"Shift+down"
|
44
45
|
when 402, '^[1;2C' then :"Shift+right"
|
45
46
|
when 393, '^[1;2D' then :"Shift+left"
|
46
47
|
|
@@ -56,8 +57,8 @@ class Keyboard
|
|
56
57
|
|
57
58
|
when 561, '^[1;6A' then :"Ctrl+Shift+up"
|
58
59
|
when 520, '^[1;6B' then :"Ctrl+Shift+down"
|
59
|
-
when 555, '^[1;6C' then :"Ctrl+Shift+right"
|
60
|
-
when 540, '^[1;6D' then :"Ctrl+Shift+left"
|
60
|
+
when 555, '^[1;6C', "^[C" then :"Ctrl+Shift+right"
|
61
|
+
when 540, '^[1;6D', "^[D" then :"Ctrl+Shift+left"
|
61
62
|
|
62
63
|
when 562, '^[1;7A' then :"Alt+Ctrl+up"
|
63
64
|
when 521, '^[1;7B' then :"Alt+Ctrl+down"
|
@@ -69,6 +70,11 @@ class Keyboard
|
|
69
70
|
when '^[1;8C' then :"Alt+Ctrl+Shift+right"
|
70
71
|
when '^[1;8D' then :"Alt+Ctrl+Shift+left"
|
71
72
|
|
73
|
+
when '^[1;10A' then :"Alt+Shift+up"
|
74
|
+
when '^[1;10B' then :"Alt+Shift+down"
|
75
|
+
when '^[1;10C' then :"Alt+Shift+right"
|
76
|
+
when '^[1;10D' then :"Alt+Shift+left"
|
77
|
+
|
72
78
|
when Curses::KEY_END then :end
|
73
79
|
when Curses::KEY_HOME then :home
|
74
80
|
when Curses::KEY_NPAGE then :page_down
|
@@ -173,10 +179,10 @@ class Keyboard
|
|
173
179
|
end
|
174
180
|
|
175
181
|
def self.escape_sequence?(sequence)
|
176
|
-
sequence[0] == ESCAPE and sequence.size.between?(2,
|
182
|
+
sequence[0] == ESCAPE and sequence.size.between?(2,7) # Esc
|
177
183
|
end
|
178
184
|
|
179
|
-
def self.is_alt_key_code?(
|
180
|
-
|
185
|
+
def self.is_alt_key_code?(sequence)
|
186
|
+
sequence.slice(0,1) == "^" and sequence.size == 2
|
181
187
|
end
|
182
188
|
end
|
data/lib/ruco/version.rb
CHANGED
data/ruco.gemspec
CHANGED
@@ -8,7 +8,7 @@ Gem::Specification.new name, Ruco::VERSION do |s|
|
|
8
8
|
s.email = "michael@grosser.it"
|
9
9
|
s.homepage = "http://github.com/grosser/#{name}"
|
10
10
|
s.files = `git ls-files`.split("\n")
|
11
|
-
s.license =
|
11
|
+
s.license = "MIT"
|
12
12
|
s.add_runtime_dependency "clipboard", ">= 0.9.8"
|
13
13
|
s.add_runtime_dependency "textpow1x", ">= 1.2.5"
|
14
14
|
s.add_runtime_dependency "language_sniffer"
|
data/spec/ruco/editor_spec.rb
CHANGED
data/spec/ruco/form_spec.rb
CHANGED
data/spec/ruco/history_spec.rb
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
require
|
1
|
+
require "spec_helper"
|
2
2
|
|
3
3
|
describe Ruco::History do
|
4
4
|
let(:history){ Ruco::History.new(:state => {:x => 1}, :track => [:x], :entries => 3) }
|
@@ -140,4 +140,4 @@ describe Ruco::History do
|
|
140
140
|
end
|
141
141
|
end
|
142
142
|
|
143
|
-
end
|
143
|
+
end
|
data/spec/ruco/keyboard_spec.rb
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
# encoding: UTF-8
|
2
|
-
require
|
2
|
+
require "spec_helper"
|
3
3
|
|
4
4
|
describe Keyboard do
|
5
5
|
def output
|
@@ -91,6 +91,11 @@ describe Keyboard do
|
|
91
91
|
output.should == [:"Shift+down"]
|
92
92
|
end
|
93
93
|
|
94
|
+
it "ignores to long escape sequences" do
|
95
|
+
type [27, 91, 49, 59, 50, 66, 59, 50, 66, 59, 50, 66]
|
96
|
+
output.should == [:escape, "[", "1", ";", "2", "B", ";", "2", "B", ";", "2", "B"]
|
97
|
+
end
|
98
|
+
|
94
99
|
it "recognises escape sequence for Shift+up" do
|
95
100
|
type [27, 91, 49, 59, 50, 65]
|
96
101
|
output.should == [:"Shift+up"]
|
@@ -1,4 +1,4 @@
|
|
1
|
-
require
|
1
|
+
require "spec_helper"
|
2
2
|
|
3
3
|
describe Ruco::OptionAccessor do
|
4
4
|
let(:options){ Ruco::OptionAccessor.new }
|
@@ -23,4 +23,4 @@ describe Ruco::OptionAccessor do
|
|
23
23
|
it "has empty hash for nested key" do
|
24
24
|
options.nested(:history).should == {}
|
25
25
|
end
|
26
|
-
end
|
26
|
+
end
|
data/spec/ruco/screen_spec.rb
CHANGED
data/spec/ruco/style_map_spec.rb
CHANGED
data/spec/ruco/text_area_spec.rb
CHANGED
data/spec/ruco/tm_theme_spec.rb
CHANGED
data/spec/ruco/window_spec.rb
CHANGED
data/spec/ruco_spec.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ruco
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.13
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -144,7 +144,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
144
144
|
version: '0'
|
145
145
|
segments:
|
146
146
|
- 0
|
147
|
-
hash: -
|
147
|
+
hash: -3565397175029942433
|
148
148
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
149
149
|
none: false
|
150
150
|
requirements:
|
@@ -153,7 +153,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
153
153
|
version: '0'
|
154
154
|
segments:
|
155
155
|
- 0
|
156
|
-
hash: -
|
156
|
+
hash: -3565397175029942433
|
157
157
|
requirements: []
|
158
158
|
rubyforge_project:
|
159
159
|
rubygems_version: 1.8.24
|