How to focus the cursor on the editing area?


#1

Now I have a problem, my cursor is now focused on the symbol tree on the left, I want to focus the cursor on the editing area in the middle, just like using the mouse to click on the editing area.

I tried this code:

atom.workspace.getCenter().getActivePane().focus(); 
atom.workspace.getCenter().getActivePaneItem().element.focus();

But it doesn’t work. Since I installed vim-mode-plus, if the cursor is in the editing area, I can use the shortcut key of vim, otherwise I can’t.

What API should I use to implement it?


#2

I believe you want to use the Pane API to activate the item you want to switch to.