ruco 0.0.38 → 0.0.39

Sign up to get free protection for your applications and to get access to all the features.
data/Readme.md CHANGED
@@ -4,7 +4,7 @@ Features:
4
4
 
5
5
  - **Intuitive interface**
6
6
  - selecting via Shift+left/right/up/down and Ctrl+a(all)
7
- - Tab -> indent / Shift+Tab -> unindent (tab == 2 space)
7
+ - Tab -> indent / Shift+Tab -> unindent
8
8
  - keeps indentation (+ paste-detection e.g. via Cmd+v)
9
9
  - change (*) + writable (!) indicators
10
10
  - find / go to line / delete line / search & replace
@@ -56,6 +56,7 @@ Customize
56
56
 
57
57
  TIPS
58
58
  ====
59
+ - [Tabs] Ruco does not like tabs. Existing tabs are displayed as ' ' and pressing tab inserts 2*' '
59
60
  - [RVM] `alias r="rvm ree exec ruco"` and you only have to install ruco once
60
61
  - [Ruby1.9] Unicode support -> install libncursesw5-dev before installing ruby (does not work for 1.8)
61
62
  - [ssh vs clipboard] access your desktops clipboard by installing `xauth` on the server and then using `ssh -X`
@@ -63,6 +64,7 @@ TIPS
63
64
 
64
65
  TODO
65
66
  =====
67
+ - highlight tabs (e.g. strange character or reverse/underline/color)
66
68
  - big warning when editing a not-writable file
67
69
  - find next (Alt+n)
68
70
  - add selection colors to forms in command_bar
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.0.38
1
+ 0.0.39
data/bin/ruco CHANGED
@@ -70,6 +70,7 @@ def display(lines, offset, color_mask)
70
70
  clearer = Curses.stdscr.maxx + 1 - content.size
71
71
  clearer = " " * clearer
72
72
  content += clearer
73
+ content.gsub!("\t",' ') # display tabs as single-space -> nothing breaks
73
74
 
74
75
  # cache !?
75
76
  next if @screen[line] == [content, colors]
@@ -158,7 +158,9 @@ module Ruco
158
158
  end
159
159
 
160
160
  action :go_to_line do
161
- ask('Go to Line: '){|result| editor.move(:to_line, result.to_i - 1) }
161
+ ask('Go to Line: ') do |result|
162
+ editor.move(:to_line, result.to_i - 1)
163
+ end
162
164
  end
163
165
 
164
166
  action :delete_line do
data/lib/ruco/editor.rb CHANGED
@@ -19,15 +19,7 @@ module Ruco
19
19
  end
20
20
 
21
21
  content = (File.exist?(@file) ? File.read(@file) : '')
22
-
23
- # check for tabs
24
- if content.include?("\t")
25
- if options[:convert_tabs]
26
- content.tabs_to_spaces!
27
- else
28
- raise "#{@file} contains tabs.\nRuco atm does not support tabs, but will happily convert them to spaces if started with --convert-tabs or -c"
29
- end
30
- end
22
+ content.tabs_to_spaces! if options[:convert_tabs]
31
23
 
32
24
  @saved_content = content
33
25
  @text_area = EditorArea.new(content, options)
@@ -208,6 +208,7 @@ module Ruco
208
208
  end
209
209
  else
210
210
  # faster but complicated for newlines
211
+ lines[line] ||= ''
211
212
  lines[line].insert(@column, text)
212
213
  end
213
214
  end
data/ruco.gemspec CHANGED
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{ruco}
8
- s.version = "0.0.38"
8
+ s.version = "0.0.39"
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"]
12
- s.date = %q{2011-01-31}
12
+ s.date = %q{2011-02-02}
13
13
  s.default_executable = %q{ruco}
14
14
  s.email = %q{michael@grosser.it}
15
15
  s.executables = ["ruco"]
@@ -21,10 +21,9 @@ describe Ruco::Editor do
21
21
  editor.view.should == " a\n\n\n"
22
22
  end
23
23
 
24
- it "raises when tabs are in content and option is not set" do
25
- lambda{
26
- editor = Ruco::Editor.new(@file, :lines => 3, :columns => 5)
27
- }.should raise_error
24
+ it "reads them normally when option is not set" do
25
+ editor = Ruco::Editor.new(@file, :lines => 3, :columns => 5)
26
+ editor.view.should == "\t\ta\n\n\n"
28
27
  end
29
28
  end
30
29
 
@@ -808,5 +807,12 @@ describe Ruco::Editor do
808
807
  editor.view.should == "5\n7\n8\n"
809
808
  editor.cursor.should == [1, 1]
810
809
  end
810
+
811
+ it "can remove the last line" do
812
+ write('xxx')
813
+ editor.delete_line
814
+ editor.insert('yyy')
815
+ editor.view.should == "yyy\n\n\n"
816
+ end
811
817
  end
812
818
  end
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: 83
4
+ hash: 81
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 0
9
- - 38
10
- version: 0.0.38
9
+ - 39
10
+ version: 0.0.39
11
11
  platform: ruby
12
12
  authors:
13
13
  - Michael Grosser
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2011-01-31 00:00:00 +01:00
18
+ date: 2011-02-02 00:00:00 +01:00
19
19
  default_executable: ruco
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency