Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
allow content proposal to replace the prefix
  • Loading branch information
tomsontom committed Oct 15, 2012
1 parent 35ad2c8 commit 368ecc2
Showing 1 changed file with 10 additions and 3 deletions.
Expand Up @@ -131,14 +131,21 @@ define("orion/editor/contentAssist", ['i18n!orion/editor/nls/messages', 'orion/t
return false;
}
var offset = this.textView.getCaretOffset();
var start = offset;
var end = offset;

if( proposal.replace ) {
start = this.getPrefixStart(offset);
}

var data = {
proposal: proposal,
start: offset,
end: offset
start: start,
end: end
};
this.setState(State.INACTIVE);
var proposalText = proposal.proposal || proposal;
this.textView.setText(proposalText, offset, offset);
this.textView.setText(proposalText, start, end);
this.dispatchEvent({type: "ProposalApplied", data: data});
return true;
},
Expand Down

0 comments on commit 368ecc2

Please sign in to comment.