Skip to content

Commit 0568f12

Browse files
committed
Revert "fix highlighting in shell for lines longer than console width SERVER-3394"
This reverts commit fb88b80.
1 parent 210e12a commit 0568f12

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

third_party/linenoise/linenoise.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -273,19 +273,19 @@ static void refreshLine(int fd, const char *prompt, char *buf, size_t len, size_
273273
if (pos < len) {
274274
/* this scans for a brace matching buf[pos] to highlight */
275275
int scanDirection = 0;
276-
if (memchr("}])", buf[pos], len))
276+
if (strchr("}])", buf[pos]))
277277
scanDirection = -1; /* backwards */
278-
else if (memchr("{[(", buf[pos], len))
278+
else if (strchr("{[(", buf[pos]))
279279
scanDirection = 1; /* forwards */
280280

281281
if (scanDirection) {
282282
int unmatched = scanDirection;
283283
int i;
284284
for(i = pos + scanDirection; i >= 0 && buf[i]; i += scanDirection){
285285
/* TODO: the right thing when inside a string */
286-
if (memchr("}])", buf[i], len))
286+
if (strchr("}])", buf[i]))
287287
unmatched--;
288-
else if (memchr("{[(", buf[i], len))
288+
else if (strchr("{[(", buf[i]))
289289
unmatched++;
290290

291291
if (unmatched == 0) {

0 commit comments

Comments
 (0)