I want to insert text to the last line of current content. It just like an append operation in file. I only find the editor.insert(text) method. This method add text right after the cursor. Is there any way just append the text to the last line?
use editor.session.insert method to insert text at arbitrary position
var session = editor.session
session.insert({
row: session.getLength(),
column: 0
}, "\n" + text)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With