Scan for syntax stack for autoformat

A fix for #11 where there wasn't any syntax stack at the end of a line containing text where we don't want to initiate autoformat.