Skip to content

Commit

Permalink
Disallow editing by selection dragging when not editable.
Browse files Browse the repository at this point in the history
Fixes #156.
  • Loading branch information
TomasMikula committed Jun 25, 2015
1 parent 07fc7a1 commit ece0cde
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -424,7 +424,8 @@ private void mousePressed(MouseEvent e) {
private void firstLeftPress(CharacterHit hit) {
clearTargetCaretOffset();
IndexRange selection = area.getSelection();
if(selection.getLength() != 0 &&
if(area.isEditable() &&
selection.getLength() != 0 &&
hit.getCharacterIndex() >= selection.getStart() &&
hit.getCharacterIndex() < selection.getEnd()) {
// press inside selection
Expand Down

0 comments on commit ece0cde

Please sign in to comment.