mirror of
https://github.com/irssi/irssi.git
synced 2024-12-04 14:46:39 -05:00
Do not require that a line matches the input level to add it to the
'after' context, so that '/lastlog -hilight -after 10 foo' has the same semantic as '/lastlog -hilight -before 10 foo'. git-svn-id: http://svn.irssi.org/repos/irssi/trunk@4570 dbcabf3a-b0e7-0310-adc4-f8d773084564
This commit is contained in:
parent
bc45b39030
commit
566f6d24be
@ -463,7 +463,7 @@ GList *textbuffer_find_text(TEXT_BUFFER_REC *buffer, LINE_REC *startline,
|
||||
g_return_val_if_fail(buffer != NULL, NULL);
|
||||
g_return_val_if_fail(text != NULL, NULL);
|
||||
|
||||
if (regexp && *text != '\0') {
|
||||
if (regexp) {
|
||||
#ifdef HAVE_REGEX_H
|
||||
int flags = REG_EXTENDED | REG_NOSUB |
|
||||
(case_sensitive ? 0 : REG_ICASE);
|
||||
@ -480,19 +480,21 @@ GList *textbuffer_find_text(TEXT_BUFFER_REC *buffer, LINE_REC *startline,
|
||||
line = startline != NULL ? startline : buffer->first_line;
|
||||
|
||||
for (; line != NULL; line = line->next) {
|
||||
if ((line->info.level & level) == 0 ||
|
||||
(line->info.level & nolevel) != 0)
|
||||
continue;
|
||||
line_matched = (line->info.level & level) != 0 &&
|
||||
(line->info.level & nolevel) == 0;
|
||||
|
||||
if (*text == '\0') {
|
||||
/* no search word, everything matches */
|
||||
if (line_matched) {
|
||||
textbuffer_line_ref(line);
|
||||
matches = g_list_append(matches, line);
|
||||
}
|
||||
continue;
|
||||
}
|
||||
|
||||
textbuffer_line2text(line, FALSE, str);
|
||||
|
||||
if (line_matched)
|
||||
line_matched =
|
||||
#ifdef HAVE_REGEX_H
|
||||
regexp ? regexec(&preg, str->str, 0, NULL, 0) == 0 :
|
||||
|
Loading…
Reference in New Issue
Block a user