Autocomplete line endings for javascript

Fixes #1651