Skip to content

Commit c4f57cc

Browse files
Up version and some clean up of the example
1 parent 1c4477e commit c4f57cc

File tree

4 files changed

+6
-6
lines changed

4 files changed

+6
-6
lines changed

example/index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import React from 'react';
22
import { render } from 'react-dom';
3-
import AceEditor from 'react-ace';
3+
import AceEditor from '../src/ace.jsx';
44
import brace from 'brace';
55

66
import 'brace/mode/java';

example/webpack.config.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ var path = require('path');
22
var webpack = require('webpack');
33

44
module.exports = {
5-
devtool: 'cheap-module-eval-source-map',
5+
devtool: 'source-map',
66
entry: [
77
'webpack-hot-middleware/client',
88
'./index'

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "react-ace",
3-
"version": "4.2.1",
3+
"version": "4.2.2",
44
"description": "A react component for Ace Editor",
55
"main": "lib/ace.js",
66
"types": "types.d.ts",

src/ace.jsx

+3-3
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ export default class ReactAce extends Component {
8585
this.handleOptions(this.props);
8686
this.editor.getSession().setAnnotations(annotations || []);
8787
if(markers && markers.length > 0){
88-
this.handleMarkers(markers);
88+
this.handleMarkers(markers);
8989
}
9090

9191
// get a list of possible options to avoid 'misspelled option errors'
@@ -172,8 +172,8 @@ export default class ReactAce extends Component {
172172
if (!isEqual(nextProps.annotations, oldProps.annotations)) {
173173
this.editor.getSession().setAnnotations(nextProps.annotations || []);
174174
}
175-
if (!isEqual(nextProps.markers, oldProps.markers)) {
176-
this.handleMarkers(nextProps.markers || []);
175+
if (!isEqual(nextProps.markers, oldProps.markers) && (nextProps.markers && nextProps.markers.length > 0)) {
176+
this.handleMarkers(markers);
177177
}
178178
if (!isEqual(nextProps.scrollMargins, oldProps.scrollMargins)) {
179179
this.handleScrollMargins(nextProps.scrollMargins)

0 commit comments

Comments
 (0)