Skip to content

Commit e7761e7

Browse files
aslushnikovmarijnh
authored andcommitted
fix comment.js plugin
1 parent 7dfbf42 commit e7761e7

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

addon/comment/comment.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@
109109
CodeMirror.defineExtension("uncomment", function(from, to, options) {
110110
if (!options) options = noOptions;
111111
var self = this, mode = self.getModeAt(from);
112-
var end = Math.min(to.line, self.lastLine()), start = Math.min(from.line, end);
112+
var end = Math.min(to.ch != 0 || to.line == from.line ? to.line : to.line - 1, self.lastLine()), start = Math.min(from.line, end);
113113

114114
// Try finding line comments
115115
var lineString = options.lineComment || mode.lineComment, lines = [];

0 commit comments

Comments
 (0)