mirror of
https://github.com/pulsar-edit/pulsar.git
synced 2024-11-10 18:24:09 +03:00
non-working version of autocomplete focusing
This commit is contained in:
parent
904c05660d
commit
9ac72d7fba
@ -6,7 +6,7 @@ Range = require 'range'
|
||||
module.exports =
|
||||
class Autocomplete extends View
|
||||
@content: ->
|
||||
@div id: 'autocomplete', =>
|
||||
@div id: 'autocomplete', tabindex: -1, =>
|
||||
@ol outlet: 'matchesList'
|
||||
|
||||
editor: null
|
||||
@ -19,7 +19,7 @@ class Autocomplete extends View
|
||||
|
||||
initialize: (@editor) ->
|
||||
requireStylesheet 'autocomplete.css'
|
||||
@on 'autocomplete:toggle', => @toggle()
|
||||
@editor.on 'autocomplete:toggle', => @toggle()
|
||||
@on 'move-up', => @previousMatch()
|
||||
@on 'move-down', => @nextMatch()
|
||||
@editor.on 'buffer-path-change', => @setCurrentBuffer(@editor.buffer)
|
||||
@ -45,6 +45,7 @@ class Autocomplete extends View
|
||||
{left, top} = @editor.pixelOffsetForScreenPosition(cursorScreenPosition)
|
||||
@css {left: left, top: top + @editor.lineHeight}
|
||||
$(document.body).append(this)
|
||||
@focus()
|
||||
|
||||
previousMatch: ->
|
||||
previousIndex = @currentMatchIndex - 1
|
||||
|
Loading…
Reference in New Issue
Block a user