ruco 0.0.17 → 0.0.18

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.0.17
1
+ 0.0.18
@@ -50,7 +50,9 @@ module Ruco
50
50
  def insert(text)
51
51
  text = tabs_to_spaces(text)
52
52
  if text == "\n"
53
- text = text + lines[@line].match(/^\s*/)[0]
53
+ current_whitespace = lines[@line].match(/^\s*/)[0]
54
+ next_whitespace = lines[@line+1].to_s.match(/^\s*/)[0]
55
+ text = text + [current_whitespace, next_whitespace].max
54
56
  end
55
57
  insert_into_content cursor_index, text
56
58
  move_according_to_insert(text)
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{ruco}
8
- s.version = "0.0.17"
8
+ s.version = "0.0.18"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Michael Grosser"]
@@ -124,6 +124,14 @@ describe Ruco::Application do
124
124
  app.key('a')
125
125
  editor_part(app.view).should == " \n a\n"
126
126
  end
127
+
128
+ it "indents when typing and the next line has more whitespace" do
129
+ write("a\n b\n")
130
+ app.key(:right)
131
+ app.key(:enter)
132
+ app.key('c')
133
+ editor_part(app.view).should == "a\n c\n b"
134
+ end
127
135
  end
128
136
 
129
137
  describe '.ruco.rb' do
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ruco
3
3
  version: !ruby/object:Gem::Version
4
- hash: 61
4
+ hash: 59
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 0
9
- - 17
10
- version: 0.0.17
9
+ - 18
10
+ version: 0.0.18
11
11
  platform: ruby
12
12
  authors:
13
13
  - Michael Grosser