xiki 0.5.1a → 0.5.3a

Sign up to get free protection for your applications and to get access to all the features.
Files changed (148) hide show
  1. data/Gemfile +1 -11
  2. data/README.markdown +67 -43
  3. data/bin/xiki +2 -15
  4. data/etc/command/xiki_command.rb +115 -41
  5. data/etc/command/xiki_process.rb +3 -7
  6. data/etc/install/el4r_setup.sh +5 -0
  7. data/etc/themes/Black_BG.notes +8 -0
  8. data/etc/themes/Dark_Metal.notes +0 -6
  9. data/etc/themes/Default.notes +24 -0
  10. data/etc/themes/Fall_Fonts.notes +6 -0
  11. data/etc/themes/Light_Gray_BG_Theme.notes +6 -0
  12. data/etc/themes/Orange_Path.notes +1 -1
  13. data/etc/themes/Pastel_Fonts.notes +6 -0
  14. data/etc/themes/Path_Mode_Line.notes +36 -0
  15. data/etc/themes/Rainbow_Fonts.notes +20 -0
  16. data/etc/themes/Shiny_Blue.notes +14 -18
  17. data/etc/themes/Shiny_Green.notes +0 -6
  18. data/etc/themes/White_BG.notes +5 -0
  19. data/etc/vim/vim_status.notes +32 -0
  20. data/etc/vim/xiki.vim +16 -0
  21. data/etc/wrappers/wrapper.rb +2 -2
  22. data/etc/www/index.rb +1 -1
  23. data/etc/www/public/error.html +47 -0
  24. data/etc/www/sinatra_server.rb +353 -0
  25. data/etc/www/web_server.rb +0 -252
  26. data/lib/xiki.rb +94 -26
  27. data/lib/{block.rb → xiki/block.rb} +0 -0
  28. data/lib/{bookmarks.rb → xiki/bookmarks.rb} +11 -10
  29. data/lib/{buffers.rb → xiki/buffers.rb} +10 -10
  30. data/lib/{clipboard.rb → xiki/clipboard.rb} +2 -2
  31. data/lib/{code.rb → xiki/code.rb} +3 -7
  32. data/lib/{code_tree.rb → xiki/code_tree.rb} +3 -3
  33. data/lib/{color.rb → xiki/color.rb} +4 -14
  34. data/lib/{console.rb → xiki/console.rb} +6 -0
  35. data/lib/{control_lock.rb → xiki/control_lock.rb} +5 -1
  36. data/lib/{control_tab.rb → xiki/control_tab.rb} +3 -1
  37. data/lib/{core_ext.rb → xiki/core_ext.rb} +7 -3
  38. data/lib/{cursor.rb → xiki/cursor.rb} +4 -5
  39. data/lib/{deletes.rb → xiki/deletes.rb} +0 -0
  40. data/lib/{diff_log.rb → xiki/diff_log.rb} +4 -4
  41. data/lib/{effects.rb → xiki/effects.rb} +5 -2
  42. data/lib/{environment.rb → xiki/environment.rb} +0 -0
  43. data/lib/{file_tree.rb → xiki/file_tree.rb} +34 -24
  44. data/lib/{files.rb → xiki/files.rb} +15 -5
  45. data/lib/{hide.rb → xiki/hide.rb} +0 -0
  46. data/lib/{history.rb → xiki/history.rb} +1 -0
  47. data/lib/{image.rb → xiki/image.rb} +0 -0
  48. data/lib/{incrementer.rb → xiki/incrementer.rb} +0 -0
  49. data/lib/{insert.rb → xiki/insert.rb} +0 -0
  50. data/lib/{irc.rb → xiki/irc.rb} +0 -0
  51. data/lib/{key_bindings.rb → xiki/key_bindings.rb} +7 -4
  52. data/lib/{keys.rb → xiki/keys.rb} +32 -36
  53. data/lib/{launcher.rb → xiki/launcher.rb} +42 -23
  54. data/lib/{line.rb → xiki/line.rb} +1 -1
  55. data/lib/{links.rb → xiki/links.rb} +0 -0
  56. data/lib/{location.rb → xiki/location.rb} +0 -0
  57. data/lib/{macros.rb → xiki/macros.rb} +0 -0
  58. data/lib/{man.rb → xiki/man.rb} +0 -0
  59. data/lib/{menu.rb → xiki/menu.rb} +62 -11
  60. data/lib/{merb.rb → xiki/merb.rb} +1 -1
  61. data/lib/{message.rb → xiki/message.rb} +0 -0
  62. data/lib/{meths.rb → xiki/meths.rb} +0 -0
  63. data/lib/{mode.rb → xiki/mode.rb} +0 -0
  64. data/lib/{move.rb → xiki/move.rb} +1 -1
  65. data/lib/{notes.rb → xiki/notes.rb} +41 -37
  66. data/lib/{numbers.rb → xiki/numbers.rb} +0 -0
  67. data/lib/{ol.rb → xiki/ol.rb} +2 -3
  68. data/lib/{ol_helper.rb → xiki/ol_helper.rb} +0 -0
  69. data/lib/{overlay.rb → xiki/overlay.rb} +0 -0
  70. data/lib/{pause_means_space.rb → xiki/pause_means_space.rb} +2 -2
  71. data/lib/{php.rb → xiki/php.rb} +0 -0
  72. data/lib/{projects.rb → xiki/projects.rb} +8 -1
  73. data/lib/{relinquish_exception.rb → xiki/relinquish_exception.rb} +0 -0
  74. data/lib/{remote.rb → xiki/remote.rb} +2 -2
  75. data/lib/{requirer.rb → xiki/requirer.rb} +3 -3
  76. data/lib/{rest_tree.rb → xiki/rest_tree.rb} +0 -0
  77. data/lib/{ruby.rb → xiki/ruby.rb} +0 -0
  78. data/lib/{ruby_console.rb → xiki/ruby_console.rb} +0 -0
  79. data/lib/{search.rb → xiki/search.rb} +7 -8
  80. data/lib/{search_term.rb → xiki/search_term.rb} +0 -0
  81. data/lib/{snippet.rb → xiki/snippet.rb} +0 -0
  82. data/lib/{specs.rb → xiki/specs.rb} +0 -0
  83. data/lib/{styles.rb → xiki/styles.rb} +8 -72
  84. data/lib/{svn.rb → xiki/svn.rb} +0 -0
  85. data/lib/{text_util.rb → xiki/text_util.rb} +2 -2
  86. data/lib/{tree.rb → xiki/tree.rb} +40 -32
  87. data/lib/{tree_cursor.rb → xiki/tree_cursor.rb} +0 -0
  88. data/lib/{trouble_shooting.rb → xiki/trouble_shooting.rb} +0 -0
  89. data/lib/{url_tree.rb → xiki/url_tree.rb} +0 -0
  90. data/lib/{view.rb → xiki/view.rb} +39 -16
  91. data/lib/xiki/vim/line.rb +8 -0
  92. data/lib/xiki/vim/tree.rb +9 -0
  93. data/lib/{window.rb → xiki/window.rb} +0 -0
  94. data/menus/address_book.rb +6 -4
  95. data/menus/agenda.rb +3 -3
  96. data/menus/amazon.rb +2 -2
  97. data/menus/applescript.rb +21 -10
  98. data/menus/black.menu +1 -0
  99. data/menus/bootstrap.rb +2 -7
  100. data/menus/browser.rb +8 -5
  101. data/menus/cassandra_db.rb +2 -2
  102. data/menus/chmod.rb +1 -1
  103. data/menus/conf.rb +5 -0
  104. data/menus/cookies.rb +1 -1
  105. data/menus/css.rb +2 -2
  106. data/menus/deck.rb +1 -1
  107. data/menus/dimensions_config.menu +30 -0
  108. data/menus/dimensions_config.rb +5 -0
  109. data/menus/docs.rb +33 -34
  110. data/menus/dotsies.rb +1 -0
  111. data/menus/emacs.rb +7 -2
  112. data/menus/firefox.rb +25 -25
  113. data/menus/git.rb +1 -1
  114. data/menus/gito.rb +2 -2
  115. data/menus/headings.rb +3 -3
  116. data/menus/ip.rb +2 -4
  117. data/menus/itunes.rb +9 -2
  118. data/menus/javascript.rb +3 -1
  119. data/menus/local_storage.rb +4 -4
  120. data/menus/mac.rb +2 -1
  121. data/menus/maps.rb +2 -2
  122. data/menus/models.rb +31 -0
  123. data/menus/mongo.rb +2 -2
  124. data/menus/piano.rb +47 -23
  125. data/menus/r.rb +57 -0
  126. data/menus/rails.rb +89 -27
  127. data/menus/redmine.rb +1 -1
  128. data/menus/sass.rb +1 -1
  129. data/menus/settings.menu +2 -0
  130. data/menus/technologies.rb +4 -1
  131. data/menus/web_interface.rb +58 -0
  132. data/menus/welcome.menu +18 -0
  133. data/menus/white.menu +1 -0
  134. data/menus/youtube.rb +32 -0
  135. data/spec/code_tree_spec.rb +1 -1
  136. data/spec/diff_log_spec.rb +4 -4
  137. data/spec/file_tree_spec.rb +2 -2
  138. data/spec/line_spec.rb +2 -2
  139. data/spec/menu_spec.rb +5 -5
  140. data/spec/ol_spec.rb +3 -3
  141. data/spec/remote_spec.rb +2 -2
  142. data/spec/search_spec.rb +2 -2
  143. data/spec/text_util_spec.rb +1 -1
  144. data/spec/tree_cursor_spec.rb +3 -3
  145. data/spec/tree_spec.rb +3 -3
  146. data/xiki.gemspec +22 -6
  147. metadata +311 -76
  148. data/menus/dir.rb +0 -8
File without changes
File without changes
File without changes
@@ -4,9 +4,6 @@ class Styles
4
4
 
5
5
  '
6
6
  - .font size/
7
- - .background color/
8
- - white/
9
- - black/
10
7
  - .list faces/
11
8
  - api/
12
9
  > Summary
@@ -31,31 +28,23 @@ class Styles
31
28
  | For styling specific text (not just a pattern):
32
29
  <<< @overlay/
33
30
  - see/
34
- > List styles in current page in web browser
35
31
  <<< @css/list/
32
+ <<< @themes/
36
33
  '
37
34
  # > Apply multiple fonts and groups
38
35
 
39
36
  end
40
37
 
41
- def self.background_color color
42
-
43
- $el.customize_set_variable(:background_mode_type, color == "black" ? :dark : :light)
44
-
38
+ def self.reload_styles
45
39
  Notes.define_styles
46
40
  FileTree.define_styles
47
- Styles.use_xiki_color_scheme
48
- Styles.define_misc_face_colors
49
41
  Color.define_styles
50
-
51
- nil
52
42
  end
53
43
 
54
44
  def self.font_size size=nil
55
45
 
56
46
  # If nothing passed, show default sizes
57
47
 
58
-
59
48
  if ! size
60
49
  return "
61
50
  - original) #{Styles.height}
@@ -71,7 +60,6 @@ class Styles
71
60
  Styles.define :default, :size=>size.to_i
72
61
 
73
62
  # To resize mode lines
74
- Themes.use "Shiny Blue"
75
63
  Notes.define_styles
76
64
  FileTree.define_styles
77
65
 
@@ -106,13 +94,8 @@ class Styles
106
94
  nil
107
95
  end
108
96
 
109
- def self.inverse_bg enable=true
110
- $el.customize_set_variable(:background_mode_type, enable ? :dark : :light)
111
- end
112
-
113
- def self.inverse
114
- $el.boundp(:background_mode_type) &&
115
- $el.elvar.background_mode_type.to_s == 'dark'
97
+ def self.dark_bg?
98
+ Styles.attribute(:default, :background)[1..1][/[0-7]/]
116
99
  end
117
100
 
118
101
  def self.exand_colors options, keys
@@ -166,30 +149,6 @@ class Styles
166
149
  $el.el4r_lisp_eval code
167
150
  end
168
151
 
169
- def self.define_misc_face_colors
170
-
171
- if Styles.inverse
172
-
173
- Styles.define :font_lock_comment_face, :fg=>'777' # gray
174
- Styles.define :font_lock_function_name_face, :fg=>'f50' # orange
175
- Styles.define :font_lock_type_face, :fg=>'0a1' # green
176
- Styles.define :font_lock_variable_name_face, :fg=>'fd0' # yellow
177
- Styles.define :font_lock_string_face, :fg=>'e10' # red
178
- Styles.define :font_lock_keyword_face, :fg=>'999'
179
-
180
- else
181
-
182
- Styles.define :font_lock_comment_face, :fg=>'aaa' # gray
183
- Styles.define :font_lock_function_name_face, :fg=>'f50' # orange
184
- Styles.define :font_lock_type_face, :fg=>'090', :bold=>nil # green
185
- Styles.define :font_lock_variable_name_face, :fg=>'00c', :bold=>1 # yellow
186
- Styles.define :font_lock_string_face, :fg=>'e10', :bold=>nil # red
187
- Styles.define :font_lock_keyword_face, :fg=>'888', :bold=>1 # blue
188
-
189
- end
190
-
191
- end
192
-
193
152
  def self.apply(pattern, *styles)
194
153
  # Make back-slashes double
195
154
  pattern.gsub!("\\", '\\\\\\\\')
@@ -232,6 +191,10 @@ class Styles
232
191
  $el.el4r_lisp_eval "(face-attribute 'default :height)"
233
192
  end
234
193
 
194
+ #
195
+ # Styles.attribute "mode-line", "background"
196
+ # Styles.attribute "mode-line", "box"
197
+ #
235
198
  def self.attribute style, attribute
236
199
  $el.el4r_lisp_eval "(face-attribute '#{style} :#{attribute})"
237
200
  end
@@ -243,32 +206,5 @@ class Styles
243
206
  size + relative * 5
244
207
  end
245
208
 
246
- def self.use_xiki_color_scheme
247
- if Styles.inverse # Use black
248
- # Mode line (bar between windows)
249
-
250
- $el.set_face_background :trailing_whitespace, "#333333"
251
- Styles.define :default, :bg=>'111111', :fg=>'ffffff'
252
- Styles.define :cursor, :bg=>'ffffff', :fg=>'000000'
253
-
254
- Styles.define :fringe, :bg=>'111111', :fg=>'666666'
255
-
256
- # Dark gray scheme
257
- Styles.define :mode_line, :bg=>'333', :border=>['666', -1], :face=>'Lucida Grande', :size=>'3', :bold=>false, :fg=>'fff'
258
- Styles.define :mode_line_inactive, :bg=>'666', :border=>['888', -1], :face=>'Lucida Grande', :size=>'3', :bold=>false, :fg=>'fff'
259
-
260
- else
261
- $el.set_face_background :trailing_whitespace, "#aaaaaa"
262
- Styles.define :default, :bg=>'ffffff', :fg=>'000000'# , :height=>110
263
- Styles.define :cursor, :bg=>'333333', :fg=>'ffffff'
264
- Styles.define :fringe, :bg=>'ffffff', :fg=>'cccccc' # eg border / status
265
-
266
- Styles.define :mode_line, :fg=>'222222', :bg=>'555', :border=>['333', -1], :face=>'Lucida Grande', :size=>'3', :bold=>false
267
- Styles.define :mode_line_inactive, :fg=>'999999', :bg=>'888', :border=>['666', -1], :face=>'Lucida Grande', :size=>'3', :bold=>false
268
-
269
- end
270
-
271
- end
272
-
273
209
  end
274
210
  Styles.init
File without changes
@@ -1,5 +1,5 @@
1
- require 'line'
2
- require 'ol'
1
+ require 'xiki/line'
2
+ require 'xiki/ol'
3
3
 
4
4
  class TextUtil
5
5
 
@@ -1,4 +1,4 @@
1
- require 'tree_cursor'
1
+ require 'xiki/tree_cursor'
2
2
 
3
3
  class Tree
4
4
  def self.menu
@@ -46,7 +46,9 @@ class Tree
46
46
 
47
47
  # Make cursor blue
48
48
  Cursor.remember :before_file_tree
49
- Cursor.blue
49
+
50
+ Cursor.box
51
+
50
52
  error = ""
51
53
 
52
54
  pattern = ""
@@ -69,10 +71,8 @@ class Tree
69
71
 
70
72
  # While chars to search for (alpha chars etc.), narrow down list...
71
73
 
72
- while (ch =~ /[ -"&-),-.\/-:<?A-~]/ && # Be careful editing, due to ranges (_-_)
73
- (ch_raw < 67108912 || ch_raw > 67108921) && ch_raw != 67108909) || # If not control-<number> or C--
74
- (recursive && ch_raw == 2 || ch_raw == 6) ||
75
- ch == :up || ch == :down
74
+ while ch.is_a?(String) && (ch =~ /[ -"&-),-.\/-:<?A-~]/ && # Be careful editing, due to ranges (_-_)
75
+ (ch_raw < 67108912 || ch_raw > 67108921) && ch_raw != 67108909) # || # If not control-<number> or C--
76
76
 
77
77
  if ch == ' ' && pattern != "" # If space and not already cleared out
78
78
  pattern = ''
@@ -89,12 +89,6 @@ class Tree
89
89
  Line.to_words
90
90
  break # Otherwise, stop
91
91
  end
92
- elsif ch == :up
93
- Line.previous
94
- Line.to_words
95
- elsif ch == :down
96
- Line.next
97
- Line.to_words
98
92
 
99
93
  else
100
94
  if ch == "\\" # If escape, get real char
@@ -151,13 +145,13 @@ class Tree
151
145
  else
152
146
  Line.to_beginning
153
147
  end
154
-
155
148
  end
156
149
 
157
150
  message = "filter... #{pattern}#{error}"
158
151
  message << " (space for 'and')" if pattern.present?
159
152
  Message << message
160
153
  ch, ch_raw = Keys.char
154
+
161
155
  if ch.nil?
162
156
  return Cursor.restore(:before_file_tree)
163
157
  end
@@ -191,6 +185,19 @@ class Tree
191
185
  self.to_parent
192
186
  self.kill_under
193
187
  FileTree.dir
188
+ elsif ch == 'a' # just_all
189
+
190
+ # If a quote, insert lines indented lower
191
+ if Line.matches(/\|/)
192
+ CodeTree.kill_siblings
193
+ self.enter_under
194
+ elsif FileTree.dir? # A Dir, so do recursive search
195
+ $el.delete_region(Line.left(2), right)
196
+ FileTree.dir_recursive
197
+ else # A file, so enter lines
198
+ $el.delete_region(Line.left(2), right)
199
+ FileTree.enter_lines(//) # Insert all lines
200
+ end
194
201
  end
195
202
  when :return # If return, just stop (like isearch)
196
203
  # Do nothing
@@ -198,15 +205,14 @@ class Tree
198
205
  Keys.clear_prefix
199
206
  Launcher.launch
200
207
 
201
- # when :control_return, :return, "\C-m", :control_period, :right # If C-., go in but don't collapse siblings
202
- when :control_return, "\C-m", :control_period, :right # If C-., go in but don't collapse siblings
208
+ when :control_return, "\C-m", :control_period #, :right # If C-., go in but don't collapse siblings
203
209
  Keys.clear_prefix
204
210
  Launcher.launch
205
211
  when "\t" # If tab, hide siblings and go in
206
212
  $el.delete_region(Line.left(2), right)
207
213
  Keys.clear_prefix
208
214
  Launcher.launch
209
- when :backspace, :left # Collapse tree
215
+ when :backspace #, :left # Collapse tree
210
216
  self.to_parent
211
217
  self.kill_under
212
218
  self.search(:left => Line.left, :right => Line.left(2))
@@ -299,18 +305,12 @@ class Tree
299
305
  View.create
300
306
  Launcher.launch
301
307
 
308
+ when "\C-e" # Also C-a
309
+ return Line.to_right
310
+
302
311
  when "\C-a" # Also C-a
303
- # If a quote, insert lines indented lower
304
- if Line.matches(/\|/)
305
- CodeTree.kill_siblings
306
- self.enter_under
307
- elsif FileTree.dir? # A Dir, so do recursive search
308
- $el.delete_region(Line.left(2), right)
309
- FileTree.dir_recursive
310
- else # A file, so enter lines
311
- $el.delete_region(Line.left(2), right)
312
- FileTree.enter_lines(//) # Insert all lines
313
- end
312
+
313
+ return Line.to_left
314
314
 
315
315
  when "\C-o" # When 9 or C-o, show methods, or outline
316
316
  $el.delete_region(Line.left(2), right) # Delete other files
@@ -320,9 +320,7 @@ class Tree
320
320
  $el.delete_region(Line.left(2), right) # Delete other files
321
321
  View.bar
322
322
  Keys.clear_prefix
323
- # Expand or open
324
- Launcher.launch
325
- return
323
+ return Launcher.launch # Expand or open
326
324
  end
327
325
  Keys.clear_prefix
328
326
  n = ch.to_i
@@ -401,6 +399,14 @@ class Tree
401
399
 
402
400
  when "\a" # Typed C-g
403
401
  View.beep
402
+ when :left
403
+ Move.backward
404
+ when :right
405
+ Move.forward
406
+ when :up
407
+ $el.previous_line
408
+ when :down
409
+ $el.next_line
404
410
  else
405
411
  $el.command_execute ch
406
412
  end
@@ -1146,7 +1152,8 @@ class Tree
1146
1152
  # Go through lines in file until end of section
1147
1153
  matches = ""
1148
1154
  found_yet = false
1149
- IO.foreach(path) do |l|
1155
+
1156
+ IO.foreach(path, *Files.encoding_binary) do |line|
1150
1157
  l.sub!(/[\r\n]+$/, '')
1151
1158
  l.gsub!("\c@", '.') # Replace out characters that el4r can't handle
1152
1159
  # Swallow up until match
@@ -1170,7 +1177,8 @@ class Tree
1170
1177
  indent = line[/^\s*/].gsub("\t", ' ').length
1171
1178
  matches = ""
1172
1179
  found_yet = false
1173
- IO.foreach(path) do |l|
1180
+
1181
+ IO.foreach(path, *Files.encoding_binary) do |line|
1174
1182
  l.sub!(/[\r\n]+$/, '')
1175
1183
  l.gsub!("\c@", '.') # Replace out characters that el4r can't handle
1176
1184
  # Swallow up until match
File without changes
File without changes
@@ -1,3 +1,4 @@
1
+ # -*- coding: utf-8 -*-
1
2
  #
2
3
  # Represents a division of a window (in emacs terms, it's a window (which is within a frame))
3
4
  #
@@ -103,7 +104,7 @@ class View
103
104
 
104
105
 
105
106
  def self.enlarge height=nil
106
- default_height = 3
107
+ default_height = 4
107
108
  small = Keys.prefix || height || default_height
108
109
  small = default_height if small == :u
109
110
 
@@ -121,10 +122,23 @@ class View
121
122
  biggest = usable_height - ((wnum-1) * (small-1))
122
123
  selected = $el.selected_window
123
124
 
124
- # Do multiple times (emacs daesn't get it right he first time)
125
- 5.times do
126
- self.enlarge_internal :up, ws, selected, biggest, small
127
- end
125
+
126
+ # Remember borders, and get rid of external border temporarily (it messes up heights)
127
+ $el.elvar.xiki_modeline_box_tmp = Styles.attribute "mode-line", "box"
128
+ $el.elvar.xiki_modeline_inactive_box_tmp = Styles.attribute "mode-line-inactive", "box"
129
+ Styles.mode_line_inactive :border=>:nil
130
+ Styles.mode_line :border=>:nil
131
+
132
+ # Maybe have to redraw here?!
133
+ View.refresh
134
+
135
+ # Set border to 0
136
+
137
+ self.enlarge_internal :up, ws, selected, biggest, small
138
+
139
+ # Restore borders
140
+ $el.set_face_attribute :mode_line, nil, ':box'.to_sym, $el.elvar.xiki_modeline_box_tmp
141
+ $el.set_face_attribute :mode_line_inactive, nil, ':box'.to_sym, $el.elvar.xiki_modeline_inactive_box_tmp
128
142
 
129
143
  nil
130
144
  end
@@ -132,16 +146,19 @@ class View
132
146
  def self.enlarge_internal direction, ws, selected, biggest, small
133
147
  ws = ws.reverse if direction != :up
134
148
 
135
- ws.each do |w|
136
- # If current window, set to remaining
137
- if w == selected
138
- height = biggest # - 1
139
- $el.set_window_text_height w, height
140
- else
141
- height = small - 1
142
- $el.set_window_text_height w, height
149
+ 3.times do
150
+ ws.each_with_index do |w, i|
151
+ # If current window, set to remaining
152
+ if w == selected
153
+ height = biggest
154
+ $el.set_window_text_height w, height
155
+ else # Other small windows
156
+ height = small - 1
157
+ $el.set_window_text_height w, height
158
+ end
143
159
  end
144
160
  end
161
+
145
162
  end
146
163
 
147
164
  # Creates a new window by splitting the current one
@@ -1047,6 +1064,12 @@ class View
1047
1064
  end
1048
1065
 
1049
1066
  def self.kill
1067
+
1068
+ # To avoid "Buffer has a running process; keep the buffer? (y or n)" message
1069
+ if process = $el.get_buffer_process(View.buffer)
1070
+ $el.set_process_query_on_exit_flag process, nil
1071
+ end
1072
+
1050
1073
  $el.kill_this_buffer
1051
1074
  nil
1052
1075
  end
@@ -1255,7 +1278,7 @@ class View
1255
1278
  end
1256
1279
 
1257
1280
  def self.gsub! from, to
1258
- with(:save_excursion) do
1281
+ $el.with(:save_excursion) do
1259
1282
  View.to_highest
1260
1283
  $el.replace_regexp(from, to)
1261
1284
  end
@@ -1402,7 +1425,7 @@ class View
1402
1425
  txt = txt.reverse.uniq.join
1403
1426
  end
1404
1427
 
1405
- def self.refresh
1428
+ def self.refresh # redraw
1406
1429
  $el.sit_for 0
1407
1430
  end
1408
1431
 
@@ -1454,7 +1477,7 @@ class View
1454
1477
 
1455
1478
  if scale = options[:scale]
1456
1479
  nth = 3
1457
- val = {0=>' ', 1=>'e', 2=>'i', 3=>'v', 4=>'', 5=>''}[scale]
1480
+ val = {0=>' ', 1=>'e', 2=>'i', 3=>'v', 4=>'ø', 5=>'ß'}[scale]
1458
1481
  end
1459
1482
 
1460
1483
  key = "xiki_status#{nth}".to_sym
@@ -0,0 +1,8 @@
1
+ class Line
2
+ def self.number
3
+ $curbuf.line_number
4
+ end
5
+ def self.value
6
+ $curbuf.line
7
+ end
8
+ end
@@ -0,0 +1,9 @@
1
+ class Tree
2
+ def self.<< txt
3
+ line_number, line = Line.number, Line.value
4
+ indent = line[/^ +/]
5
+ txt.split("\n").each_with_index do |line, i|
6
+ $curbuf.append(line_number + i, "#{indent} #{line}")
7
+ end
8
+ end
9
+ end