lib/textbringer/modes/programming_mode.rb in textbringer-1.0.0 vs lib/textbringer/modes/programming_mode.rb in textbringer-1.0.1
- old
+ new
@@ -1,7 +1,5 @@
-# frozen_string_literal: true
-
module Textbringer
class ProgrammingMode < FundamentalMode
# abstract mode
undefine_command(:programming_mode)
@@ -30,10 +28,10 @@
# Return true if modified.
def indent_line
result = false
level = calculate_indentation
- return result if level.nil?
+ return result if level.nil? || level < 0
@buffer.save_excursion do
@buffer.beginning_of_line
@buffer.composite_edit do
if @buffer.looking_at?(/[ \t]+/)
s = @buffer.match_string(0)