xiki 0.5.1a → 0.5.3a
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile +1 -11
- data/README.markdown +67 -43
- data/bin/xiki +2 -15
- data/etc/command/xiki_command.rb +115 -41
- data/etc/command/xiki_process.rb +3 -7
- data/etc/install/el4r_setup.sh +5 -0
- data/etc/themes/Black_BG.notes +8 -0
- data/etc/themes/Dark_Metal.notes +0 -6
- data/etc/themes/Default.notes +24 -0
- data/etc/themes/Fall_Fonts.notes +6 -0
- data/etc/themes/Light_Gray_BG_Theme.notes +6 -0
- data/etc/themes/Orange_Path.notes +1 -1
- data/etc/themes/Pastel_Fonts.notes +6 -0
- data/etc/themes/Path_Mode_Line.notes +36 -0
- data/etc/themes/Rainbow_Fonts.notes +20 -0
- data/etc/themes/Shiny_Blue.notes +14 -18
- data/etc/themes/Shiny_Green.notes +0 -6
- data/etc/themes/White_BG.notes +5 -0
- data/etc/vim/vim_status.notes +32 -0
- data/etc/vim/xiki.vim +16 -0
- data/etc/wrappers/wrapper.rb +2 -2
- data/etc/www/index.rb +1 -1
- data/etc/www/public/error.html +47 -0
- data/etc/www/sinatra_server.rb +353 -0
- data/etc/www/web_server.rb +0 -252
- data/lib/xiki.rb +94 -26
- data/lib/{block.rb → xiki/block.rb} +0 -0
- data/lib/{bookmarks.rb → xiki/bookmarks.rb} +11 -10
- data/lib/{buffers.rb → xiki/buffers.rb} +10 -10
- data/lib/{clipboard.rb → xiki/clipboard.rb} +2 -2
- data/lib/{code.rb → xiki/code.rb} +3 -7
- data/lib/{code_tree.rb → xiki/code_tree.rb} +3 -3
- data/lib/{color.rb → xiki/color.rb} +4 -14
- data/lib/{console.rb → xiki/console.rb} +6 -0
- data/lib/{control_lock.rb → xiki/control_lock.rb} +5 -1
- data/lib/{control_tab.rb → xiki/control_tab.rb} +3 -1
- data/lib/{core_ext.rb → xiki/core_ext.rb} +7 -3
- data/lib/{cursor.rb → xiki/cursor.rb} +4 -5
- data/lib/{deletes.rb → xiki/deletes.rb} +0 -0
- data/lib/{diff_log.rb → xiki/diff_log.rb} +4 -4
- data/lib/{effects.rb → xiki/effects.rb} +5 -2
- data/lib/{environment.rb → xiki/environment.rb} +0 -0
- data/lib/{file_tree.rb → xiki/file_tree.rb} +34 -24
- data/lib/{files.rb → xiki/files.rb} +15 -5
- data/lib/{hide.rb → xiki/hide.rb} +0 -0
- data/lib/{history.rb → xiki/history.rb} +1 -0
- data/lib/{image.rb → xiki/image.rb} +0 -0
- data/lib/{incrementer.rb → xiki/incrementer.rb} +0 -0
- data/lib/{insert.rb → xiki/insert.rb} +0 -0
- data/lib/{irc.rb → xiki/irc.rb} +0 -0
- data/lib/{key_bindings.rb → xiki/key_bindings.rb} +7 -4
- data/lib/{keys.rb → xiki/keys.rb} +32 -36
- data/lib/{launcher.rb → xiki/launcher.rb} +42 -23
- data/lib/{line.rb → xiki/line.rb} +1 -1
- data/lib/{links.rb → xiki/links.rb} +0 -0
- data/lib/{location.rb → xiki/location.rb} +0 -0
- data/lib/{macros.rb → xiki/macros.rb} +0 -0
- data/lib/{man.rb → xiki/man.rb} +0 -0
- data/lib/{menu.rb → xiki/menu.rb} +62 -11
- data/lib/{merb.rb → xiki/merb.rb} +1 -1
- data/lib/{message.rb → xiki/message.rb} +0 -0
- data/lib/{meths.rb → xiki/meths.rb} +0 -0
- data/lib/{mode.rb → xiki/mode.rb} +0 -0
- data/lib/{move.rb → xiki/move.rb} +1 -1
- data/lib/{notes.rb → xiki/notes.rb} +41 -37
- data/lib/{numbers.rb → xiki/numbers.rb} +0 -0
- data/lib/{ol.rb → xiki/ol.rb} +2 -3
- data/lib/{ol_helper.rb → xiki/ol_helper.rb} +0 -0
- data/lib/{overlay.rb → xiki/overlay.rb} +0 -0
- data/lib/{pause_means_space.rb → xiki/pause_means_space.rb} +2 -2
- data/lib/{php.rb → xiki/php.rb} +0 -0
- data/lib/{projects.rb → xiki/projects.rb} +8 -1
- data/lib/{relinquish_exception.rb → xiki/relinquish_exception.rb} +0 -0
- data/lib/{remote.rb → xiki/remote.rb} +2 -2
- data/lib/{requirer.rb → xiki/requirer.rb} +3 -3
- data/lib/{rest_tree.rb → xiki/rest_tree.rb} +0 -0
- data/lib/{ruby.rb → xiki/ruby.rb} +0 -0
- data/lib/{ruby_console.rb → xiki/ruby_console.rb} +0 -0
- data/lib/{search.rb → xiki/search.rb} +7 -8
- data/lib/{search_term.rb → xiki/search_term.rb} +0 -0
- data/lib/{snippet.rb → xiki/snippet.rb} +0 -0
- data/lib/{specs.rb → xiki/specs.rb} +0 -0
- data/lib/{styles.rb → xiki/styles.rb} +8 -72
- data/lib/{svn.rb → xiki/svn.rb} +0 -0
- data/lib/{text_util.rb → xiki/text_util.rb} +2 -2
- data/lib/{tree.rb → xiki/tree.rb} +40 -32
- data/lib/{tree_cursor.rb → xiki/tree_cursor.rb} +0 -0
- data/lib/{trouble_shooting.rb → xiki/trouble_shooting.rb} +0 -0
- data/lib/{url_tree.rb → xiki/url_tree.rb} +0 -0
- data/lib/{view.rb → xiki/view.rb} +39 -16
- data/lib/xiki/vim/line.rb +8 -0
- data/lib/xiki/vim/tree.rb +9 -0
- data/lib/{window.rb → xiki/window.rb} +0 -0
- data/menus/address_book.rb +6 -4
- data/menus/agenda.rb +3 -3
- data/menus/amazon.rb +2 -2
- data/menus/applescript.rb +21 -10
- data/menus/black.menu +1 -0
- data/menus/bootstrap.rb +2 -7
- data/menus/browser.rb +8 -5
- data/menus/cassandra_db.rb +2 -2
- data/menus/chmod.rb +1 -1
- data/menus/conf.rb +5 -0
- data/menus/cookies.rb +1 -1
- data/menus/css.rb +2 -2
- data/menus/deck.rb +1 -1
- data/menus/dimensions_config.menu +30 -0
- data/menus/dimensions_config.rb +5 -0
- data/menus/docs.rb +33 -34
- data/menus/dotsies.rb +1 -0
- data/menus/emacs.rb +7 -2
- data/menus/firefox.rb +25 -25
- data/menus/git.rb +1 -1
- data/menus/gito.rb +2 -2
- data/menus/headings.rb +3 -3
- data/menus/ip.rb +2 -4
- data/menus/itunes.rb +9 -2
- data/menus/javascript.rb +3 -1
- data/menus/local_storage.rb +4 -4
- data/menus/mac.rb +2 -1
- data/menus/maps.rb +2 -2
- data/menus/models.rb +31 -0
- data/menus/mongo.rb +2 -2
- data/menus/piano.rb +47 -23
- data/menus/r.rb +57 -0
- data/menus/rails.rb +89 -27
- data/menus/redmine.rb +1 -1
- data/menus/sass.rb +1 -1
- data/menus/settings.menu +2 -0
- data/menus/technologies.rb +4 -1
- data/menus/web_interface.rb +58 -0
- data/menus/welcome.menu +18 -0
- data/menus/white.menu +1 -0
- data/menus/youtube.rb +32 -0
- data/spec/code_tree_spec.rb +1 -1
- data/spec/diff_log_spec.rb +4 -4
- data/spec/file_tree_spec.rb +2 -2
- data/spec/line_spec.rb +2 -2
- data/spec/menu_spec.rb +5 -5
- data/spec/ol_spec.rb +3 -3
- data/spec/remote_spec.rb +2 -2
- data/spec/search_spec.rb +2 -2
- data/spec/text_util_spec.rb +1 -1
- data/spec/tree_cursor_spec.rb +3 -3
- data/spec/tree_spec.rb +3 -3
- data/xiki.gemspec +22 -6
- metadata +311 -76
- data/menus/dir.rb +0 -8
@@ -181,16 +181,16 @@ class Files
|
|
181
181
|
|
182
182
|
def self.open_edited
|
183
183
|
case Keys.prefix
|
184
|
-
when :u, 8
|
184
|
+
when :u, 8; Launcher.open("- edited/tree/")
|
185
185
|
else Launcher.open("- edited/")
|
186
186
|
end
|
187
187
|
end
|
188
188
|
|
189
189
|
def self.open_history
|
190
190
|
case Keys.prefix
|
191
|
-
when nil
|
192
|
-
when 0
|
193
|
-
when :u
|
191
|
+
when nil; Keys.prefix = nil; Launcher.open("- Files.history/")
|
192
|
+
when 0; Launcher.open("- Files.history_tree/")
|
193
|
+
when :u; Launcher.open("- Files.history_tree 7/")
|
194
194
|
else Launcher.open("- Files.history_tree #{Keys.prefix}/")
|
195
195
|
end
|
196
196
|
end
|
@@ -308,7 +308,7 @@ class Files
|
|
308
308
|
return View.beep("- There's no file for this buffer!") if ! dest_path
|
309
309
|
|
310
310
|
View.beep :times=>3
|
311
|
-
View.flash "- Delete CURRENT file
|
311
|
+
View.flash "- Delete CURRENT file (#{View.name})?", :times=>4
|
312
312
|
answer = Keys.input :chars=>1, :prompt=>"- Delete current file for sure?" #"
|
313
313
|
|
314
314
|
return View.flash("- cancelled!") if answer !~ /y/i
|
@@ -326,6 +326,16 @@ class Files
|
|
326
326
|
|
327
327
|
end
|
328
328
|
|
329
|
+
if /^1\.9/===RUBY_VERSION
|
330
|
+
def self.encoding_binary
|
331
|
+
[{:encoding => 'binary'}]
|
332
|
+
end
|
333
|
+
else
|
334
|
+
def self.encoding_binary
|
335
|
+
[]
|
336
|
+
end
|
337
|
+
end
|
338
|
+
|
329
339
|
end
|
330
340
|
|
331
341
|
if $el
|
File without changes
|
@@ -26,6 +26,7 @@ class History
|
|
26
26
|
elsif options[:prompt_for_bookmark]
|
27
27
|
bm = Keys.input(:timed => true, :prompt => "Enter bookmark to show content for: ")
|
28
28
|
path = Bookmarks.expand(bm, :just_bookmark => true)
|
29
|
+
return View.beep("- Bookmark '#{bm}' not found!") if ! path
|
29
30
|
path = File.expand_path(path)
|
30
31
|
|
31
32
|
if ! options[:all] && View.files.member?(path)
|
File without changes
|
File without changes
|
File without changes
|
data/lib/{irc.rb → xiki/irc.rb}
RENAMED
File without changes
|
@@ -163,7 +163,6 @@ class KeyBindings
|
|
163
163
|
Keys.enter_file_path { Files.enter_file } # Given a bookmark
|
164
164
|
Keys.enter_firefox_tabs { Launcher.insert('- Firefox.tabs/') } # Given a bookmark
|
165
165
|
Keys.enter_history { DiffLog.enter_from_difflog } # Save point and go to difflog to search
|
166
|
-
Keys.enter_insert_1 { Notes.enter_do_bullet } # insert date string (and time if C-u)
|
167
166
|
Keys.enter_insert_date { View.enter_date }
|
168
167
|
Keys.enter_insert_comment { Code.enter_insert_comment } # insert date string (and time if C-u)
|
169
168
|
Keys.enter_insert_new { DiffLog.enter_new } # Enter Old: enter newly-deleted from last save
|
@@ -195,7 +194,7 @@ class KeyBindings
|
|
195
194
|
Keys.enter_like_variable { insert "\#{#{Clipboard.get(0)}}" }
|
196
195
|
|
197
196
|
Keys.enter_menu { Xiki.insert_menu } # Redundant with C-enter on blank line
|
198
|
-
Keys.enter_note { Notes.
|
197
|
+
Keys.enter_note { Notes.enter_note } # Redundant with C-enter on blank line
|
199
198
|
Keys.enter_outline { Launcher.enter_outline } # in tree, enter methods or headings
|
200
199
|
|
201
200
|
Keys.enter_push { Gito.code_tree_diff(:enter=>true) } # Commit to repos, push, etc
|
@@ -639,8 +638,12 @@ class KeyBindings
|
|
639
638
|
$el.el4r_lisp_eval("(require 'dired)")
|
640
639
|
$el.define_key :dired_mode_map, $el.kbd("C-o"), nil
|
641
640
|
$el.define_key :java_mode_map, $el.kbd("C-d"), nil
|
642
|
-
|
643
|
-
|
641
|
+
|
642
|
+
begin
|
643
|
+
$el.el_require :php_mode
|
644
|
+
$el.define_key :php_mode_map, $el.kbd("C-d"), nil
|
645
|
+
rescue Exception=>e
|
646
|
+
end
|
644
647
|
|
645
648
|
# C-l in ediff mode
|
646
649
|
$el.defun(:ediff_disable_C_l) { $el.define_key(:ediff_mode_map, $el.kbd("C-l"), nil) }
|
@@ -1,7 +1,7 @@
|
|
1
|
-
require 'pause_means_space'
|
2
|
-
require 'line'
|
3
|
-
require 'text_util'
|
4
|
-
require 'launcher'
|
1
|
+
require 'xiki/pause_means_space'
|
2
|
+
require 'xiki/line'
|
3
|
+
require 'xiki/text_util'
|
4
|
+
require 'xiki/launcher'
|
5
5
|
|
6
6
|
# Methods for defining keyboard shortcuts
|
7
7
|
class Keys
|
@@ -297,40 +297,28 @@ class Keys
|
|
297
297
|
#
|
298
298
|
# Sample usages:
|
299
299
|
# Keys.input # Terminated by enter
|
300
|
+
# Keys.input "Type something: "
|
300
301
|
# Keys.input :chars=>1 # Just one char
|
301
|
-
# Keys.input :control=>1 # One char if control
|
302
302
|
# Keys.input :timed=>1 # Terminated by pause
|
303
303
|
# Keys.input :optional=>1 # Terminated by pause
|
304
304
|
# - A pause at the beginning will result in no input (nil)
|
305
305
|
#
|
306
|
-
def self.input
|
306
|
+
def self.input *args
|
307
|
+
|
308
|
+
prompt = args.shift if args[0].is_a?(String)
|
309
|
+
|
310
|
+
options = args[0] || {}
|
307
311
|
|
308
312
|
return self.input_with_choices(options) if options[:choices]
|
309
313
|
|
310
314
|
Cursor.remember :before_input
|
311
|
-
Cursor.green
|
312
|
-
Cursor.hollow
|
313
315
|
|
314
|
-
|
316
|
+
# This is slow in mac emacs 23/24 :(
|
317
|
+
# Cursor.green
|
315
318
|
|
316
|
-
|
317
|
-
if options[:control]
|
318
|
-
prompt = "todo - implement this: "
|
319
|
-
|
320
|
-
$el.elvar.inhibit_quit = true
|
321
|
-
# Maybe use this?
|
322
|
-
# Or call self.char?
|
323
|
-
# char = $el.char_to_string(Keys.remove_control($el.read_char(prompt))).to_s
|
324
|
-
c = read_char(prompt)
|
325
|
-
$el.elvar.inhibit_quit = nil
|
326
|
-
if c == 7
|
327
|
-
Cursor.restore :before_input
|
328
|
-
keyboard_quit
|
329
|
-
end
|
319
|
+
Cursor.hollow
|
330
320
|
|
331
|
-
|
332
|
-
return c
|
333
|
-
end
|
321
|
+
prompt ||= options[:prompt] || "Input: "
|
334
322
|
|
335
323
|
if options[:chars]
|
336
324
|
char = $el.char_to_string(
|
@@ -375,7 +363,6 @@ class Keys
|
|
375
363
|
Cursor.restore :before_input
|
376
364
|
|
377
365
|
$el.message ""
|
378
|
-
|
379
366
|
# If nothing, return nil
|
380
367
|
keys == "" ? nil : keys
|
381
368
|
end
|
@@ -392,9 +379,10 @@ class Keys
|
|
392
379
|
|
393
380
|
def self.to_letter ch
|
394
381
|
return nil if ch.nil?
|
395
|
-
if ch
|
382
|
+
if ch == 0
|
383
|
+
ch = 32
|
384
|
+
elsif ch < 27
|
396
385
|
ch += 96
|
397
|
-
|
398
386
|
elsif 67108896 <= ch and ch <= 67108921
|
399
387
|
ch -= 67108864
|
400
388
|
end
|
@@ -461,7 +449,7 @@ class Keys
|
|
461
449
|
end
|
462
450
|
|
463
451
|
file, line = Code.location_from_proc proc
|
464
|
-
file = "#{
|
452
|
+
file = "#{Xiki.dir}#{file}" unless file =~ /^\//
|
465
453
|
Location.go(file)
|
466
454
|
View.to_line line.to_i
|
467
455
|
Effects.blink(:what=>:line)
|
@@ -496,7 +484,9 @@ class Keys
|
|
496
484
|
end
|
497
485
|
|
498
486
|
Cursor.remember :before_q
|
499
|
-
Cursor.
|
487
|
+
Cursor.box
|
488
|
+
# This is slow in mac emacs 23/24 :(
|
489
|
+
# Cursor.green
|
500
490
|
|
501
491
|
# Get first char and insert
|
502
492
|
c = $el.read_char("insert text (pause to exit): ").chr
|
@@ -624,6 +614,7 @@ class Keys
|
|
624
614
|
|
625
615
|
def self.bookmark_as_path options={}
|
626
616
|
bm = options[:bm] || Keys.input(:timed=>true, :prompt=>options[:prompt]||"Enter a bookmark: ")
|
617
|
+
|
627
618
|
if bm == " " # If space, return special token
|
628
619
|
return :space
|
629
620
|
elsif bm == "/" # If slash, return special token
|
@@ -674,7 +665,6 @@ class Keys
|
|
674
665
|
end
|
675
666
|
|
676
667
|
def self.char
|
677
|
-
|
678
668
|
$el.elvar.inhibit_quit = true
|
679
669
|
ch_initial = $el.read_event.to_s
|
680
670
|
$el.elvar.inhibit_quit = nil
|
@@ -685,11 +675,17 @@ class Keys
|
|
685
675
|
return ["meta_#{(ch_raw - 134217728).chr}".to_sym, nil]
|
686
676
|
end
|
687
677
|
|
688
|
-
# If char is over the elisp max, try to interpret it as Meta
|
689
|
-
ch = $el.char_to_string(ch_raw)
|
690
678
|
# Special check for C-. and other sequences
|
691
|
-
ch =
|
692
|
-
|
679
|
+
ch = if ch_raw == 67108910
|
680
|
+
:control_period
|
681
|
+
elsif ch_raw >= 67108912 && ch_raw <= 67108921 # If between C-0 and C-9
|
682
|
+
(ch_raw - 67108864).chr
|
683
|
+
elsif ch_raw == 67108911
|
684
|
+
:control_slash
|
685
|
+
else
|
686
|
+
# If char is over the elisp max, try to interpret it as Meta
|
687
|
+
$el.char_to_string(ch_raw)
|
688
|
+
end
|
693
689
|
return [ch, ch_raw]
|
694
690
|
|
695
691
|
elsif ['left', 'right', 'up', 'down', ].member?(ch_initial)
|
@@ -1,8 +1,11 @@
|
|
1
|
-
require 'effects'
|
2
|
-
require 'requirer'
|
3
|
-
|
1
|
+
require 'xiki/effects'
|
2
|
+
require 'xiki/requirer'
|
4
3
|
require 'xiki'
|
5
4
|
|
5
|
+
require 'sourcify'
|
6
|
+
require 'ruby_parser'
|
7
|
+
require 'file-tail'
|
8
|
+
|
6
9
|
Requirer.require_gem 'activesupport', :name2=>'active_support/ordered_hash'
|
7
10
|
Requirer.require_gem 'httparty', :optional=>1 # Not super-important
|
8
11
|
Requirer.require_gem 'haml', :optional=>1
|
@@ -232,7 +235,9 @@ class Launcher
|
|
232
235
|
# Special case to turn launchers back on
|
233
236
|
return self.show_or_launch if line == "launcher/setup/show or launch/"
|
234
237
|
|
235
|
-
|
238
|
+
# Try each potential regex match...
|
239
|
+
|
240
|
+
@@launchers.each do |regex, block|
|
236
241
|
# If we found a match, launch it
|
237
242
|
if line =~ regex
|
238
243
|
group = $1
|
@@ -247,7 +252,8 @@ class Launcher
|
|
247
252
|
rescue RelinquishException
|
248
253
|
next # They didn't want to handle it, keep going
|
249
254
|
rescue Exception=>e
|
250
|
-
|
255
|
+
# Show error and sourche of block
|
256
|
+
Tree.<< CodeTree.draw_exception(e, block.to_source), :no_slash=>true
|
251
257
|
end
|
252
258
|
|
253
259
|
end
|
@@ -256,7 +262,7 @@ class Launcher
|
|
256
262
|
end
|
257
263
|
end
|
258
264
|
|
259
|
-
# If current line is indented and not passed recursively yet, try again, passing tree
|
265
|
+
# If current line is indented and not passed recursively yet, try again, passing tree...
|
260
266
|
|
261
267
|
if Line.value =~ /^ / && ! options[:line] && !is_root # If indented, call .launch recursively
|
262
268
|
|
@@ -287,7 +293,7 @@ class Launcher
|
|
287
293
|
return View.message "Don't know what to do with this line"
|
288
294
|
end
|
289
295
|
|
290
|
-
# See if it
|
296
|
+
# See if it's a menu...
|
291
297
|
|
292
298
|
self.set_env_vars line
|
293
299
|
|
@@ -295,6 +301,8 @@ class Launcher
|
|
295
301
|
self.unset_env_vars
|
296
302
|
return if result
|
297
303
|
|
304
|
+
# Do "autocomplete" - show all menus that start with this...
|
305
|
+
|
298
306
|
if line =~ /^([\w -]*)$/ || line =~ /^([\w -]*)\.\.\.\/?$/
|
299
307
|
|
300
308
|
# if line =~ /^([\w -]*)(\.\.\.)?\/?$/
|
@@ -320,7 +328,7 @@ class Launcher
|
|
320
328
|
end
|
321
329
|
end
|
322
330
|
|
323
|
-
# If just root line, load any unloaded launchers this completes and relaunch
|
331
|
+
# If just root line, load any unloaded launchers this completes and relaunch...
|
324
332
|
|
325
333
|
# Failed attempt to not auto-complete if slash
|
326
334
|
# It's tough because we still want to load!
|
@@ -347,6 +355,7 @@ class Launcher
|
|
347
355
|
end
|
348
356
|
|
349
357
|
if root = line[/^[\w -]+/]
|
358
|
+
|
350
359
|
Xiki.dont_search
|
351
360
|
# Maybe make the following print out optionally, via a 'help_last' block?
|
352
361
|
Tree << "
|
@@ -363,7 +372,6 @@ class Launcher
|
|
363
372
|
end
|
364
373
|
|
365
374
|
def self.try_menu_launchers line, options={}
|
366
|
-
|
367
375
|
# If there's a /@ in the path, cut it off
|
368
376
|
line.sub! /.+\/@/, ''
|
369
377
|
|
@@ -390,7 +398,7 @@ class Launcher
|
|
390
398
|
# remove file
|
391
399
|
|
392
400
|
else # If doesn't exist
|
393
|
-
|
401
|
+
Tree.<< "> Dir doesn't exist. Create it?\n@mkdir/\n"
|
394
402
|
return true
|
395
403
|
end
|
396
404
|
end
|
@@ -401,7 +409,7 @@ class Launcher
|
|
401
409
|
if block_dot_menu = @@menus[0][root]
|
402
410
|
|
403
411
|
if @@just_show
|
404
|
-
Ol.line "Maps to .menu file, for menu: #{root}\n - #{block_dot_menu}\n - #{block_dot_menu.
|
412
|
+
Ol.line "Maps to .menu file, for menu: #{root}\n - #{block_dot_menu}\n - #{block_dot_menu.to_source}"
|
405
413
|
View.flash "- Showed launcher in $o", :times=>4
|
406
414
|
return true # To make it stop trying to run it
|
407
415
|
end
|
@@ -433,7 +441,7 @@ class Launcher
|
|
433
441
|
if block_other = @@menus[1][root] # If class menu
|
434
442
|
|
435
443
|
if @@just_show
|
436
|
-
Ol.line << "Maps to class or other block, for menu: #{root}\n - #{block_other}\n - #{block_other.
|
444
|
+
Ol.line << "Maps to class or other block, for menu: #{root}\n - #{block_other}\n - #{block_other.to_source}"
|
437
445
|
View.flash "- Showed launcher in $o", :times=>4
|
438
446
|
return true # To make it stop trying to run it
|
439
447
|
end
|
@@ -489,7 +497,7 @@ class Launcher
|
|
489
497
|
condition_proc, block = launcher
|
490
498
|
if found = condition_proc.call(list) # If we found a match, launch it
|
491
499
|
if @@just_show
|
492
|
-
Ol << condition_proc.
|
500
|
+
Ol << condition_proc.to_source
|
493
501
|
else
|
494
502
|
block.call list[found..-1]
|
495
503
|
end
|
@@ -538,7 +546,7 @@ class Launcher
|
|
538
546
|
if prefix == "all"
|
539
547
|
txt = RestTree.request("GET", url)
|
540
548
|
txt = Tree.quote(txt) if txt =~ /\A<\w/
|
541
|
-
Tree.under txt, :no_slash=>1
|
549
|
+
Tree.under Tree.quote(txt), :no_slash=>1
|
542
550
|
next
|
543
551
|
end
|
544
552
|
url.gsub! '%', '%25'
|
@@ -594,10 +602,20 @@ class Launcher
|
|
594
602
|
line =~ /([$\/.\w\-]+):(\d+)/
|
595
603
|
path, line = $1, $2
|
596
604
|
|
597
|
-
|
598
|
-
|
599
|
-
path =
|
600
|
-
|
605
|
+
if path =~ /^(\w.*)/ || path =~ /^\.\/(.+)/
|
606
|
+
|
607
|
+
path = $1
|
608
|
+
|
609
|
+
local_path = "#{View.dir}/#{path}".sub "//", "/"
|
610
|
+
xiki_path = "#{Xiki.dir}/#{path}".sub "//", "/"
|
611
|
+
if File.exists? local_path
|
612
|
+
path = local_path
|
613
|
+
elsif File.exist? xiki_path
|
614
|
+
path = xiki_path
|
615
|
+
end
|
616
|
+
|
617
|
+
else
|
618
|
+
return ".flash - File doesn't exist!" if ! File.exists? path
|
601
619
|
end
|
602
620
|
|
603
621
|
View.open path
|
@@ -653,13 +671,14 @@ class Launcher
|
|
653
671
|
end
|
654
672
|
|
655
673
|
Launcher.add /^[a-z]+\+[a-z+]+\/?$/ do |path|
|
656
|
-
|
674
|
+
txt = %`
|
657
675
|
| If you were told to "type #{path}", it is meant that you should
|
658
|
-
| "type the acronym" while holding down control. This means
|
676
|
+
| "type the acronym" while holding down control. This means
|
659
677
|
| you should type:
|
660
678
|
|
|
661
679
|
| #{Keys.human_readable(path)}
|
662
680
|
`
|
681
|
+
Tree.<< txt, :no_slash=>1
|
663
682
|
end
|
664
683
|
|
665
684
|
# Menu launchers
|
@@ -948,6 +967,7 @@ class Launcher
|
|
948
967
|
end
|
949
968
|
|
950
969
|
def self.add_class_launchers classes
|
970
|
+
|
951
971
|
classes.each do |clazz|
|
952
972
|
next if clazz =~ /\//
|
953
973
|
|
@@ -992,7 +1012,7 @@ class Launcher
|
|
992
1012
|
#
|
993
1013
|
# Open new buffer and launch the menu in it
|
994
1014
|
#
|
995
|
-
# Launcher.open "
|
1015
|
+
# Launcher.open "ip"
|
996
1016
|
#
|
997
1017
|
def self.open menu, options={}
|
998
1018
|
return self.insert(menu, options) if options[:inline]
|
@@ -1188,7 +1208,6 @@ class Launcher
|
|
1188
1208
|
def self.reload_menu_dirs
|
1189
1209
|
MENU_DIRS.each do |dir|
|
1190
1210
|
next unless File.directory? dir
|
1191
|
-
|
1192
1211
|
Files.in_dir(dir).each do |f|
|
1193
1212
|
next if f !~ /^[a-z].*\..*[a-z]$/ || f =~ /__/
|
1194
1213
|
path = "#{dir}/#{f}"
|
@@ -1335,7 +1354,7 @@ def require_menu file, options={}
|
|
1335
1354
|
result = Menu.load_if_changed file
|
1336
1355
|
rescue LoadError => e
|
1337
1356
|
gem_name = Requirer.extract_gem_from_exception e.to_s
|
1338
|
-
Requirer.show "The file #{file} wants to use the '#{gem_name}' gem.\n%
|
1357
|
+
Requirer.show "The file #{file} wants to use the '#{gem_name}' gem.\n% gem install #{gem_name}\n\n"
|
1339
1358
|
rescue Exception=>e
|
1340
1359
|
txt = CodeTree.draw_exception e
|
1341
1360
|
Requirer.show "The file #{file} had this exception:\n#{txt}\n\n"
|
@@ -395,7 +395,7 @@ class Line
|
|
395
395
|
line = Line.value
|
396
396
|
|
397
397
|
if line.blank? # If blank line, prompt for menu
|
398
|
-
return Launcher.
|
398
|
+
return Launcher.insert "docs"
|
399
399
|
|
400
400
|
elsif line =~ /^(\w+\.\w+| +([+-] )?\.)/i # If a method, grab docs from source and insert
|
401
401
|
orig = Location.new
|
File without changes
|