Functions about codemirror clicks and inputs

I would like to implement a feature that when clicking on a line or while typing, the cursor always stays on the third line of the current editor area, I don’t have an idea to do it right now? Anyone can help?