atom/atom — pull request #4325 by nathansobo (2014-11-26 16:32:29+00:00)
Title: Add ‘position’ option to overlay decorations

/cc @benogle

By default overlays are positioned at the head of the given marker. This option allows them to be positioned at the tail instead by passing `position: ’tail’` when creating the decoration, which is useful for autocomplete.

I tried various other approaches for positioning the overlay in autocomplete without adding this option, but the complexity of the text manipulation (due to the fact that the case of the prefix and suffix can be altered) meant that any other markers I created were always getting moved to undesirable places. Since we restore the selections following the text manipulation, simply positioning the overlay at the tail is the most convenient and simple approach.