Skip to content

Commit

Permalink
Fix firefox-devtools#4397 - Don't allow context menu when a line is e…
Browse files Browse the repository at this point in the history
…mpty
  • Loading branch information
darkwing authored and jasonLaster committed Oct 18, 2017
1 parent 495339a commit acea219
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions src/components/Editor/GutterMenu.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { connect } from "react-redux";
import { lineAtHeight } from "../../utils/editor";
import {
getContextMenu,
getEmptyLines,
getSelectedLocation,
getSelectedSource,
getVisibleBreakpoints,
Expand Down Expand Up @@ -143,6 +144,10 @@ class GutterContextMenuComponent extends PureComponent {
bp => bp.location.line === line
);

if (props.emptyLines.includes(line)) {
return;
}

gutterMenu({ event, sourceId, line, breakpoint, ...props });
}

Expand All @@ -153,12 +158,16 @@ class GutterContextMenuComponent extends PureComponent {

export default connect(
state => {
const selectedSource = getSelectedSource(state);
return {
selectedLocation: getSelectedLocation(state),
selectedSource: getSelectedSource(state),
selectedSource: selectedSource,
breakpoints: getVisibleBreakpoints(state),
pauseData: getPause(state),
contextMenu: getContextMenu(state)
contextMenu: getContextMenu(state),
emptyLines: selectedSource
? getEmptyLines(state, selectedSource.toJS())
: []
};
},
dispatch => bindActionCreators(actions, dispatch)
Expand Down

0 comments on commit acea219

Please sign in to comment.