mirror of
https://github.com/naturalcrit/homebrewery.git
synced 2026-01-07 14:12:43 +00:00
get and set selection to cover entire lines
This commit is contained in:
@@ -104,8 +104,20 @@ const CodeEditor = createClass({
|
|||||||
},
|
},
|
||||||
|
|
||||||
makeUnOrderedList : function() {
|
makeUnOrderedList : function() {
|
||||||
const selection = this.codeMirror.getSelection()
|
const isList = /^-\s/gm;
|
||||||
}
|
const selectionStart = this.codeMirror.getCursor('from');
|
||||||
|
const selectionEnd = this.codeMirror.getCursor('to');
|
||||||
|
const selection = this.codeMirror.setSelection(
|
||||||
|
{ line: selectionStart.line, ch: 0 },
|
||||||
|
{ line: selectionEnd.line, ch: this.codeMirror.getLine(selectionEnd.line).length });
|
||||||
|
console.log(selectionStart, selectionEnd, selection);
|
||||||
|
},
|
||||||
|
|
||||||
|
|
||||||
|
// ordered list:
|
||||||
|
// selection should expand to include the full line even if selection is only part of line
|
||||||
|
// regex should match "- " at beginning of selection
|
||||||
|
// regex should match "- " at beginnign of each line or maybe "\n- "
|
||||||
|
|
||||||
//=-- Externally used -==//
|
//=-- Externally used -==//
|
||||||
setCursorPosition : function(line, char){
|
setCursorPosition : function(line, char){
|
||||||
|
|||||||
Reference in New Issue
Block a user