Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
This repository was archived by the owner on May 25, 2019. It is now read-only.

Commit 646738f

Browse files
1. Fixed CodeMirror bug
2. Increased priority of provider to put it before the CSS Inline Editor
1 parent 0864c38 commit 646738f

File tree

3 files changed

+9
-3
lines changed

3 files changed

+9
-3
lines changed

‎NGUtils.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* https://github.com/adobe/brackets/blob/master/src/language/JSUtils.js */
1+
/* https://github.com/adobe/brackets/blob/master/src/language/JSUtils.js */
22

33
/*jslint vars: true, plusplus: true, devel: true, nomen: true, regexp: true, indent: 4, maxerr: 50 */
44
/*global define, ,ドル brackets, CodeMirror */
@@ -14,6 +14,7 @@ define(function (require, exports, module) {
1414
DocumentManager = brackets.getModule("document/DocumentManager"),
1515
FileUtils = brackets.getModule("file/FileUtils"),
1616
_ = brackets.getModule("thirdparty/lodash"),
17+
CodeMirror = brackets.getModule("thirdparty/CodeMirror2/lib/codemirror"),
1718
StringUtils = brackets.getModule("utils/StringUtils");
1819

1920
/**

‎main.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,19 +165,24 @@ define(function (require, exports, module) {
165165
function provider(hostEditor, pos) {
166166
// Only provide an editor when cursor is in HTML content
167167
if (hostEditor.getModeForSelection() !== "html") {
168+
console.info('AJS: No HTML');
168169
return null;
169170
}
170171

171172
// Only provide an editor if the selection is within a single line
172173
var sel = hostEditor.getSelection();
173174
if (sel.start.line !== sel.end.line) {
175+
console.info('AJS: Multi Selection');
174176
return null;
175177
}
176178

177179
// Always use the selection start for determining the function name. The pos
178180
// parameter is usually the selection end.
179181
var directiveName = _getDirectiveName(hostEditor, sel.start),
180182
controllerName = _getControllerName(hostEditor, sel.start);
183+
184+
console.info('Directive: ', directiveName);
185+
console.info('Controller: ', controllerName);
181186

182187
if (controllerName) {
183188
return _createInlineEditor(hostEditor, controllerName, patterns.controller);
@@ -191,5 +196,5 @@ define(function (require, exports, module) {
191196
}
192197

193198
// init
194-
EditorManager.registerInlineEditProvider(provider);
199+
EditorManager.registerInlineEditProvider(provider,10);
195200
});

‎test.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ <h1>Kickass</h1>
3131

3232
<ul ng-controller="Testing">
3333
<li my-directive></li>
34-
34+
<my-directive></my-directive>
3535
</ul>
3636
</body>
3737
</html>

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /