Skip to content

Commit

Permalink
Fix quote method bug
Browse files Browse the repository at this point in the history
  • Loading branch information
ww24 committed Oct 14, 2014
1 parent 954b948 commit 1a429a3
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 9 deletions.
4 changes: 2 additions & 2 deletions build/deps/mace-core.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

/*!
* Mace 0.1.0
* Mace 0.1.1
* copyright: Takenori Nakagawa
* license: MIT
*/
Expand Down Expand Up @@ -306,7 +306,7 @@
pos = this.ace.getCursorPosition();
range = this._getCurrentRage();
if (range.start.row === range.end.row && str.length > 0) {
this.ace.insert(items.split("\n").map(function(line) {
this.ace.insert(str.split("\n").map(function(line) {
return "> " + line;
}).join("\n") + "\n");
} else {
Expand Down
4 changes: 2 additions & 2 deletions build/deps/mace-core.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions build/mace.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "mace",
"version": "0.1.0",
"version": "0.1.1",
"description": "Mace = Markdown editor powered by Ace.",
"main": "gulpfile.js",
"scripts": {
Expand Down
4 changes: 2 additions & 2 deletions src/mace.coffee
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
###!
# Mace 0.1.0
# Mace 0.1.1
# copyright: Takenori Nakagawa
# license: MIT
###
Expand Down Expand Up @@ -230,7 +230,7 @@ class Mace

if range.start.row is range.end.row and str.length > 0
# init str mode
@ace.insert items.split("\n").map((line) -> "> #{line}").join("\n") + "\n"
@ace.insert str.split("\n").map((line) -> "> #{line}").join("\n") + "\n"
else
for row in [range.start.row..range.end.row]
@ace.moveCursorTo row, 0
Expand Down
6 changes: 6 additions & 0 deletions test/mace.js
Original file line number Diff line number Diff line change
Expand Up @@ -510,6 +510,12 @@ describe("Mace", function () {

expect(mace.value).to.equal("This is a editor.\nMace = Markdown editor powered by Ace.\n");
});

it("set initial string", function () {
mace.quote("This is a editor.\nMace = Markdown editor powered by Ace.\n");

expect(mace.value).to.equal("> This is a editor.\n> Mace = Markdown editor powered by Ace.\n> \n");
});
});

});

0 comments on commit 1a429a3

Please sign in to comment.