Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

react-simple-code-editor

Package Overview
Dependencies
Maintainers
1
Versions
43
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-simple-code-editor - npm Package Compare versions

Comparing version 0.3.1 to 0.3.2

7

lib/index.js

@@ -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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc