Skip to content

Commit

Permalink
suppress autocompletion after `
Browse files Browse the repository at this point in the history
  • Loading branch information
ngn committed Feb 13, 2015
1 parent e952365 commit 804937d
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion client/autocompletion.coffee
Original file line number Diff line number Diff line change
@@ -1,8 +1,15 @@
keymap = require './keymap.coffee'
module.exports = (cm, requestAutocompletion) -> # set up autocompletion, common code between session and editor
tid = null # timeout id
cm.on 'change', ->
clearTimeout tid
tid = setTimeout (-> tid = null; c = cm.getCursor(); requestAutocompletion cm.getLine(c.line), c.ch; return), 500
tid = setTimeout(
->
tid = null; c = cm.getCursor(); s = cm.getLine c.line; i = c.ch
if s[i - 1] !in [' ', keymap.getPrefixKey()] then requestAutocompletion s, i
return
500
)
return
(skip, options) ->
c = cm.getCursor(); from = line: c.line, ch: c.ch - skip
Expand Down

0 comments on commit 804937d

Please sign in to comment.