check spaces before the cursor position