-
Notifications
You must be signed in to change notification settings - Fork 3.9k
Open
Labels
editor-apifeature-requestRequest for new features or functionalityRequest for new features or functionality
Description
Getting a single line-mode to work is not as straightforward as I thought. It would be nice if this could be added as a configuration option. Here is what worked for me:
editor.onKeyDown(e => {
if (e.keyCode == monaco.KeyCode.Enter) {
// We only prevent enter when the suggest model is not active
if (editor.getContribution('editor.contrib.suggestController').model.state == 0) {
e.preventDefault();
}
}
});
editor.onDidPaste(e => {
if (e.range.endLineNumber > 1) {
let newContent = "";
let lineCount = textModel.getLineCount();
for (let i = 0; i < lineCount; i++) {
newContent += textModel.getLineContent(i + 1);
}
textModel.setValue(newContent);
}
});
with the following editor options:
wordWrap: 'off',
lineNumbers: 'off',
lineDecorationsWidth: 0,
overviewRulerLanes: 0,
overviewRulerBorder: false,
scrollbar: { horizontal: 'hidden', vertical: 'hidden' },
But I'm still having problems with removing some of the padding on the left and right side of the editor:
Any idea how to remove that padding?
windischb, kryops, fabiospampinato, sfmskywalker, spring-raining and 3 more
Metadata
Metadata
Assignees
Labels
editor-apifeature-requestRequest for new features or functionalityRequest for new features or functionality
