Closed olivroy closed 11 months ago
Does rstudioapi::getSourceEditorContext()
give you what you need? You can pass it an id
as retrieved from rstudioapi::documentId()
.
Oh, yes sorry. I didn't realise it returned a list. This does the trick indeed.
rstudioapi::getSourceEditorContext()$content
Hi, I was wondering if it was possible to add getDocumentContent()
For unsaved files, I don't know how to read lines
or readDocumentLines