fixed bug preventing detection of cursor position when the snippet is only one line