Enrico Tröger
035d6c3e22
Use plain old fwrite() in utils_write_file(). g_file_set_contents() is only used when explicitly requested.
...
git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@3781 ea778897-0a13-0410-b9d1-a72fbfd435f5
2009-05-11 15:56:33 +00:00
Enrico Tröger
5c91e8aefd
Add utils_color_invert() and use it in highlighting.c and printing.c.
...
git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@3773 ea778897-0a13-0410-b9d1-a72fbfd435f5
2009-05-08 17:00:28 +00:00
Enrico Tröger
f1eb8dc22d
Ellipsize tab labels and some status messages for very long filenames ( closes #2777348 ).
...
git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@3718 ea778897-0a13-0410-b9d1-a72fbfd435f5
2009-04-21 20:52:51 +00:00
Enrico Tröger
a95a59a42f
Remove all G_LIKELY macros inside g_return_if_fail() statements as this is redundant.
...
Remove many other G_LIKELY/G_UNLIKELY macros which doesn't make much sense to keep the code more readable.
git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@3708 ea778897-0a13-0410-b9d1-a72fbfd435f5
2009-04-15 22:47:33 +00:00
Enrico Tröger
a9dc990049
Start using G_LIKELY/G_UNLIKELY macros to gain a little more performance when building the code with gcc.
...
git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@3687 ea778897-0a13-0410-b9d1-a72fbfd435f5
2009-04-05 21:07:40 +00:00
Enrico Tröger
a6cecbd433
Add utils_path_skip_root(), a relative path safe variant of g_path_skip_root (forgotten patch by Colomban Wendling, #2518658 ).
...
git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@3663 ea778897-0a13-0410-b9d1-a72fbfd435f5
2009-03-27 15:40:19 +00:00
Enrico Tröger
8cd312e250
Small optimisations by moving out function calls of loop break conditions (patch by Frank, thanks).
...
git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@3571 ea778897-0a13-0410-b9d1-a72fbfd435f5
2009-02-10 21:11:25 +00:00
Enrico Tröger
b2eeefc919
Add some missing @since tags to the API documentation of various functions.
...
git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@3531 ea778897-0a13-0410-b9d1-a72fbfd435f5
2009-01-30 18:53:23 +00:00
Enrico Tröger
56a1470bb9
Add utils_string_replace_first() to the plugin API.
...
Allow entering paths prefixed with '~' in the filebrowser path entry.
Show the full path for files and folders in the filebrowser plugin as tooltips.
git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@3529 ea778897-0a13-0410-b9d1-a72fbfd435f5
2009-01-30 16:12:25 +00:00
Enrico Tröger
5752ee9863
Rename utils_start_browser() in utils_open_browser() and add it to the plugin API.
...
Add plugin symbol plugin_help() which is called by Geany when the plugin should show its documentation (if any). This symbol is optional, plugins can omit it if not needed.
Add a Help button next to the Configure button in the plugin manager dialog to easily open a plugin's documentation if available.
git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@3524 ea778897-0a13-0410-b9d1-a72fbfd435f5
2009-01-28 19:30:18 +00:00
Enrico Tröger
ba97eb158c
Use g_file_set_contents() to write files to disk in utils_write_file() for better error checking and to avoid corruption of config files when there is no more free disk space.
...
This is not used for saving documents (part of Debian bug #503391 ).
git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@3507 ea778897-0a13-0410-b9d1-a72fbfd435f5
2009-01-24 19:39:10 +00:00
Enrico Tröger
f7978158a5
Increase minimum required GTK version to 2.8.
...
git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@3504 ea778897-0a13-0410-b9d1-a72fbfd435f5
2009-01-22 20:33:21 +00:00
Enrico Tröger
0582c61824
Replace remaining occurrences of '__func__' with 'G_STRFUNC'.
...
git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@3496 ea778897-0a13-0410-b9d1-a72fbfd435f5
2009-01-21 22:49:21 +00:00
Enrico Tröger
e36a60c4f0
Skip disk changes detection for all remote files.
...
Don't try to detect a remote file when running on old GLib versions without GIO (< 2.16).
git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@3490 ea778897-0a13-0410-b9d1-a72fbfd435f5
2009-01-19 19:30:18 +00:00
Frank Lanitz
dd2ae2e7b9
Added a missing g_free().
...
git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@3487 ea778897-0a13-0410-b9d1-a72fbfd435f5
2009-01-18 23:05:54 +00:00
Enrico Tröger
4a6abdaa0e
Fix build without GIO again (sorry).
...
Remove trailing slashes in Makefile.am's (patch by Daniel Richard G., thanks).
git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@3463 ea778897-0a13-0410-b9d1-a72fbfd435f5
2009-01-12 00:33:29 +00:00
Enrico Tröger
bd2d677d84
Support multiple %cursor% wildcards in Snippets. To switch between %cursor% wildcards, use the new keybinding 'Move cursor in snippet' (patch by Thomas Martitz, thanks).
...
git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@3461 ea778897-0a13-0410-b9d1-a72fbfd435f5
2009-01-11 21:05:03 +00:00
Enrico Tröger
ceb7edc8f1
Fix build with GTK 2.12 by adding GIO compile and linker flags ( closes #2498580 ).
...
git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@3459 ea778897-0a13-0410-b9d1-a72fbfd435f5
2009-01-11 17:40:40 +00:00
Enrico Tröger
153544a80e
Add utils_is_remote_path().
...
Add private field 'is_remote' to GeanyDocument to indicate whether an opened file is locally accessed or via gvfs-fuse.
git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@3457 ea778897-0a13-0410-b9d1-a72fbfd435f5
2009-01-09 18:22:07 +00:00
Enrico Tröger
787a680290
Add checks for GIO (GLib >= 2.16) support.
...
Allow to specify files on the command line and from remote instances to be URIs (local and with GIO also remote URIs).
git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@3454 ea778897-0a13-0410-b9d1-a72fbfd435f5
2009-01-09 18:21:12 +00:00
Enrico Tröger
39a6eb455e
Update copyright information.
...
git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@3446 ea778897-0a13-0410-b9d1-a72fbfd435f5
2009-01-04 18:30:42 +00:00
Nick Treleaven
151d57c497
Remove unnecessary cast, edit dox for utils_get_setting_string().
...
git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@3299 ea778897-0a13-0410-b9d1-a72fbfd435f5
2008-12-01 13:06:25 +00:00
Enrico Tröger
3ae60f4089
Initialise static pointer, just to be safe.
...
git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@3296 ea778897-0a13-0410-b9d1-a72fbfd435f5
2008-11-29 18:34:56 +00:00
Nick Treleaven
899dce26b6
Add 'Tools->Configuration Files' menu with items to open
...
filetype_extensions.conf and ignore.tags. These files are also
reloaded automatically when saved.
- Code changes:
Make app->configdir a realpath().
Add ui_add_config_file_menu_item().
Add utils_build_path(), similar to g_build_path() but (re)using a
fixed buffer, so the result is never freed.
git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@3279 ea778897-0a13-0410-b9d1-a72fbfd435f5
2008-11-26 13:15:53 +00:00
Enrico Tröger
7a21c84e8a
Fix for r3267
...
git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@3269 ea778897-0a13-0410-b9d1-a72fbfd435f5
2008-11-21 18:32:41 +00:00
Enrico Tröger
160e5e8491
Attempt to make utils_get_date_time() UTF-8 safe and add it to the plugin API.
...
Fix misnamed str_casecmp() function in the plugin API, sorry.
git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@3267 ea778897-0a13-0410-b9d1-a72fbfd435f5
2008-11-21 17:40:04 +00:00
Nick Treleaven
a2ceb60e3a
Make utils_free_pointers() take an arg_count argument to prevent
...
memory leaks.
git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@3245 ea778897-0a13-0410-b9d1-a72fbfd435f5
2008-11-18 17:14:00 +00:00
Enrico Tröger
614fdbd0a7
When passing NULL to utils_str_replace(), also return NULL (fixes broken new file template list).
...
git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@3241 ea778897-0a13-0410-b9d1-a72fbfd435f5
2008-11-16 17:55:23 +00:00
Enrico Tröger
ce2dfe1c9f
Add note about set permissions to the API docs of utils_mkdir().
...
git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@3233 ea778897-0a13-0410-b9d1-a72fbfd435f5
2008-11-16 17:52:38 +00:00
Nick Treleaven
0ef7d92782
Fix bug with utils_string_replace_all().
...
Make utils_str_replace() call utils_string_replace_all() internally
(for better memory management and allowing replacements to match
search string).
git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@3226 ea778897-0a13-0410-b9d1-a72fbfd435f5
2008-11-14 14:15:32 +00:00
Nick Treleaven
e244b17676
Make API function utils_string_replace_all() able to make
...
replacements that match the search string.
git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@3223 ea778897-0a13-0410-b9d1-a72fbfd435f5
2008-11-13 17:19:52 +00:00
Enrico Tröger
d7caf0f9c0
Follow XDG Base Directory specification and use $XDG_CONFIG_HOME/geany (most often this is ~/.config/geany) as default configuration directory ( closes #2166229 ).
...
The previous configuration will be moved to the new location if the new directory doesn't exist yet.
Move utils_make_settings_dir() into main.c.
Remove win32_get_appdata_folder() because g_get_user_config_dir() does the same.
git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@3219 ea778897-0a13-0410-b9d1-a72fbfd435f5
2008-11-13 14:37:47 +00:00
Nick Treleaven
7ac0e5f3b3
Fix empty statements and possible memory leaks with
...
utils_free_pointers() in utils_str_casecmp().
git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@3213 ea778897-0a13-0410-b9d1-a72fbfd435f5
2008-11-12 13:05:33 +00:00
Enrico Tröger
d1b5ace11c
Replace uses of g_strcasecmp() with our own implementation, utils_str_casecmp().
...
Add utils_str_casecmp() to the plugin API.
git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@3210 ea778897-0a13-0410-b9d1-a72fbfd435f5
2008-11-11 19:18:51 +00:00
Enrico Tröger
7009116b1a
Evaluate only the strings 'TRUE' and 'true' to true in utils_atob(), any other string is treated as false.
...
git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@3209 ea778897-0a13-0410-b9d1-a72fbfd435f5
2008-11-11 18:15:14 +00:00
Enrico Tröger
de1839efd6
Formatting.
...
git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@3186 ea778897-0a13-0410-b9d1-a72fbfd435f5
2008-11-07 14:37:57 +00:00
Nick Treleaven
4faeb8f46f
Move utils_reload_configuration() to main.c.
...
git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@2803 ea778897-0a13-0410-b9d1-a72fbfd435f5
2008-07-23 11:46:02 +00:00
Enrico Tröger
8f38a69121
Move code to reload configuration files into utils_reload_configuration() and add it to the plugin API.
...
git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@2794 ea778897-0a13-0410-b9d1-a72fbfd435f5
2008-07-20 18:07:53 +00:00
Nick Treleaven
4837030ca1
Fix compilation.
...
Move utils_get_current_function() to symbols.c.
Move utils_replace_filename() to document.c.
git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/branches/editor-struct@2766 ea778897-0a13-0410-b9d1-a72fbfd435f5
2008-07-08 16:30:37 +00:00
Nick Treleaven
8dcfb7e336
Update for doc->editor->scintilla.
...
git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/branches/editor-struct@2764 ea778897-0a13-0410-b9d1-a72fbfd435f5
2008-07-08 11:26:09 +00:00
Nick Treleaven
1525e93a7d
Fix memory leak in utils_find_open_xml_tag() when size < 3, and only
...
allocate string when '<' found.
Factor insert_closing_tag() from handle_xml(), fixing a memory leak
when ignoring tags like <br>.
git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@2747 ea778897-0a13-0410-b9d1-a72fbfd435f5
2008-07-03 14:39:49 +00:00
Enrico Tröger
d8032f4248
Fix unnecessary 40 character limit for auto-closing XML tags ( closes #2007278 ).
...
git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@2743 ea778897-0a13-0410-b9d1-a72fbfd435f5
2008-07-03 12:32:55 +00:00
Enrico Tröger
d3439f8a17
Use document pointer instead of an index to the documents array everywhere in the core code.
...
Pass a document pointer to the callbacks of all "document-*" signals.
git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/branches/document-pointer@2692 ea778897-0a13-0410-b9d1-a72fbfd435f5
2008-06-15 13:35:48 +00:00
Enrico Tröger
0d4cbd60a1
Allow and use arguments to the browser command ( closes #1989575 ).
...
Add 'xdg-open' as first browser fallback.
git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@2675 ea778897-0a13-0410-b9d1-a72fbfd435f5
2008-06-10 13:51:45 +00:00
Nick Treleaven
17351f2534
Check that the current file is still on disk as well as checking the
...
modification time.
git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@2650 ea778897-0a13-0410-b9d1-a72fbfd435f5
2008-06-06 12:31:05 +00:00
Nick Treleaven
a86ccc6797
Reload a changed document immediately on user clicking reload
...
(waiting was not related to the now fixed reload-colourise problem).
git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@2632 ea778897-0a13-0410-b9d1-a72fbfd435f5
2008-06-02 15:50:56 +00:00
Nick Treleaven
be0d9e8ea7
Note: this breaks the plugin API.
...
Replace doc_array with documents_array, a pointer array. This is
necessary to avoid breaking the ABI every time a field is added to
GeanyDocument.
Remove deprecated pluginmacros.h documents macro, to avoid a
conflict.
Replace doc_list[] macro with documents[] macro, which returns a
GeanyDocument pointer.
git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@2624 ea778897-0a13-0410-b9d1-a72fbfd435f5
2008-05-29 17:00:54 +00:00
Nick Treleaven
398efbd373
Note: this commit breaks the plugin API.
...
Split widget fields out of GeanyApp into GeanyMainWidgets, so other
data items can be added without breaking the plugin ABI.
Add GeanyData::main_widgets, and macro.
Rename treeview_notebook sidebar_notebook in GeanyMainWidgets.
Move tools_menu from GeanyData to GeanyMainWidgets.
Move statusbar out of GeanyApp (shouldn't be used directly).
Move ignore_callback out of GeanyApp.
Rename sci_goto_line() argument unfold, like sci_goto_pos().
Make utils_goto_file_pos(), utils_goto_line(),
utils_switch_document() into static functions (they are UI-related,
so shouldn't be in utils.c).
Move utils_goto_pos() to editor.c, add mark argument.
git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@2609 ea778897-0a13-0410-b9d1-a72fbfd435f5
2008-05-22 14:41:28 +00:00
Nick Treleaven
3a12da9daf
Note: this commit breaks the plugin API (but is necessary so that in
...
future the ABI can stay stable when adding preferences).
Split up prefs into interface_prefs, toolbar_prefs, file_prefs,
search_prefs, tool_prefs, template_prefs, and add these to the
plugin API.
Move suppress_search_dialogs and search_use_current_word to
search_prefs, and rename accordingly.
Rename switch_msgwin_pages pref to switch_to_status.
Remove toolbar_ prefix for toolbar_prefs items.
Remove tool_ prefix for tool_prefs items.
Remove template_ prefix for template_prefs items.
Add Geany prefix for EditorPrefs.
Add Geany prefix for SearchPrefs.
Initialize search_prefs to zero in main.c.
git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@2591 ea778897-0a13-0410-b9d1-a72fbfd435f5
2008-05-16 12:08:39 +00:00
Enrico Tröger
beb68832b3
Move several editing related functions from document.c to editor.c.
...
Fix two compiler warnings about non-literal format strings.
git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@2588 ea778897-0a13-0410-b9d1-a72fbfd435f5
2008-05-15 13:43:29 +00:00