Class: Ruvi::EditorApp::DiffLogger::CursorPositionChange

Inherits:
Difference
  • Object
show all
Defined in:
lib/timemachine.rb

Instance Attribute Summary

Attributes inherited from Difference

#new_cursor, #old_cursor

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Difference

#correct_cursor_position, #cursor_transition, #finalize, inherited, #initialize, #notify_of_play, #notify_of_unplay, #post_mod_callback, #pre_mod_callback, #redo, transition_regexp, #undo

Constructor Details

This class inherits a constructor from Ruvi::EditorApp::DiffLogger::Difference

Class Method Details

.from_s(buf, str) ⇒ Object



393
394
395
396
397
398
399
400
# File 'lib/timemachine.rb', line 393

def CursorPositionChange.from_s buf, str
    t = self.new(buf) {
        |t|
        str =~ /^CURSOR_MOVE:#{transition_regexp}$/
        t.old_cursor, t.new_cursor = Point.new($1.to_i, $2.to_i), Point.new($3.to_i, $4.to_i)
    }
    t 
end

.it_was_me(msg) ⇒ Object



401
402
403
# File 'lib/timemachine.rb', line 401

def CursorPositionChange.it_was_me msg
    msg =~ /^CURSOR_MOVE:/
end

Instance Method Details

#to_sObject



404
405
406
# File 'lib/timemachine.rb', line 404

def to_s
    "CURSOR_MOVE:[#{cursor_transition}]"
end