ruco 0.2.12 → 0.2.13

Sign up to get free protection for your applications and to get access to all the features.
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- ruco (0.2.12)
4
+ ruco (0.2.13)
5
5
  clipboard (>= 0.9.8)
6
6
  language_sniffer
7
7
  textpow1x (>= 1.2.5)
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
- Hereby placed under public domain, do what you want, just do not hold me accountable...<br/>
163
- [![Flattr](http://api.flattr.com/button/flattr-badge-large.png)](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
  [![Build Status](https://secure.travis-ci.org/grosser/ruco.png)](http://travis-ci.org/grosser/ruco)
@@ -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
- when 337, '^[1;2A' then :"Shift+up"
43
- when 336, '^[1;2B' then :"Shift+down"
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,6) # Esc
182
+ sequence[0] == ESCAPE and sequence.size.between?(2,7) # Esc
177
183
  end
178
184
 
179
- def self.is_alt_key_code?(key)
180
- key.slice(0,1) == "^" and key.size == 2
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
@@ -1,3 +1,3 @@
1
1
  module Ruco
2
- VERSION = Version = "0.2.12"
2
+ VERSION = Version = "0.2.13"
3
3
  end
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 = 'MIT'
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"
@@ -1,5 +1,5 @@
1
1
  # encoding: UTF-8
2
- require File.expand_path('spec/spec_helper')
2
+ require "spec_helper"
3
3
 
4
4
  describe Ruco::Application do
5
5
  before do
@@ -1,4 +1,4 @@
1
- require File.expand_path('spec/spec_helper')
1
+ require "spec_helper"
2
2
 
3
3
  describe Ruco::ArrayProcessor do
4
4
  let(:p){ Ruco::ArrayProcessor.new }
@@ -1,4 +1,4 @@
1
- require File.expand_path('spec/spec_helper')
1
+ require "spec_helper"
2
2
 
3
3
  describe Ruco::CommandBar do
4
4
  let(:default_view){ "^W Exit ^S Save ^F Find" }
@@ -1,4 +1,4 @@
1
- require File.expand_path('spec/spec_helper')
1
+ require "spec_helper"
2
2
 
3
3
  describe Array do
4
4
  it "is bigger" do
@@ -28,4 +28,4 @@ describe Array do
28
28
  [1].between?([0],[0]).should == false
29
29
  [1].between?([2],[2]).should == false
30
30
  end
31
- end
31
+ end
@@ -1,4 +1,4 @@
1
- require File.expand_path('spec/spec_helper')
1
+ require "spec_helper"
2
2
 
3
3
  describe Range do
4
4
  describe :last_element do
@@ -1,4 +1,4 @@
1
- require File.expand_path('spec/spec_helper')
1
+ require "spec_helper"
2
2
 
3
3
  describe String do
4
4
  describe :naive_split do
@@ -1,4 +1,4 @@
1
- require File.expand_path('spec/spec_helper')
1
+ require "spec_helper"
2
2
 
3
3
  describe Ruco::Editor do
4
4
  def write(content)
@@ -1,4 +1,4 @@
1
- require File.expand_path('spec/spec_helper')
1
+ require "spec_helper"
2
2
 
3
3
  describe Ruco::FileStore do
4
4
  def mark_all_as_old
@@ -1,4 +1,4 @@
1
- require File.expand_path('spec/spec_helper')
1
+ require "spec_helper"
2
2
 
3
3
  describe Ruco::Form do
4
4
  let(:form){ Ruco::Form.new('Test', :columns => 30){|value| @result = value } }
@@ -1,4 +1,4 @@
1
- require File.expand_path('spec/spec_helper')
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
@@ -1,5 +1,5 @@
1
1
  # encoding: UTF-8
2
- require File.expand_path('spec/spec_helper')
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 File.expand_path('spec/spec_helper')
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
@@ -1,4 +1,4 @@
1
- require File.expand_path('spec/spec_helper')
1
+ require "spec_helper"
2
2
 
3
3
  describe Ruco::Screen do
4
4
  describe :curses_style do
@@ -1,4 +1,4 @@
1
- require File.expand_path('spec/spec_helper')
1
+ require "spec_helper"
2
2
 
3
3
  describe Ruco::StatusBar do
4
4
  let(:file){ 'spec/temp.txt' }
@@ -1,4 +1,4 @@
1
- require File.expand_path('spec/spec_helper')
1
+ require "spec_helper"
2
2
 
3
3
  describe Ruco::StyleMap do
4
4
  let(:map){ Ruco::StyleMap.new(3) }
@@ -1,4 +1,4 @@
1
- require File.expand_path('spec/spec_helper')
1
+ require "spec_helper"
2
2
 
3
3
  describe Ruco::SyntaxParser do
4
4
  def parse(text, languages=['ruby'])
@@ -1,5 +1,5 @@
1
1
  # encoding: utf-8
2
- require File.expand_path('spec/spec_helper')
2
+ require "spec_helper"
3
3
 
4
4
  describe Ruco::TextArea do
5
5
  describe :move do
@@ -1,4 +1,4 @@
1
- require File.expand_path('spec/spec_helper')
1
+ require "spec_helper"
2
2
 
3
3
  describe Ruco::TMTheme do
4
4
  let(:theme){ Ruco::TMTheme.new('spec/fixtures/test.tmTheme') }
@@ -1,4 +1,4 @@
1
- require File.expand_path('spec/spec_helper')
1
+ require "spec_helper"
2
2
 
3
3
  describe Ruco::Window do
4
4
  let(:window){ Ruco::Window.new(10,10) }
@@ -167,4 +167,4 @@ describe Ruco::Window do
167
167
  window.left.should == 0
168
168
  end
169
169
  end
170
- end
170
+ end
data/spec/ruco_spec.rb CHANGED
@@ -1,4 +1,4 @@
1
- require File.expand_path('spec/spec_helper')
1
+ require "spec_helper"
2
2
 
3
3
  describe Ruco do
4
4
  it "has a VERSION" do
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.12
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: -1038646721571340969
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: -1038646721571340969
156
+ hash: -3565397175029942433
157
157
  requirements: []
158
158
  rubyforge_project:
159
159
  rubygems_version: 1.8.24