lib/textbringer/modes/programming_mode.rb in textbringer-0.1.7 vs lib/textbringer/modes/programming_mode.rb in textbringer-0.1.8
- old
+ new
@@ -12,15 +12,15 @@
define_generic_command :compile
define_generic_command :toggle_test
PROGRAMMING_MODE_MAP = Keymap.new
PROGRAMMING_MODE_MAP.define_key("\t", :indent_line_command)
- PROGRAMMING_MODE_MAP.define_key("\n", :newline_and_reindent_command)
+ PROGRAMMING_MODE_MAP.define_key("\C-m", :newline_and_reindent_command)
PROGRAMMING_MODE_MAP.define_key("\C-c\C-n", :forward_definition_command)
PROGRAMMING_MODE_MAP.define_key("\C-c\C-p", :backward_definition_command)
PROGRAMMING_MODE_MAP.define_key("\C-c\C-c", :compile_command)
- PROGRAMMING_MODE_MAP.define_key("\C-ct", :toggle_test_command)
+ PROGRAMMING_MODE_MAP.define_key("\C-c\C-t", :toggle_test_command)
def initialize(buffer)
super(buffer)
buffer.keymap = PROGRAMMING_MODE_MAP
end
@@ -62,10 +62,10 @@
n += 1
end
@buffer.save_excursion do
pos = @buffer.point
@buffer.beginning_of_line
- if /\A\s+\z/ =~ @buffer.substring(@buffer.point, pos)
+ if /\A[ \t]+\z/ =~ @buffer.substring(@buffer.point, pos)
@buffer.delete_region(@buffer.point, pos)
n += 1
end
end
@buffer.insert("\n")