search: disallow switching to the Replace prompt when in view mode
Switching to Replace allows modifiying the buffer, which should
not be possible in view mode.
This fixes https://savannah.gnu.org/bugs/?54649.
Bug existed since version 2.9.4, commit 54103d8e
.
Signed-off-by: Liu Hao <lh_mouse@126.com>
master
parent
b84d7bf7a5
commit
6cd53e7f44
|
@ -155,6 +155,12 @@ void search_init(bool replacing, bool keep_the_answer)
|
|||
} else if (func == regexp_void) {
|
||||
TOGGLE(USE_REGEXP);
|
||||
} else if (func == flip_replace) {
|
||||
if (ISSET(VIEW_MODE)) {
|
||||
print_view_warning();
|
||||
tidy_up_after_search();
|
||||
free(thedefault);
|
||||
return;
|
||||
}
|
||||
replacing = !replacing;
|
||||
} else {
|
||||
if (func == flip_goto)
|
||||
|
|
Loading…
Reference in New Issue