Make replace all commands report no matches for read-only documents.

git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@1490 ea778897-0a13-0410-b9d1-a72fbfd435f5
This commit is contained in:
Nick Treleaven 2007-04-30 12:24:40 +00:00
parent 6287c9d146
commit 882f59c309
2 changed files with 3 additions and 1 deletions

View File

@ -7,6 +7,8 @@
Allow replacing identical text if case sensitive is not checked.
* src/document.c:
Fix reloading of read-only documents.
* src/document.c:
Make replace all commands report no matches for read-only documents.
2007-04-29 Nick Treleaven <nick.treleaven@btinternet.com>

View File

@ -1291,7 +1291,7 @@ document_replace_range(gint idx, const gchar *find_text, const gchar *replace_te
if (new_range_end != NULL)
*new_range_end = -1;
g_return_val_if_fail(find_text != NULL && replace_text != NULL, 0);
if (idx == -1 || ! *find_text) return 0;
if (idx == -1 || ! *find_text || doc_list[idx].readonly) return 0;
sci_start_undo_action(doc_list[idx].sci);
ttf.chrg.cpMin = start;