MCPcopy Index your code
hub / github.com/hackmdio/codimd / insertLine

Method insertLine

public/js/lib/editor/table-editor.js:44–60  ·  view source on GitHub ↗
(row, line)

Source from the content-addressed store, hash-verified

42 }
43
44 insertLine (row, line) {
45 const lastRow = this.getLastRow()
46 if (row > lastRow) {
47 const lastLine = this.getLine(lastRow)
48 this.doc.replaceRange(
49 '\n' + line,
50 { line: lastRow, ch: lastLine.length },
51 { line: lastRow, ch: lastLine.length }
52 )
53 } else {
54 this.doc.replaceRange(
55 line + '\n',
56 { line: row, ch: 0 },
57 { line: row, ch: 0 }
58 )
59 }
60 }
61
62 deleteLine (row) {
63 const lastRow = this.getLastRow()

Callers

nothing calls this directly

Calls 2

getLastRowMethod · 0.95
getLineMethod · 0.95

Tested by

no test coverage detected