Class: Rvim::GlobalMarks

Inherits:
Object
  • Object
show all
Defined in:
lib/rvim/marks.rb

Instance Method Summary collapse

Constructor Details

#initializeGlobalMarks

Returns a new instance of GlobalMarks.



45
46
47
# File 'lib/rvim/marks.rb', line 45

def initialize
  @table = {}
end

Instance Method Details

#clear_buffer(buffer_id) ⇒ Object



59
60
61
# File 'lib/rvim/marks.rb', line 59

def clear_buffer(buffer_id)
  @table.delete_if { |_, (bid, _, _)| bid == buffer_id }
end

#get(name) ⇒ Object



55
56
57
# File 'lib/rvim/marks.rb', line 55

def get(name)
  @table[name.to_s.upcase] if name =~ /\A[A-Z]\z/i
end

#set(name, buffer_id, line, col) ⇒ Object



49
50
51
52
53
# File 'lib/rvim/marks.rb', line 49

def set(name, buffer_id, line, col)
  return unless name =~ /\A[A-Z]\z/

  @table[name] = [buffer_id, line, col]
end