ternjs / tern

A JavaScript code analyzer for deep, cross-editor language support
https://ternjs.net/
MIT License
4.25k stars 378 forks source link

Emacs Autocomplete behaves strangely with one candidate #215

Closed adamfaulkner closed 11 years ago

adamfaulkner commented 11 years ago

When completing with only one candidate, the tern-auto-complete.el inserts the candidate directly, rather than hinting with it. This is inconsistent with other auto complete modes, where the candidate is hinted at, but not inserted.

example:

var a = {'candidate': 0};
a. (results in "candidate" being inserted after the cursor)

In other modes, autcomplete displays a lightly colored "candidate" after the cursor; this allows the user to type values other than "candidate"

marijnh commented 11 years ago

I've never seen the behavior of inserting the candidate lightly colored after the cursor, for me, other modes behave the same as Tern. Tern.el uses the built-in completion-in-region function, and doesn't do the actual insertion itself.

marijnh commented 11 years ago

Fixed by 08d7519