360 Commits

Author SHA1 Message Date
Nick Treleaven
5f32d93886 Fix GLib warning when pressing Close File keybinding and no
documents are open.


git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@3167 ea778897-0a13-0410-b9d1-a72fbfd435f5
2008-11-03 17:38:50 +00:00
Enrico Tröger
0324ed71f6 Add *_full variants of editor indicator functions to the plugin API for more control over indicators.
Add/Update some API docs.
Make the 'Mark' button for Find highlight the results with rounded boxes instead of marking the whole line.

git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@3155 ea778897-0a13-0410-b9d1-a72fbfd435f5
2008-10-25 18:57:00 +00:00
Enrico Tröger
15efd65343 Fix updating of the value of the toolbar Goto line spinbutton.
git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@3154 ea778897-0a13-0410-b9d1-a72fbfd435f5
2008-10-25 18:56:38 +00:00
Enrico Tröger
d3ee6f48ca Add toolbar buttons for Cut, Copy, Paste and Delete (#2161750).
git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@3147 ea778897-0a13-0410-b9d1-a72fbfd435f5
2008-10-23 20:55:55 +00:00
Enrico Tröger
c946d4ef91 Replace Goto line text entry field in the toolbar with a spin button.
Remove dialogs_show_goto_line(), use the more generic dialogs_show_input_numeric() instead.
Increase limit of the maximum line number from 99999 to 100000000.

git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@3146 ea778897-0a13-0410-b9d1-a72fbfd435f5
2008-10-23 20:55:06 +00:00
Nick Treleaven
65768ef184 Show the tools menu separator if there are any items below it.
git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@3094 ea778897-0a13-0410-b9d1-a72fbfd435f5
2008-10-15 11:59:32 +00:00
Enrico Tröger
83d6c2e8e2 Fix using direct Scintilla access in document.c and callbacks.
Add wrapper functions instead.

git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@3000 ea778897-0a13-0410-b9d1-a72fbfd435f5
2008-09-25 18:29:53 +00:00
Enrico Tröger
a032d6a660 Unify the API in editor.c, all public functions now take a GeanyEditor* object.
git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@2998 ea778897-0a13-0410-b9d1-a72fbfd435f5
2008-09-25 18:28:37 +00:00
Enrico Tröger
ab3c9a4f3d API changes:
Rename sci_can_copy() into sci_has_selection().
Rename sci_find_bracematch() into sci_find_matching_brace().

git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@2964 ea778897-0a13-0410-b9d1-a72fbfd435f5
2008-09-17 18:02:55 +00:00
Nick Treleaven
a01abd937d Cancel autocompletion on Undo/Redo (based on a patch by Jason Oster,
thanks; #2102715).


git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@2957 ea778897-0a13-0410-b9d1-a72fbfd435f5
2008-09-17 12:12:49 +00:00
Enrico Tröger
9290e0bf65 Add '-' (dash) to the wordchars when using 'open selected filename'.
Please open a bug report if this will break any filenames.

git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@2926 ea778897-0a13-0410-b9d1-a72fbfd435f5
2008-09-08 14:25:00 +00:00
Enrico Tröger
ab7a522ca9 Rename all toolbar widgets for consistent names.
git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@2924 ea778897-0a13-0410-b9d1-a72fbfd435f5
2008-09-08 14:22:39 +00:00
Nick Treleaven
137325eb18 Don't disable 'Detect from file' indent type pref when 'Tabs and
Spaces' is selected.


git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@2898 ea778897-0a13-0410-b9d1-a72fbfd435f5
2008-08-19 11:20:09 +00:00
Enrico Tröger
459ba625ed Move geany_debug() into log.c.
Use GLib log/print handlers to log messages/warnings into a string for later usage.
Add a debug messages window, accessible through the help menu to easily view debug messages/warnings.
This might replace the extra console window on Windows.

git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@2876 ea778897-0a13-0410-b9d1-a72fbfd435f5
2008-08-11 18:16:35 +00:00
Nick Treleaven
309b853b57 Merge changes from the custom-tab-width branch (closes #1662173).
Thanks to Joerg Desch for explaining how it needs to work.
Note: this breaks the plugin API for indentation editor_prefs.
Add separate Width indent pref (as well as the Tab Width pref).
Add 'Tabs & Spaces' Indent Type radio option pref.
Add 'Tabs and Spaces' Document menu indent option.
Note: Tabs & Spaces cannot be detected (yet) when opening files;
default file templates still only use tabs.
Set 'Detect from file' indent type setting insensitive when Tabs &
Spaces is set.
Don't change per-document auto-indent setting after changing default
auto-indentation type.
- API changes:
Add GeanyIndentPrefs struct from some GeanyEditorPrefs fields.
Replace GeanyIndentPrefs::use_tabs with GeanyIndentType field 'type'.
Add editor_get_indent_prefs() to the API, which should be used to
get the right settings for a document/editor instead of reading
any struct fields. This could also support project/filetype
indentation prefs quite easily.
- Core code changes:
Move toggle_prefs to a function toggle_items_foreach(), which takes
a PREF_DISPLAY or PREF_UPDATE argument. This means the PrefEntry
array can contain runtime fields, so can read pointer contents.
Add pref_item_callbacks array of functions to call;
toggle_items_foreach(), spin_items_foreach(), radio_items_foreach(),
combo_items_foreach().
Update keyfile.c to use foreach-style functions for SettingEntry
arrays, like the new PrefEntry code in prefs.c.
Add get_indent_size_after_line() to replace get_indent() for
clarity, and to fix Tabs & Spaces auto-indentation > basic.
Remove opening-brace indent code from get_indent() as it's now in
get_brace_indent().
Change editor_close_block() to use sci_get_line_indentation() for
clarity.
Make editor_close_block() static.
Add editor_init().


git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@2863 ea778897-0a13-0410-b9d1-a72fbfd435f5
2008-08-07 16:36:06 +00:00
Nick Treleaven
51badbd829 Set 'Detect from file' indent type setting insensitive when Tabs &
Spaces is set.


git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/branches/custom-tab-width@2859 ea778897-0a13-0410-b9d1-a72fbfd435f5
2008-08-07 11:49:06 +00:00
Nick Treleaven
d3fbdf278b Fix build; currently auto-indentation doesn't support inserting tabs
and spaces, only spaces. Also Tabs & Spaces cannot be detected yet
when opening files. Default file templates still only use tabs.
Add editor_get_indent_prefs() which should be used to get the right
settings for a document/editor instead of reading any default prefs.
This could also support project/filetype indentation prefs quite
easily.
Don't change per-document auto-indent setting after changing default
auto-indentation type.
Remove ui_radio_menu_item_*(), not good to use as they depended on
the order of widget creation, so don't work well with Glade. Use
RadioPrefEntry array instead.


git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/branches/custom-tab-width@2853 ea778897-0a13-0410-b9d1-a72fbfd435f5
2008-08-04 14:07:49 +00:00
Enrico Tröger
bbfd7a1ee8 Revert r2843 because it messed it Ctrl-C/SIGINT in the VTE.
git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@2848 ea778897-0a13-0410-b9d1-a72fbfd435f5
2008-08-01 15:54:21 +00:00
Enrico Tröger
c98c4d099a Make Copy & Paste clipboard keybindings also work for the VTE (closes #2029675).
git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@2843 ea778897-0a13-0410-b9d1-a72fbfd435f5
2008-07-30 18:22:51 +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
3d24008b34 Add Find Document Usage popup menu command & keybinding.
git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@2786 ea778897-0a13-0410-b9d1-a72fbfd435f5
2008-07-17 16:42:03 +00:00
Nick Treleaven
7db4bfe493 Rename GeanyEditor::scintilla to GeanyEditor::sci.
git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/branches/editor-struct@2776 ea778897-0a13-0410-b9d1-a72fbfd435f5
2008-07-14 11:13:54 +00:00
Nick Treleaven
3bdd42ba4b Change plugin API EditorFuncs to use GeanyEditor pointers.
git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/branches/editor-struct@2770 ea778897-0a13-0410-b9d1-a72fbfd435f5
2008-07-11 14:49:09 +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
7c71457fb1 Fix building editor.c, using GeanyEditor* instead of GeanyDocument*
(most global editor functions still need conversion though).


git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/branches/editor-struct@2765 ea778897-0a13-0410-b9d1-a72fbfd435f5
2008-07-08 13:53:08 +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
2c5a71f054 Add function document_close().
git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@2740 ea778897-0a13-0410-b9d1-a72fbfd435f5
2008-07-01 14:20:16 +00:00
Enrico Tröger
2febc39ed5 Add Tools menu item to reload configuration data (at the moment: templates, filetype extensions/configs and snippets).
git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@2739 ea778897-0a13-0410-b9d1-a72fbfd435f5
2008-06-30 16:29:12 +00:00
Nick Treleaven
2ba80013bc Add 'Close Other Documents' File menu command (#1976724).
git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@2729 ea778897-0a13-0410-b9d1-a72fbfd435f5
2008-06-27 17:30:14 +00:00
Nick Treleaven
52985a7d5a Add Previous Message menu item.
Don't abbreviate Find Prev Selected.
Add ui_tree_view_find_previous().
Set Next Message menu item sensitivity when clicking on Search menu.
Thanks to Beau Barker (skip76) for an initial version of
ui_tree_view_find_previous() (see #1931125).


git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@2725 ea778897-0a13-0410-b9d1-a72fbfd435f5
2008-06-25 17:38:31 +00:00
Nick Treleaven
a85c71ee9b Remove document_delay_colourise(), document_colourise_all().
git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@2719 ea778897-0a13-0410-b9d1-a72fbfd435f5
2008-06-20 14:19:57 +00:00
Enrico Tröger
9e98928ed1 Add "Replace spaces by tabs".
git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@2709 ea778897-0a13-0410-b9d1-a72fbfd435f5
2008-06-19 14:34:53 +00:00
Nick Treleaven
56e77de794 Bring back GeanyDocument::is_valid field as it is clearer and more
descriptive than using doc->index != -1.
Add deprecated macros DOC_IDX_VALID and DOC_IDX in plugindata.h,
which can make porting outside plugins easier; of course, it is
better to rewrite the code to use document pointers.
Use is_valid instead of the DOC_VALID macro when iterating over
documents_array, as there are never NULL pointers in it.


git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/branches/document-pointer@2704 ea778897-0a13-0410-b9d1-a72fbfd435f5
2008-06-18 14:18:26 +00:00
Nick Treleaven
4b1e4056b8 Fix redo, reload commands.
Fix focusing editor on notebook tab click.
Minor formatting and use NZV, DOC_FILENAME macros.
Make doc_at() debug function check idx is within range.


git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/branches/document-pointer@2702 ea778897-0a13-0410-b9d1-a72fbfd435f5
2008-06-18 13:36:33 +00:00
Enrico Tröger
57b3fb52b0 Fix wrong and add missing checks.
git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/branches/document-pointer@2697 ea778897-0a13-0410-b9d1-a72fbfd435f5
2008-06-16 18:31:59 +00:00
Enrico Tröger
d03f72122a Get rid of GeanyDocument::is_valid, use the index value instead.
Remove DOC_IDX_* macros.

git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/branches/document-pointer@2693 ea778897-0a13-0410-b9d1-a72fbfd435f5
2008-06-15 15:24:44 +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
Nick Treleaven
37e0d1f3f1 Move GeanyDocument GUI elements and saved_encoding to private
Document struct which inherits from GeanyDocument. This is to hide
implementation fields from the plugin API, so that we can change
them if necessary.
Add DOCUMENT() macro to convert a GeanyDocument* to a Document*.
Also move UNDO_*, FileEncoding to documentprivate.h.
Move undo_action struct to document.c.


git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@2631 ea778897-0a13-0410-b9d1-a72fbfd435f5
2008-06-02 15:31:59 +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
Enrico Tröger
311b82ebb2 Rename document struct to GeanyDocument.
Rename filetype struct to GeanyFiletype.

git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@2594 ea778897-0a13-0410-b9d1-a72fbfd435f5
2008-05-16 14:17:54 +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
Enrico Tröger
b2cddc87a0 Move indicator functions from document.c into editor.c.
git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@2587 ea778897-0a13-0410-b9d1-a72fbfd435f5
2008-05-14 17:58:56 +00:00
Nick Treleaven
f700baa906 Rename old uses of line breaking -> line wrapping. This includes the
keyfile pref, so any users with this enabled will have to reset it.


git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@2563 ea778897-0a13-0410-b9d1-a72fbfd435f5
2008-05-09 14:17:25 +00:00
Nick Treleaven
d131023fe7 Add basic Line Breaking option in the Document menu. Line breaking
only works when typing characters past the line breaking column
number.
Add 'Line breaking column' editor pref.


git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@2562 ea778897-0a13-0410-b9d1-a72fbfd435f5
2008-05-09 12:13:29 +00:00
Nick Treleaven
3afebc701c Move Close All functions to document.c.
Add document_account_for_unsaved().


git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@2526 ea778897-0a13-0410-b9d1-a72fbfd435f5
2008-04-24 14:33:12 +00:00
Nick Treleaven
7e244e784a Fix geany_debug() warnings with Close All.
git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@2490 ea778897-0a13-0410-b9d1-a72fbfd435f5
2008-04-16 12:00:27 +00:00
Nick Treleaven
dc6e52f41c Make pressing escape in the sidebar focus the editor.
Group toolbar GtkEntry escape key checks into a common callback.


git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@2488 ea778897-0a13-0410-b9d1-a72fbfd435f5
2008-04-16 11:34:34 +00:00