(text, selectionStart)
| 29 | }); |
| 30 | |
| 31 | function getLine(text, selectionStart) { |
| 32 | // Break apart into lines, return the line the cursor is in |
| 33 | const lines = text.split('\n'); |
| 34 | |
| 35 | return lines.reduce(function (memo, cur) { |
| 36 | if (typeof memo !== 'number') { |
| 37 | return memo; |
| 38 | } if (selectionStart > (memo + cur.length)) { |
| 39 | return memo + cur.length + 1; |
| 40 | } |
| 41 | |
| 42 | return cur; |
| 43 | }, 0); |
| 44 | } |
| 45 | }; |
| 46 | |
| 47 | export function prepareFormattingTools() { |
no outgoing calls
no test coverage detected
searching dependent graphs…