Skip to content

Commit

Permalink
Merge branch 'master' into utf-8-single-width
Browse files Browse the repository at this point in the history
Conflicts:
	lib/diakonos/version.rb
  • Loading branch information
Pistos committed Aug 4, 2011
2 parents 3d927e7 + b74eb2b commit 4086924
Show file tree
Hide file tree
Showing 17 changed files with 40 additions and 26 deletions.
2 changes: 1 addition & 1 deletion diakonos.conf
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,7 @@ key ctrl+o open_file_ask
key alt+o open_matching_files
key ctrl+s save_file
key esc S save_file_as
key ctrl+w close_file
key ctrl+w close_buffer
key ctrl+alt+o revert
key alt+! setReadOnly
key ctrl+q quit
Expand Down
4 changes: 2 additions & 2 deletions lib/diakonos.rb
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ class Diakonos

attr_reader :diakonos_home, :script_dir, :clipboard,
:list_filename, :hooks, :indenters, :indenters_next_line, :unindenters, :closers,
:functions_last, :there_was_non_movement, :do_display, :testing
:functions_last, :there_was_non_movement, :do_display, :testing, :buffers

include ::Diakonos::Functions

Expand Down Expand Up @@ -344,7 +344,7 @@ def start

if session_buffers
session_buffers.each do |buffer|
close_file buffer
close_buffer buffer
end
end

Expand Down
2 changes: 1 addition & 1 deletion lib/diakonos/buffer-management.rb
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ def show_buffer_file_diff( buffer = @buffer_current )
`#{@settings[ 'diff_command' ]} #{current_text_file} #{buffer.name} > #{@diff_filename}`
diff_buffer = open_file( @diff_filename )
yield diff_buffer
close_file diff_buffer
close_buffer diff_buffer
end

end
Expand Down
3 changes: 2 additions & 1 deletion lib/diakonos/functions-deprecated.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ module Functions
alias_method :carriageReturn, :carriage_return
alias_method :changeSessionSetting, :change_session_setting
alias_method :clearMatches, :clear_matches
alias_method :closeFile, :close_file
alias_method :closeFile, :close_buffer
alias_method :close_file, :close_buffer
alias_method :collapseWhitespace, :collapse_whitespace
alias_method :copySelection, :copy_selection
alias_method :cursorDown, :cursor_down
Expand Down
6 changes: 3 additions & 3 deletions lib/diakonos/functions.rb
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ def help( prefill = '' )
# TODO: let them choose "never" and "always"
end

close_file error_file
close_buffer error_file
else
help selected
end
Expand Down Expand Up @@ -248,7 +248,7 @@ def quit
@buffers.each do |buffer|
next if ! buffer.modified?
switch_to buffer
closure_choice = close_file( buffer, to_all )
closure_choice = close_buffer( buffer, to_all )
case closure_choice
when CHOICE_CANCEL
@quitting = false
Expand Down Expand Up @@ -283,7 +283,7 @@ def toggle_macro_recording( name = nil )
# Undoes the latest change made to the current buffer,
# or reopens the file that was just closed.
def undo( buffer = buffer_current )
if @functions_last[-1] == 'close_file'
if @functions_last[-1] == 'close_buffer'
open_file(
@buffer_closed.name,
'cursor' => {
Expand Down
2 changes: 1 addition & 1 deletion lib/diakonos/functions/buffers.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ module Functions
# @return [Fixnum] the choice the user made, or nil if the user was not prompted to choose.
# @see Diakonos::CHOICE_YES
# @see Diakonos::CHOICE_NO
def close_file( buffer = buffer_current, to_all = nil )
def close_buffer( buffer = buffer_current, to_all = nil )
return nil if buffer.nil?

choice = nil
Expand Down
2 changes: 1 addition & 1 deletion lib/diakonos/functions/sessions.rb
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ def load_session( session_id = nil )
end
@session = nil
@buffers.each do |buffer|
close_file buffer
close_buffer buffer
end
new_session( path )
@session[ 'files' ].each do |file|
Expand Down
2 changes: 1 addition & 1 deletion lib/diakonos/help.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ def open_help_buffer
@help_buffer = open_file( @help_filename )
end
def close_help_buffer
close_file @help_buffer
close_buffer @help_buffer
@help_buffer = nil
end

Expand Down
2 changes: 1 addition & 1 deletion lib/diakonos/list.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ def open_list_buffer
end

def close_list_buffer
close_file @list_buffer
close_buffer @list_buffer
@list_buffer = nil
end

Expand Down
2 changes: 1 addition & 1 deletion lib/diakonos/version.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module Diakonos
VERSION = '0.9.0'
LAST_MODIFIED = 'July 27, 2011'
LAST_MODIFIED = 'July 31, 2011'

def self.parse_version( s )
if s
Expand Down
2 changes: 1 addition & 1 deletion spec/functions/basics.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
end

after do
@d.close_file @b, Diakonos::CHOICE_NO_TO_ALL
@d.close_buffer @b, Diakonos::CHOICE_NO_TO_ALL
end

it 'delete the current character' do
Expand Down
25 changes: 19 additions & 6 deletions spec/functions/buffer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,30 +9,43 @@
end

after do
@d.close_file @b, Diakonos::CHOICE_NO_TO_ALL
@d.close_buffer @b, Diakonos::CHOICE_NO_TO_ALL
end

it 'can close a buffer' do
name = @d.buffer_current.name
n = @d.buffers.size
n.should > 0
@d.buffers.map(&:name).should.include name

@d.close_buffer

@d.buffers.size.should.equal n-1
@d.buffer_current.name.should.not.equal name
@d.buffers.map(&:name).should.not.include name
end

it 'open a file at a specific line number' do
@b = @d.open_file( "#{SAMPLE_FILE_LONGER}:45" )
cursor_should_be_at 44, 0

@d.close_file @b, Diakonos::CHOICE_NO_TO_ALL
@d.close_buffer @b, Diakonos::CHOICE_NO_TO_ALL
@b = @d.open_file( "#{SAMPLE_FILE_LONGER}:50:" )
cursor_should_be_at 49, 0

@d.close_file @b, Diakonos::CHOICE_NO_TO_ALL
@d.close_buffer @b, Diakonos::CHOICE_NO_TO_ALL
@b = @d.open_file( "#{SAMPLE_FILE_LONGER}:54: in `block in methodname'" )
cursor_should_be_at 53, 0

@d.close_file @b, Diakonos::CHOICE_NO_TO_ALL
@d.close_buffer @b, Diakonos::CHOICE_NO_TO_ALL
@b = @d.open_file( " from #{SAMPLE_FILE_LONGER}:57: in `block in methodname'" )
cursor_should_be_at 56, 0

@d.close_file @b, Diakonos::CHOICE_NO_TO_ALL
@d.close_buffer @b, Diakonos::CHOICE_NO_TO_ALL
@b = @d.open_file( %{ File "#{SAMPLE_FILE_LONGER}", line 55, in decoration} )
cursor_should_be_at 54, 0

@d.close_file @b, Diakonos::CHOICE_NO_TO_ALL
@d.close_buffer @b, Diakonos::CHOICE_NO_TO_ALL
@b = @d.open_file( " at #{SAMPLE_FILE_LONGER} line 61" )
cursor_should_be_at 60, 0

Expand Down
2 changes: 1 addition & 1 deletion spec/functions/clipboard.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
end

after do
@d.close_file @b, Diakonos::CHOICE_NO_TO_ALL
@d.close_buffer @b, Diakonos::CHOICE_NO_TO_ALL
end

it 'copy selected text' do
Expand Down
2 changes: 1 addition & 1 deletion spec/functions/cursor.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
end

after do
@d.close_file @b, Diakonos::CHOICE_NO_TO_ALL
@d.close_buffer @b, Diakonos::CHOICE_NO_TO_ALL
end

it 'move the cursor in the four basic directions' do
Expand Down
2 changes: 1 addition & 1 deletion spec/functions/selection.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
end

after do
@d.close_file @b, Diakonos::CHOICE_NO_TO_ALL
@d.close_buffer @b, Diakonos::CHOICE_NO_TO_ALL
end

it 'select text' do
Expand Down
2 changes: 1 addition & 1 deletion spec/functions/text-manipulation.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
end

after do
@d.close_file @b, Diakonos::CHOICE_NO_TO_ALL
@d.close_buffer @b, Diakonos::CHOICE_NO_TO_ALL
end

it 'collapse whitespace' do
Expand Down
4 changes: 2 additions & 2 deletions spec/searching.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
end

after do
@d.close_file @b, Diakonos::CHOICE_NO_TO_ALL
@d.close_buffer @b, Diakonos::CHOICE_NO_TO_ALL
end

it 'can grep the open buffers' do
Expand Down Expand Up @@ -46,7 +46,7 @@
end

after do
@d.close_file @b, Diakonos::CHOICE_NO_TO_ALL
@d.close_buffer @b, Diakonos::CHOICE_NO_TO_ALL
end

it 'can find next closest characters' do
Expand Down

0 comments on commit 4086924

Please sign in to comment.