Make code folding case insensitive in the code mirror. Fixes #4264

This commit is contained in:
Aditya Toshniwal 2021-08-23 16:16:20 +05:30 committed by Akshay Joshi
parent 1b33c52eac
commit c64eb3507c
2 changed files with 4 additions and 4 deletions

View File

@ -9,7 +9,7 @@ This release contains a number of bug fixes and new features since the release o
New features New features
************ ************
| `Issue #4264 <https://redmine.postgresql.org/issues/4264>`_ - Make code folding case insensitive in the code mirror.
Housekeeping Housekeeping
************ ************

View File

@ -27,7 +27,7 @@
let startTkn = tokenSet[tokenSetNo].start, let startTkn = tokenSet[tokenSetNo].start,
endTkn = tokenSet[tokenSetNo].end; endTkn = tokenSet[tokenSetNo].end;
while (at > 0) { while (at > 0) {
var found = lineText.lastIndexOf(startTkn, at); var found = lineText.toUpperCase().lastIndexOf(startTkn, at);
var startToken = startTkn; var startToken = startTkn;
var endToken = endTkn; var endToken = endTkn;
@ -50,12 +50,12 @@
} }
at = found - 1; at = found - 1;
} }
if (startChar == null || lineText.lastIndexOf(startToken) > startChar) return; if (startChar == null || lineText.toUpperCase().lastIndexOf(startToken) > startChar) return;
var count = 1, var count = 1,
lastLine = cm.lineCount(), lastLine = cm.lineCount(),
end, endCh; end, endCh;
outer: for (var i = line + 1; i < lastLine; ++i) { outer: for (var i = line + 1; i < lastLine; ++i) {
var text = cm.getLine(i), var text = cm.getLine(i).toUpperCase(),
pos = 0; pos = 0;
var whileloopvar = 0; var whileloopvar = 0;
while (whileloopvar < 1) { while (whileloopvar < 1) {