In my case, cursor jump through one empty line. How fix this? Thanks in advance.
In Angular 5 + Electron.
html:
<codemirror
[config]="{
lineWrapping: true,
autofocus: true,
showCursorWhenSelecting: true,
smartIndent: false
}"
(keyup.enter)="removeIndentation()"
#novelEditor>
</codemirror>
ts:
import { CodemirrorComponent } from 'ng2-codemirror';
...
@ViewChild('novelEditor') private novelEditor: CodemirrorComponent;
...
removeIndentation() {
const cm = this.novelEditor.instance;
cm.replaceSelection("\n");
}
I solved it
removeIndentation() {
const cm = this.novelEditor.instance;
cm.execCommand('delLineLeft');
}
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.