← Commit list

5dbbd0a6f

Ron Yorston
Ron Yorston
2021-06-27
SUCCESS Duration: 154s

Subject

vi: stored search pattern applies to ':s'

Binary

No binary (build failed)

Architecture & Compiler Flags

Architecture: x86_64-linux-gnu Compiler: gcc (Ubuntu 11.4.0-1ubuntu1~22.04.3) 11.4.0

—

Build Log

(log yok)

Commit Diff GitHub →

editors/vi.c+12 -0
@@ -3100,6 +3100,18 @@ static void colon(char *buf)
}
len_R = strlen(R);
+ if (len_F) { // save "find" as last search pattern
+ free(last_search_pattern);
+ last_search_pattern = xstrdup(F - 1);
+ last_search_pattern[0] = '/';
+ } else if (last_search_pattern[1] == '\0') {
+ status_line_bold("No previous search");
+ goto ret;
+ } else {
+ F = last_search_pattern + 1;
+ len_F = strlen(F);
+ }
+
if (e < 0) { // no addr given
q = begin_line(dot); // start with cur line
r = end_line(dot);