Class: VER::HoverCompletion::Listbox

Inherits:
Tk::Listbox
  • Object
show all
Includes:
Keymapped
Defined in:
lib/ver/hover_completion.rb

Instance Attribute Summary collapse

Attributes included from Keymapped

#major_mode

Instance Method Summary collapse

Methods included from Keymapped

#minor_mode, #minor_mode?

Instance Attribute Details

#hover_completionObject

Returns the value of attribute hover_completion.



8
9
10
# File 'lib/ver/hover_completion.rb', line 8

def hover_completion
  @hover_completion
end

Instance Method Details

#cancelObject



10
11
12
# File 'lib/ver/hover_completion.rb', line 10

def cancel
  hover_completion.cancel
end

#continue_completionObject



14
15
16
# File 'lib/ver/hover_completion.rb', line 14

def continue_completion
  hover_completion.continue_completion
end

#go_downObject



18
19
20
21
# File 'lib/ver/hover_completion.rb', line 18

def go_down
  index = curselection.first + 1
  select(index) if index < size
end

#go_upObject



23
24
25
26
# File 'lib/ver/hover_completion.rb', line 23

def go_up
  index = curselection.first - 1
  select(index) if index >= 0
end

#select(index) ⇒ Object



32
33
34
35
36
37
38
# File 'lib/ver/hover_completion.rb', line 32

def select(index)
  selection_clear(0, :end)
  selection_set(index)
  see(index)

  Tk::Event.generate(self, '<<ListboxSelect>>')
end

#submitObject



28
29
30
# File 'lib/ver/hover_completion.rb', line 28

def submit
  hover_completion.submit
end