MCPcopy Create free account
hub / github.com/hackmdio/codimd / replaceLines

Method replaceLines

public/js/lib/editor/table-editor.js:90–106  ·  view source on GitHub ↗
(startRow, endRow, lines)

Source from the content-addressed store, hash-verified

88 }
89
90 replaceLines (startRow, endRow, lines) {
91 const lastRow = this.getLastRow()
92 if (endRow > lastRow) {
93 const lastLine = this.getLine(lastRow)
94 this.doc.replaceRange(
95 lines.join('\n'),
96 { line: startRow, ch: 0 },
97 { line: lastRow, ch: lastLine.length }
98 )
99 } else {
100 this.doc.replaceRange(
101 lines.join('\n') + '\n',
102 { line: startRow, ch: 0 },
103 { line: endRow, ch: 0 }
104 )
105 }
106 }
107
108 transact (func) {
109 this.transaction = true

Callers

nothing calls this directly

Calls 2

getLastRowMethod · 0.95
getLineMethod · 0.95

Tested by

no test coverage detected