Skip to content
This repository has been archived by the owner on Sep 6, 2021. It is now read-only.

Commit

Permalink
Merge pull request #2675 from adobe/dangoor/css-no-semicolon
Browse files Browse the repository at this point in the history
fixes #2625: don't auto append semicolon after selecting a property value
  • Loading branch information
RaymondLim committed Jan 25, 2013
2 parents b29a743 + 655e2e9 commit 52a17aa
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
4 changes: 1 addition & 3 deletions src/extensions/default/CSSCodeHints/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -142,9 +142,7 @@ define(function (require, exports, module) {

if (this.info.context === CSSUtils.PROP_NAME) {
closure = ":";
} else if (this.info.context === CSSUtils.PROP_VALUE) {
closure = ";";
} else {
} else if (this.info.context !== CSSUtils.PROP_VALUE) {
return false;
}

Expand Down
5 changes: 2 additions & 3 deletions src/extensions/default/CSSCodeHints/unittests.js
Original file line number Diff line number Diff line change
Expand Up @@ -175,12 +175,11 @@ define(function (require, exports, module) {
expectCursorAt({ line: 7, ch: 8 });
});

it("should insert semicolon followed by newline after prop-value selected", function () {
// insert semicolon after previous rule to avoid incorrect tokenizing
it("should not insert semicolon after prop-value selected", function () {
testDocument.replaceRange(";", { line: 12, ch: 5 });
testEditor.setCursorPos({ line: 13, ch: 10 }); // cursor after 'display: '
selectHint(CSSCodeHints.cssPropHintProvider, "block");
expect(testDocument.getLine(13)).toBe(" display: block;");
expect(testDocument.getLine(13)).toBe(" display: block");
});

it("should insert prop-name directly after semicolon", function () {
Expand Down

0 comments on commit 52a17aa

Please sign in to comment.