ruco 0.0.17 → 0.0.18
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/VERSION +1 -1
- data/lib/ruco/text_area.rb +3 -1
- data/ruco.gemspec +1 -1
- data/spec/ruco/application_spec.rb +8 -0
- metadata +3 -3
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.0.
|
1
|
+
0.0.18
|
data/lib/ruco/text_area.rb
CHANGED
@@ -50,7 +50,9 @@ module Ruco
|
|
50
50
|
def insert(text)
|
51
51
|
text = tabs_to_spaces(text)
|
52
52
|
if text == "\n"
|
53
|
-
|
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)
|
data/ruco.gemspec
CHANGED
@@ -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:
|
4
|
+
hash: 59
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 0
|
9
|
-
-
|
10
|
-
version: 0.0.
|
9
|
+
- 18
|
10
|
+
version: 0.0.18
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Michael Grosser
|