535 Commits

Author SHA1 Message Date
Nick Treleaven
bc837b18a5 Improve error message for document_save_file() if doc->file_name is
NULL (reusing existing strings).
Add warning about this in the API docs.



git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@5466 ea778897-0a13-0410-b9d1-a72fbfd435f5
2010-12-06 18:04:42 +00:00
Nick Treleaven
1f2ef01d31 Warn about file truncation if unsafe file saving fails.
git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@5455 ea778897-0a13-0410-b9d1-a72fbfd435f5
2010-12-01 13:06:01 +00:00
Nick Treleaven
3a3d8815a3 Add gio_unsafe_save_backup hidden pref (patch by Lex Trotman,
thanks).



git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@5430 ea778897-0a13-0410-b9d1-a72fbfd435f5
2010-11-23 16:23:22 +00:00
Nick Treleaven
80799825bd Display better error messages when saving a document fails (patch by
Dimitar Zhekov, thanks).



git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@5396 ea778897-0a13-0410-b9d1-a72fbfd435f5
2010-11-11 13:13:37 +00:00
Nick Treleaven
6cfea4b550 Set errno to 0 before doing disk I/O to prevent confusing error
messages on save failure.



git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@5395 ea778897-0a13-0410-b9d1-a72fbfd435f5
2010-11-10 18:19:20 +00:00
Nick Treleaven
1355795908 Fix not reporting an error message when saving a document fails.
Check result of fclose().



git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@5391 ea778897-0a13-0410-b9d1-a72fbfd435f5
2010-11-10 13:44:10 +00:00
Nick Treleaven
9aa94483b6 Use LF line endings for templates internally instead of default
pref because the default can change. This fixes missing line
endings sometimes when changing default setting.



git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@5390 ea778897-0a13-0410-b9d1-a72fbfd435f5
2010-11-10 13:13:28 +00:00
Enrico Tröger
3ad555d003 Fix build with GTK 2.12: explicitly include gio.h if GIO is available and to be used regardless of the USE_GIO_FILEMON flag.
git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@5372 ea778897-0a13-0410-b9d1-a72fbfd435f5
2010-11-07 13:48:10 +00:00
Nick Treleaven
9542675549 Add debug message when using g_file_set_contents() to save documents.
git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@5371 ea778897-0a13-0410-b9d1-a72fbfd435f5
2010-11-07 13:13:05 +00:00
Nick Treleaven
4db93b90d7 Make use_safe_file_saving hidden pref apply even when GIO is
available, because g_file_replace_contents() doesn't handle disk
space exhaustion.



git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@5370 ea778897-0a13-0410-b9d1-a72fbfd435f5
2010-11-07 13:08:13 +00:00
Nick Treleaven
e495ce83a0 Fix resource leak when saving files with GIO (patch by Colomban
Wendling, thanks).



git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@5367 ea778897-0a13-0410-b9d1-a72fbfd435f5
2010-11-04 18:07:44 +00:00
Nick Treleaven
f346f985df Add filetypes_get_display_name() to get translations for filetype
None.



git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@5366 ea778897-0a13-0410-b9d1-a72fbfd435f5
2010-11-04 18:06:09 +00:00
Nick Treleaven
47fe273033 Use g_file_replace_contents() if available to save documents - this
should help workaround bugs in GVFS.
Needs testing.



git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@5361 ea778897-0a13-0410-b9d1-a72fbfd435f5
2010-11-02 17:42:54 +00:00
Nick Treleaven
3455a25cf4 Show mimetype icon in sidebar Documents list (patch by Colomban
Wendling, thanks).



git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@5330 ea778897-0a13-0410-b9d1-a72fbfd435f5
2010-10-26 17:20:48 +00:00
Nick Treleaven
568f1853d2 Remove unnecessary uses of FILETYPE_ID() macro with
GeanyDocument::file_type.



git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@5323 ea778897-0a13-0410-b9d1-a72fbfd435f5
2010-10-25 17:24:47 +00:00
Nick Treleaven
c25d9856fe Add 'Ensure consistent line endings' file saving pref (patch by
Manuel Bua, thanks).



git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@5321 ea778897-0a13-0410-b9d1-a72fbfd435f5
2010-10-25 16:24:55 +00:00
Nick Treleaven
6738d3bc1e Use secondary text for 'file not found on disk' dialog.
git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@5298 ea778897-0a13-0410-b9d1-a72fbfd435f5
2010-10-15 17:24:13 +00:00
Nick Treleaven
59690a1617 Avoid delay and redrawing when automatically opening a new document
after closing one.



git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@5265 ea778897-0a13-0410-b9d1-a72fbfd435f5
2010-09-30 14:49:54 +00:00
Nick Treleaven
d8dce113a2 Add symbol_list_sort_mode per-filetype setting, set to sort by line
number by default for Markdown, reStructuredText and Txt2Tags.
Add utils_get_setting() macro for reading a key from a home or
system keyfile.
Move GeanyFiletypePrivate to filetypesprivate.h.



git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@5262 ea778897-0a13-0410-b9d1-a72fbfd435f5
2010-09-30 13:50:33 +00:00
Nick Treleaven
3fe15d0ebb Add hidden pref new_document_after_close for whether to open a new
document automatically, off by default.



git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@5257 ea778897-0a13-0410-b9d1-a72fbfd435f5
2010-09-23 16:24:43 +00:00
Nick Treleaven
90dc51914d Fix segfault on idle callback when quitting.
git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@5254 ea778897-0a13-0410-b9d1-a72fbfd435f5
2010-09-23 14:20:29 +00:00
Nick Treleaven
9c71adb4bd Open a new document automatically after closing all documents.
git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@5244 ea778897-0a13-0410-b9d1-a72fbfd435f5
2010-09-20 12:19:26 +00:00
Nick Treleaven
e664c8344f Allow per-document indent width setting (patch by Jiří Techet,
updated by Erik de Castro Lopo - thanks).



git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@5228 ea778897-0a13-0410-b9d1-a72fbfd435f5
2010-09-14 15:01:29 +00:00
Nick Treleaven
71a63eec9b Show Save As when saving if the document filename doesn't have an
absolute path, so command-line new files can be saved without a
prompt, but file templates still prompt the user.



git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@5222 ea778897-0a13-0410-b9d1-a72fbfd435f5
2010-09-09 17:31:27 +00:00
Nick Treleaven
8e54555bea Add Close button to the detected file changed dialog.
git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@5206 ea778897-0a13-0410-b9d1-a72fbfd435f5
2010-09-08 14:56:27 +00:00
Enrico Tröger
befcb63e59 Ensure inserted templates always have proper line ending characters
according to the current document's preference.
This is also fixes problems with templates on Windows which had
always Unix line ending characters but now since they are read
from files, these have Windows line ending characters and had been
converted twice.

git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@5114 ea778897-0a13-0410-b9d1-a72fbfd435f5
2010-08-01 17:20:50 +00:00
Enrico Tröger
9fec7e064e Fix Undo/Redo button state after the last document has been closed.
git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@4940 ea778897-0a13-0410-b9d1-a72fbfd435f5
2010-05-22 19:38:49 +00:00
Enrico Tröger
48064120f8 Small improvements to speed up quit process with many open documents.
Avoid calling gtk_notebook_remove_page() on exit as it takes a lot of time.

git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@4921 ea778897-0a13-0410-b9d1-a72fbfd435f5
2010-05-16 17:43:24 +00:00
Nick Treleaven
e2c321b2e2 Only replace template filename matching start of word on saving.
git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@4901 ea778897-0a13-0410-b9d1-a72fbfd435f5
2010-05-11 12:10:31 +00:00
Nick Treleaven
bf09ed5c48 Fix replacing {filename} template wildcard for custom file
templates with non-default file extension.
Add search_find_text() for POSIX regex searches.



git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@4873 ea778897-0a13-0410-b9d1-a72fbfd435f5
2010-05-05 12:50:59 +00:00
Nick Treleaven
f38b468348 Add function document_apply_indent_settings() for use later.
git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@4872 ea778897-0a13-0410-b9d1-a72fbfd435f5
2010-05-05 12:07:45 +00:00
Enrico Tröger
4d34795c94 Declare document_stop_file_monitoring() as static.
git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@4858 ea778897-0a13-0410-b9d1-a72fbfd435f5
2010-04-25 17:42:33 +00:00
Nick Treleaven
5bbd6a30d7 Fix wrong selection range after Replace in Selection.
git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@4784 ea778897-0a13-0410-b9d1-a72fbfd435f5
2010-03-25 13:43:37 +00:00
Nick Treleaven
a190e1bfb7 Use 3rd person for more API dox.
Change 'This is a wrapper function for...' to 'Wraps...' in brief
descriptions.
Change 'After all...' to 'Afterwards...'.



git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@4760 ea778897-0a13-0410-b9d1-a72fbfd435f5
2010-03-15 13:01:16 +00:00
Nick Treleaven
138cbaa02f Use 3rd person (gets not get) for API function brief descriptions.
Avoid using 'convenience function' in API brief descriptions.



git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@4757 ea778897-0a13-0410-b9d1-a72fbfd435f5
2010-03-12 18:15:48 +00:00
Nick Treleaven
aaa1e9657a Merge gnu-regex branch:
Use POSIX system/GNU regex engine for find & replace 'Use regular
expressions' option. This alters regex syntax a bit - see the docs
for details; we now support '?' operator and replacement backslash
escaping is more standard.
Make regex search imply replacing escaped chars.
Allow \0 backreference replacement for the whole match.
Note: Replace All may be slower; if this is a problem please let me
know.
- code:
Add argument to utils_str_replace_escape() for keeping
uninterpreted backslash escapes e.g. '\\', '\e'.



git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@4746 ea778897-0a13-0410-b9d1-a72fbfd435f5
2010-03-09 16:56:04 +00:00
Nick Treleaven
17ad8ba1b8 Move search_replace_range() to search.c.
git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/branches/gnu-regex@4740 ea778897-0a13-0410-b9d1-a72fbfd435f5
2010-03-08 13:28:04 +00:00
Nick Treleaven
361b128d81 Refactor document_replace_range() with search_replace_range().
git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/branches/gnu-regex@4739 ea778897-0a13-0410-b9d1-a72fbfd435f5
2010-03-08 13:23:32 +00:00
Enrico Tröger
0865b45ed9 Fix broken 'Save' action in 'Resave missing file' dialog.
git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@4728 ea778897-0a13-0410-b9d1-a72fbfd435f5
2010-03-07 15:41:25 +00:00
Enrico Tröger
25ec844cfa Fix duplicate mnemonics on 'resave missing file' dialog, also move the question from the secondary to the main text to be more compatible with the Gnome HIG.
git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@4727 ea778897-0a13-0410-b9d1-a72fbfd435f5
2010-03-07 15:32:34 +00:00
Nick Treleaven
f96c3d1a00 Move new regex code to search.c: search_find_next(),
search_replace_target().



git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/branches/gnu-regex@4720 ea778897-0a13-0410-b9d1-a72fbfd435f5
2010-03-02 13:21:41 +00:00
Nick Treleaven
3927eb059b Fix not replacing escapes within a backreference match.
git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/branches/gnu-regex@4718 ea778897-0a13-0410-b9d1-a72fbfd435f5
2010-03-01 18:28:57 +00:00
Nick Treleaven
e669410ad1 Fix regex search for '\\'.
git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/branches/gnu-regex@4717 ea778897-0a13-0410-b9d1-a72fbfd435f5
2010-03-01 18:16:28 +00:00
Enrico Tröger
995a467901 Fix document_try_focus() to make it work with the sidebar document list as well.
git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@4712 ea778897-0a13-0410-b9d1-a72fbfd435f5
2010-02-28 14:32:38 +00:00
Nick Treleaven
6c1a52d58c Implement regex backreference replacement for \0 (whole match) and
groups \1 to \9.



git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/branches/gnu-regex@4706 ea778897-0a13-0410-b9d1-a72fbfd435f5
2010-02-26 16:08:34 +00:00
Nick Treleaven
d4dd143357 Implement single POSIX regex replacement - escape replacements are
done with utils_str_replace_escape().
Warning: regex backreference replacement is still to do.
Make utils_str_replace_escape() accept unnecessary escapes (e.g.
'\e' goes to 'e').



git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/branches/gnu-regex@4705 ea778897-0a13-0410-b9d1-a72fbfd435f5
2010-02-25 18:30:43 +00:00
Nick Treleaven
463100341f Make Find dialog Next button use GNU/system regex instead of
Scintilla engine.



git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/branches/gnu-regex@4704 ea778897-0a13-0410-b9d1-a72fbfd435f5
2010-02-24 15:27:12 +00:00
Enrico Tröger
3bcaedd28f Allow saving remote files using g_file_set_contents() as well (patch by Алексей Антипов, thanks).
git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@4641 ea778897-0a13-0410-b9d1-a72fbfd435f5
2010-02-06 16:00:11 +00:00
Nick Treleaven
cfa2b8b532 Show 'Replaced X matches in Y documents' message when using Replace in
Session.



git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@4533 ea778897-0a13-0410-b9d1-a72fbfd435f5
2010-01-18 17:05:13 +00:00
Enrico Tröger
7ba4a81181 Update copyright information.
git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@4518 ea778897-0a13-0410-b9d1-a72fbfd435f5
2010-01-01 22:55:18 +00:00