Remove redundant setWrapLimit method

This commit is contained in:
Joe Cheng 2011-02-11 16:02:53 +08:00 • committed by Fabian Jakobs
commit 9226825600
3 changed files with 8 additions and 11 deletions

View file

@ -670,10 +670,6 @@ var EditSession = function(text, mode) {
return this.$useWrapMode;
};
this.setWrapLimit = function(wrapLimit) {
this.setWrapLimitRange(wrapLimit, wrapLimit);
};
// Allow the wrap limit to move freely between min and max. Either
// parameter can be null to allow the wrap limit to be unconstrained
// in that direction. Or set both parameters to the same number to pin

View file

@ -169,14 +169,14 @@ var Test = {
var wrapLimit = 12;
var session = new EditSession(["foo bar foo bar"]);
session.setUseWrapMode(true);
session.setWrapLimit(12);
session.setWrapLimitRange(12, 12);
assert.position(session.documentToScreenPosition(0, 11), 0, 11);
assert.position(session.documentToScreenPosition(0, 12), 1, 0);
session = new EditSession(["ぁぁa"]);
session.setUseWrapMode(true);
session.setWrapLimit(2);
session.setWrapLimitRange(2, 2);
assert.position(session.documentToScreenPosition(0, 1), 1, 0);
assert.position(session.documentToScreenPosition(0, 2), 2, 0);
assert.position(session.documentToScreenPosition(0, 4), 2, 1);
@ -202,7 +202,7 @@ var Test = {
var wrapLimit = 12;
var session = new EditSession(["foo bar foo bar"]);
session.setUseWrapMode(true);
session.setWrapLimit(12);
session.setWrapLimitRange(12, 12);
assert.position(session.screenToDocumentPosition(1, 0), 0, 12);
assert.position(session.screenToDocumentPosition(0, 11), 0, 11);
@ -378,7 +378,7 @@ var Test = {
var document = session.getDocument();
session.setUseWrapMode(true);
session.setWrapLimit(3);
session.setWrapLimitRange(3, 3);
// Test if wrapData is there and was computed.
assert.equal(session.$wrapData.length, 2);