cygnus 0.0.6 → 0.0.7

Sign up to get free protection for your applications and to get access to all the features.
data/bin/cygnus CHANGED
@@ -8,7 +8,7 @@
8
8
  # Author: rkumar http://github.com/rkumar/mancurses/
9
9
  # Date: 2011-11-09 - 16:59
10
10
  # License: Same as Ruby's License (http://www.ruby-lang.org/LICENSE.txt)
11
- # Last update: 2013-03-21 13:39
11
+ # Last update: 2013-03-22 00:32
12
12
  #
13
13
  # == CHANGES
14
14
  # == BUGS
@@ -184,7 +184,6 @@ def main_menu
184
184
  :B => :bindkey_ext_command,
185
185
  :M => :newdir,
186
186
  "%" => :newfile,
187
- :X => :file_navigator,
188
187
  :x => :extras
189
188
  }
190
189
  ch, binding = menu "Main Menu", h
@@ -259,10 +258,7 @@ def padpopup list, config={}, &block
259
258
  listconfig.delete(:row);
260
259
  listconfig.delete(:col);
261
260
  # trying to pass populists block to listbox
262
- #lb = RubyCurses::List.new form, listconfig, &block
263
261
  lb = Cygnus::TextPad.new form, listconfig, &block
264
- #lb = Cygnus::TextPad.new form, :height => height, :width => width, :row => 0, :col => 0 , :title => "A title", :name => "popup"
265
- #lb.text(list)
266
262
  ## TODO FIXME hardocoding tmux format
267
263
  lb.formatted_text(list, :tmux)
268
264
  #
@@ -372,7 +368,8 @@ def full_indexed_list dir=Dir.pwd, config={}, &block
372
368
  ## TODO FIXME hardocoding tmux format
373
369
  lb.formatted_text(alist, :tmux)
374
370
  @header.text_center($title || Dir.pwd)
375
- @header.text_right "#{$sta}, #{$cursor}"
371
+ #@header.text_right "#{$sta}, #{$cursor}"
372
+ @header.text_right "#{$sta+1} to #{fin} of #{fl}"
376
373
  #
377
374
  @form.repaint
378
375
  Ncurses::Panel.update_panels
@@ -913,7 +910,7 @@ begin
913
910
  #install_help_text my_help_text
914
911
 
915
912
  config_read
916
- @header = app_header "cygnus", :text_center => Dir.pwd, :text_right =>"^q Quit" , :color => :green, :bgcolor => :black , :attr => :bold
913
+ @header = app_header "M-? Help ` Menu", :text_center => Dir.pwd, :text_right =>"^q Quit" , :color => :green, :bgcolor => :black , :attr => :bold
917
914
  full_indexed_list Dir.pwd, :row => 1, :col => 0, :suppress_border => true
918
915
  config_write if $writing
919
916
  #@form = Form.new @window
@@ -1522,15 +1522,24 @@ def insert_into_list dir, file
1522
1522
  #$files.insert ix, *file
1523
1523
  $files.push *file
1524
1524
  end
1525
+
1526
+ # checks various lists like visited_files and bookmarks
1527
+ # to see if files from this dir or below are in it.
1528
+ # More to be used in a dir with few files.
1525
1529
  def get_important_files dir
1526
- # checks various lists like visited_files and bookmarks
1527
- # to see if files from this dir or below are in it.
1528
- # More to be used in a dir with few files.
1529
1530
  list = []
1530
1531
  l = dir.size + 1
1531
- $visited_files.each do |e|
1532
+ s = nil
1533
+ ($visited_files + $bookmarks.values).each do |e|
1532
1534
  if e.index(dir) == 0
1533
- list << e[l..-1]
1535
+ #list << e[l..-1]
1536
+ s = e[l..-1]
1537
+ next unless s
1538
+ if s.index ":"
1539
+ s = s[0, s.index(":")] + "/"
1540
+ end
1541
+ # only insert if the file is in a deeper dir, otherwise we'll be duplicating files from this folder
1542
+ list << s if s.index "/"
1534
1543
  end
1535
1544
  end
1536
1545
  # bookmarks have : which needs to be removed
@@ -8,7 +8,7 @@
8
8
  # Author: rkumar http://github.com/rkumar/mancurses/
9
9
  # Date: 2011-11-09 - 16:59
10
10
  # License: Same as Ruby's License (http://www.ruby-lang.org/LICENSE.txt)
11
- # Last update: 2013-03-21 14:10
11
+ # Last update: 2013-03-21 14:29
12
12
  #
13
13
  # == CHANGES
14
14
  # == TODO
@@ -831,7 +831,11 @@ module Cygnus
831
831
  $multiplier = 0
832
832
  end
833
833
  # moves cursor to end of line also panning window if necessary
834
+ # NOTE: if one line on another page (not displayed) is way longer than any
835
+ # displayed line, then this will pan way ahead, so may not be very intelligent
836
+ # in such situations.
834
837
  def cursor_eol
838
+ # pcol is based on max length not current line's length
835
839
  @pcol = @content_cols - @cols - 1
836
840
  @curpos = @content[@current_index].size
837
841
  @repaint_required = true
@@ -1,3 +1,3 @@
1
1
  module Cygnus
2
- VERSION = "0.0.6"
2
+ VERSION = "0.0.7"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cygnus
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.6
4
+ version: 0.0.7
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -76,7 +76,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
76
76
  version: '0'
77
77
  segments:
78
78
  - 0
79
- hash: 2432678409323259259
79
+ hash: 1295244265959263252
80
80
  required_rubygems_version: !ruby/object:Gem::Requirement
81
81
  none: false
82
82
  requirements:
@@ -85,7 +85,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
85
85
  version: '0'
86
86
  segments:
87
87
  - 0
88
- hash: 2432678409323259259
88
+ hash: 1295244265959263252
89
89
  requirements: []
90
90
  rubyforge_project:
91
91
  rubygems_version: 1.8.25