How to use the emmet/assets/tabStops.extract function in emmet

To help you get started, we’ve selected a few emmet examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github emmetio / brackets-emmet / editor.js View on Github external
end = (typeof start == 'undefined') ? this.getContent().length : start;
			}
			if (typeof start == 'undefined') {
				start = 0;
			}

			value = normalize(value);
			
			// indent new value
			if (!noIndent) {
				var pad = utils.getLinePaddingFromPosition(this.getContent(), start);
				value = utils.padString(value, pad);
			}
			
			// find new caret position
			var tabstopData = tabStops.extract(value, {
				escape: function(ch) {
					return ch;
				}
			});
			value = tabstopData.text;

			var firstTabStop = tabstopData.tabstops[0] || {start: value.length, end: value.length};
			firstTabStop.start += start;
			firstTabStop.end += start;

			var doc = this.editor.document;
			start = this._posFromIndex(start);
			end = this._posFromIndex(end);

			var oldValue = doc.getRange(start, end);