How do I keep the editor state?

已回答

I built a ToolWindow in which I built an editor using LanguageTextField. The tool window has multiple tabs, but when I switch to another TAB or temporarily hide the tool window, all previously folded text in the editor expands and the cursor is switched to the last line. In short, the status of the editor is lost, how can I solve it?

0

Sounds like potentially “focus gain” leads to this. Could you try adding FocusListener `com.intellij.ui.EditorTextField#addFocusListener`? Sharing code would be helpful.

1

Thanks, I've found that I can achieve the results I want with FileEditor.

0

请先登录再写评论。