Permalink
Browse files

Split lusty-juggler.vim into sub-files

Allows for code sharing with the sub-file'd lusty-explorer.vim.

Also:
- add module namespacing to place nicer with other ruby plugins.
- rename :JugglePrevious to :LustyJugglePrevious
  • Loading branch information...
sjbach committed Jun 2, 2010
1 parent 0746c00 commit c9ee284821765fec9a557f6d88936d53f2424b1e
Showing with 1,168 additions and 166 deletions.
  1. +44 −21 Makefile
  2. +2 −2 README
  3. +9 −3 lusty-explorer.vim
  4. +290 −137 lusty-juggler.vim
  5. +1 −1 src/{plugin.vim → explorer.vim}
  6. +235 −0 src/juggler.vim
  7. +4 −1 src/lusty.rb
  8. +133 −0 src/lusty/bar-item.rb
  9. +120 −0 src/lusty/buffer-stack.rb
  10. +143 −0 src/lusty/juggler.rb
  11. +183 −0 src/lusty/name-bar.rb
  12. +4 −1 src/vim.rb
View
@@ -7,38 +7,61 @@
# copyright holder be liable for any damages resulting from the use of this
# software.
-VIM_FILE = src/plugin.vim
+EXPLORER_VIM_FILE = src/explorer.vim
-#RUBY_FILES = $(shell find src/ -type f -name '*.rb')
# Order matters.
-RUBY_FILES = src/vim.rb \
- src/lusty.rb \
- src/liquid-metal.rb \
- src/lusty/entry.rb \
- src/lusty/explorer.rb \
- src/lusty/buffer-explorer.rb \
- src/lusty/filesystem-explorer.rb \
- src/lusty/grep-explorer.rb \
- src/lusty/prompt.rb \
- src/lusty/window.rb \
- src/lusty/saved-settings.rb \
- src/lusty/display.rb \
- src/lusty/file-masks.rb \
- src/lusty/vim-swaps.rb
+EXPLORER_RUBY_FILES = src/vim.rb \
+ src/lusty.rb \
+ src/liquid-metal.rb \
+ src/lusty/entry.rb \
+ src/lusty/explorer.rb \
+ src/lusty/buffer-explorer.rb \
+ src/lusty/filesystem-explorer.rb \
+ src/lusty/grep-explorer.rb \
+ src/lusty/prompt.rb \
+ src/lusty/window.rb \
+ src/lusty/saved-settings.rb \
+ src/lusty/display.rb \
+ src/lusty/file-masks.rb \
+ src/lusty/vim-swaps.rb
+
+JUGGLER_VIM_FILE = src/juggler.vim
+
+# Order matters.
+JUGGLER_RUBY_FILES = src/vim.rb \
+ src/lusty.rb \
+ src/lusty/juggler.rb \
+ src/lusty/bar-item.rb \
+ src/lusty/name-bar.rb \
+ src/lusty/buffer-stack.rb
+
+all: lusty-explorer.vim lusty-juggler.vim
# Concatenate the Ruby files, removing redundant copyrights, and insert
# the result into the vimscript file.
-lusty-explorer.vim: $(VIM_FILE) $(RUBY_FILES)
- for file in $(RUBY_FILES); do \
+lusty-explorer.vim: $(EXPLORER_VIM_FILE) $(EXPLORER_RUBY_FILES)
+ for file in $(EXPLORER_RUBY_FILES); do \
cat $$file | sed '1,/^$$/d' ;\
echo ; \
done > ruby-content.tmp
- ( sed '/{{RUBY_CODE_INSERTION_POINT}}/,$$d' $(VIM_FILE) ; \
+ ( sed '/{{RUBY_CODE_INSERTION_POINT}}/,$$d' $(EXPLORER_VIM_FILE) ; \
cat ruby-content.tmp ; \
- sed '1,/{{RUBY_CODE_INSERTION_POINT}}/d' $(VIM_FILE) ) > \
+ sed '1,/{{RUBY_CODE_INSERTION_POINT}}/d' $(EXPLORER_VIM_FILE) ) > \
lusty-explorer.vim
rm -f ruby-content.tmp
+# Concatenate the Ruby files, removing redundant copyrights, and insert
+# the result into the vimscript file.
+lusty-juggler.vim: $(JUGGLER_VIM_FILE) $(JUGGLER_RUBY_FILES)
+ for file in $(JUGGLER_RUBY_FILES); do \
+ cat $$file | sed '1,/^$$/d' ;\
+ echo ; \
+ done > ruby-content.tmp
+ ( sed '/{{RUBY_CODE_INSERTION_POINT}}/,$$d' $(JUGGLER_VIM_FILE) ; \
+ cat ruby-content.tmp ; \
+ sed '1,/{{RUBY_CODE_INSERTION_POINT}}/d' $(JUGGLER_VIM_FILE) ) > \
+ lusty-juggler.vim
+ rm -f ruby-content.tmp
clean:
- rm -f ruby-content.tmp lusty-explorer.vim
+ rm -f ruby-content.tmp lusty-explorer.vim lusty-juggler.vim
View
4 README
@@ -8,6 +8,6 @@ repository:
http://github.com/sjbach/lusty-emacs
-NOTE: lusty-explorer.vim is a generated file; modify src/ if you'd like to
-submit a patch.
+NOTE: lusty-explorer.vim and lusty-juggler.vim are generated files; modify
+src/ if you'd like to submit a patch.
View
@@ -191,7 +191,7 @@ if !has("ruby") || version < 700
echo " # make && make install"
echo "(If you just wish to stifle this message, set the following option:"
- echo " let g:LustyJugglerSuppressRubyWarning = 1)"
+ echo " let g:LustyExplorerSuppressRubyWarning = 1)"
echohl none
endif
endif
@@ -300,7 +300,10 @@ end
module VIM
- MOST_POSITIVE_INTEGER = 2**(32 - 1) - 2 # Vim ints are signed 32-bit.
+
+ unless const_defined? "MOST_POSITIVE_INTEGER"
+ MOST_POSITIVE_INTEGER = 2**(32 - 1) - 2 # Vim ints are signed 32-bit.
+ end
def self.zero?(var)
# In Vim 7.2 and older, VIM::evaluate returns Strings for boolean
@@ -384,7 +387,10 @@ end
# Utility functions.
module Lusty
- MOST_POSITIVE_FIXNUM = 2**(0.size * 8 -2) -1
+
+ unless const_defined? "MOST_POSITIVE_FIXNUM"
+ MOST_POSITIVE_FIXNUM = 2**(0.size * 8 -2) -1
+ end
def self.simplify_path(s)
s = s.gsub(/\/+/, '/') # Remove redundant '/' characters
Oops, something went wrong.

0 comments on commit c9ee284

Please sign in to comment.