@@ -27,6 +27,7 @@ const Document = brackets.getModule("document/Document")
2727 * [ .replaceRange(text, start, end, origin)] ( #Document+replaceRange )
2828 * [ .getRange(start, end)] ( #Document+getRange ) ⇒ <code >string</code >
2929 * [ .getLine(Zero-based)] ( #Document+getLine ) ⇒ <code >string</code >
30+ * [ .posFromIndex(index)] ( #Document+posFromIndex ) ⇒ <code >Object</code >
3031 * [ .batchOperation(doOperation)] ( #Document+batchOperation )
3132 * [ .notifySaved()] ( #Document+notifySaved )
3233 * [ .adjustPosForChange(pos, textLines, start, end)] ( #Document+adjustPosForChange ) ⇒ <code >Object</code >
@@ -240,6 +241,19 @@ Returns the text of the given line (excluding any line ending characters)
240241| --- | --- | --- |
241242| Zero-based | <code >number</code > | line number |
242243
244+ <a name =" Document+posFromIndex " ></a >
245+
246+ ### document.posFromIndex(index) ⇒ <code >Object</code >
247+ Given a character index within the document text (assuming \n newlines),
248+ returns the corresponding {line, ch} position. Works whether or not
249+ a master editor is attached.
250+
251+ ** Kind** : instance method of [ <code >Document</code >] ( #Document )
252+
253+ | Param | Type | Description |
254+ | --- | --- | --- |
255+ | index | <code >number</code > | Zero-based character offset |
256+
243257<a name =" Document+batchOperation " ></a >
244258
245259### document.batchOperation(doOperation)
0 commit comments