microsoft / microsoft/monaco-editor
[Feature Request] SetCurosorToEnd property for editor.SetValue()
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 46.8k
- Forks
- 4.1k
- Avg merge
- 17h 58m
- Merged PRs (30d)
- 1
Description
Context
- This issue is not a bug report. (please use a different template for reporting a bug)
- This issue is not a duplicate of an existing issue. (please use the search to find existing issues)
Description
Currently the api method editor.SetValue() set the cursor to column 1 in line 1 after inserting text.
But sometimes it is required to insert text, then set the cursor at the end of the inserted text and then scroll to this position if it is out of view. (For example when loading a predefined text that should support directly pasting data after it.)
I suggest to add a second optional (and default to false) parameter to editor.SetValue() that allows to set the cursor at the end of the "inserted" text.
Monaco Editor Playground Link
No response
Monaco Editor Playground Code
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start from the editor.SetValue() API entry point and trace how it positions the cursor after inserting text. The change is complete when an optional parameter, defaulting to false, can place the cursor at the end of the inserted text and scroll to that position when needed.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- api, frontend
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100