react-simple-code-editor
Advanced tools
Comparing version 0.3.1 to 0.3.2
@@ -225,4 +225,6 @@ 'use strict'; | ||
// Indent selected lines | ||
var _startLine = _this._getLines(value, selectionStart).length - 1; | ||
var _linesBeforeCaret = _this._getLines(value, selectionStart); | ||
var _startLine = _linesBeforeCaret.length - 1; | ||
var _endLine = _this._getLines(value, selectionEnd).length - 1; | ||
var _startLineText = _linesBeforeCaret[_startLine]; | ||
@@ -238,3 +240,4 @@ _this._applyEdits({ | ||
// Move the start cursor by number of characters added in first line of selection | ||
selectionStart: selectionStart + tabCharacter.length, | ||
// Don't move it if it there was no text before cursor | ||
selectionStart: /\S/.test(_startLineText) ? selectionStart + tabCharacter.length : selectionStart, | ||
// Move the end cursor by total number of characters added | ||
@@ -241,0 +244,0 @@ selectionEnd: selectionEnd + tabCharacter.length * (_endLine - _startLine + 1) |
{ | ||
"name": "react-simple-code-editor", | ||
"version": "0.3.1", | ||
"version": "0.3.2", | ||
"description": "Simple no-frills code editor with syntax highlighting", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
@@ -92,6 +92,9 @@ # react-simple-code-editor | ||
## Known issues | ||
## Limitations | ||
Using the undo/redo option from browser's context menu can mess things up. | ||
Due to the way it works, it has certain limitations: | ||
- The syntax highlighted code cannot have different font family, font weight, font style, line height etc. for its content. Since the editor works by aligning the highlighted code over a `<textarea>`, changing anything that affects the layout can misalign it. | ||
- The custom undo stack is incompatible with undo/redo items browser's context menu. However, other full featured editors don't support browser's undo/redo menu items either. | ||
## Contributing | ||
@@ -98,0 +101,0 @@ |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
37199
383
130