Increase rebuild menu component delay
This commit is contained in:
1 parent
ef23b69d9c
commit
fad61ee007
1 file changed
+5
-1
+5
-1
@@ -24,6 +24,10 @@ class MenuPreviewFileEditor(
|
|||||||
private val mainEditor: TextEditor
|
private val mainEditor: TextEditor
|
||||||
) : UserDataHolderBase(), FileEditor {
|
) : UserDataHolderBase(), FileEditor {
|
||||||
|
|
||||||
|
companion object {
|
||||||
|
const val REBUILD_DELAY_MILLISECONDS = 200
|
||||||
|
}
|
||||||
|
|
||||||
private val mySwingAlarm = Alarm(Alarm.ThreadToUse.SWING_THREAD, this)
|
private val mySwingAlarm = Alarm(Alarm.ThreadToUse.SWING_THREAD, this)
|
||||||
private val myDocument = FileDocumentManager.getInstance().getDocument(myFile)!!
|
private val myDocument = FileDocumentManager.getInstance().getDocument(myFile)!!
|
||||||
private val myUi = JPanel().apply {
|
private val myUi = JPanel().apply {
|
||||||
@@ -49,7 +53,7 @@ class MenuPreviewFileEditor(
|
|||||||
override fun documentChanged(event: DocumentEvent) {
|
override fun documentChanged(event: DocumentEvent) {
|
||||||
mySwingAlarm.addRequest({
|
mySwingAlarm.addRequest({
|
||||||
rebuild(currentScroll.viewport.viewPosition)
|
rebuild(currentScroll.viewport.viewPosition)
|
||||||
}, 50)
|
}, REBUILD_DELAY_MILLISECONDS)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user