move mode check later (allow completion narrowing in markdown mode)