src/Tools/jEdit/src/pretty_text_area.scala
changeset 81434 1935ed4fe9c2
parent 81433 c3793899b880
child 81435 839c4b2b01fa
equal deleted inserted replaced
81433:c3793899b880 81434:1935ed4fe9c2
   116                 output == current_output &&
   116                 output == current_output &&
   117                 snapshot == current_base_snapshot &&
   117                 snapshot == current_base_snapshot &&
   118                 results == current_base_results
   118                 results == current_base_results
   119             ) {
   119             ) {
   120               current_rendering = rendering
   120               current_rendering = rendering
       
   121               val bottom = JEdit_Lib.scrollbar_at_bottom(pretty_text_area)
   121               JEdit_Lib.buffer_edit(getBuffer) {
   122               JEdit_Lib.buffer_edit(getBuffer) {
   122                 rich_text_area.active_reset()
   123                 rich_text_area.active_reset()
   123                 getBuffer.setFoldHandler(new Fold_Handling.Document_Fold_Handler(rendering))
   124                 getBuffer.setFoldHandler(new Fold_Handling.Document_Fold_Handler(rendering))
   124                 JEdit_Lib.set_text(getBuffer, rich_texts.map(_.text))
   125                 JEdit_Lib.set_text(getBuffer, rich_texts.map(_.text))
   125                 setCaretPosition(0)
       
   126               }
   126               }
       
   127               setCaretPosition(if (bottom) JEdit_Lib.bottom_line_offset(getBuffer) else 0)
       
   128               JEdit_Lib.scroll_to_caret(pretty_text_area)
   127             }
   129             }
   128           }
   130           }
   129         })
   131         })
   130     }
   132     }
   131   }
   133   }