Merge pull request !2939 from rhodecode-enterprise-ce fix/slash_in_comment_edit
fix: fixes comment editing removes slash
This commit is contained in:
commit
1906b1960f
1 changed files with 11 additions and 3 deletions
|
|
@ -23,7 +23,7 @@
|
|||
// Logger.get('CodeMirror').setLevel(Logger.DEBUG)
|
||||
|
||||
cmLog = Logger.get('CodeMirror');
|
||||
cmLog.setLevel(Logger.OFF);
|
||||
cmLog.setLevel(Logger.ERROR);
|
||||
|
||||
|
||||
//global cache for inline forms
|
||||
|
|
@ -426,8 +426,16 @@ var initCommentBoxCodeMirror = function(CommentForm, textAreaId, triggerActions)
|
|||
searchText: "note comment",
|
||||
displayText: _gettext('Note Comment'),
|
||||
hint: function(CodeMirror, data, completion) {
|
||||
CodeMirror.replaceRange("", completion.from || data.from,
|
||||
completion.to || data.to, "complete");
|
||||
let from = completion.from || data.from;
|
||||
const to = completion.to || data.to;
|
||||
|
||||
// If the replacement range starts at '/', skip it so '/' remains
|
||||
const line = cm.getLine(from.line);
|
||||
if (line && line[from.ch] === "/") {
|
||||
from = { line: from.line, ch: from.ch + 1 };
|
||||
}
|
||||
|
||||
cm.replaceRange("", from, to, "complete");
|
||||
|
||||
$(CommentForm.commentType).val('note');
|
||||
},
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue