4597 Commits

Author SHA1 Message Date
Colomban Wendling
187dca2957 Use named constants everywhere for msgwin/compiler internal columns 2014-09-25 17:05:55 +02:00
Nick Treleaven
9d669a72f7 API: Rename document_reload_file -> document_reload_force
New name is clearer against document_reload_prompt.
Add deprecated alias.
2014-09-25 11:45:49 +01:00
Nick Treleaven
b646424ddb Only close reload infobar if the response succeeded 2014-09-24 12:21:32 +01:00
Nick Treleaven
3830240cb8 Confirm info-bar reload when document has modifications 2014-09-24 12:21:30 +01:00
Nick Treleaven
0a80a72f0b Set status id to STATUS_DISK_CHANGED when protecting document 2014-09-24 12:08:40 +01:00
Nick Treleaven
9a02525d1c Don't set document text as changed when file on disk is newer
Setting the document text as changed makes it too easy to accidentally
overwrite the file - e.g. when closing you're reminded to save it.
It also makes it slower to close documents you no longer want open.
Setting text as changed is still done if the user cancels the warning.
2014-09-24 12:08:24 +01:00
Nick Treleaven
06e40e512f Confirm whether to save protected documents
(Reuses existing strings).
2014-09-23 14:53:08 +01:00
Nick Treleaven
7450a992b5 Use 'Overwrite' rather than Save for clarity in reload infobar 2014-09-23 14:43:49 +01:00
Thomas Martitz
a6d11cb4f8 Use custom document info bar response IDs 2014-09-23 14:43:47 +01:00
Colomban Wendling
34f7ce9cc9 Merge branch 'about-banner-fix' 2014-09-22 19:38:41 +02:00
Colomban Wendling
20c31b62ff Fix custom about dialog style overriding
Don't assume changing the style inside a style-set handler results in
recursion, as it would be wrong if the next signal emission was
triggered asynchronously.  Instead, only modify the style if it isn't
already as we want it.

This fixes the about dialog's style-set handlers on GTK 3.10 which
didn't liked constant style updating.
2014-09-22 19:32:44 +02:00
Colomban Wendling
76d6e9faa9 Revert "Fix GTK frame clock warnings with our about dialog"
This reverts commit ec7071062c5dc39d5f893a830b3c26968a579251.

Apparently the selected state of an event box doesn't necessary mean it
will be styled with a selection background color.  This e.g. isn't the
case in GTK 3.14's Adwaita (default) theme.

So, revert the commit that removed custom style overrides.  Next commit
will fix the GTK 3.10 problem this reverted commit fixed.
2014-09-22 19:29:26 +02:00
Matthew Brush
634a4b111f Highlight C types from tags in C++ code
Useful for when using, for example, GTK+, SDL, and other C-only APIs
in files with the C++ filetype. Before only the symbol auto-completion
worked, but not the highlighting of type names.

TODO: figure out why taking something like SDL.c.tags and making a copy
as SDL.cpp.tags doesn't work, once that's fixed, this extra condition
could probably be removed.
2014-09-17 16:49:58 -07:00
Enrico Tröger
d6d836c59f Don't match regexes on empty strings
Save As on an empty document would cause warnings like:
sys:1: Warning: g_regex_match_full: assertion 'string != NULL' failed
because SCI_GETRANGEPOINTER returns NULL then.
On a Ubuntu 12.04 system this warning even crashed Geany at writing the
log message.
So, simply don't search for anything if the document is empty.
2014-09-11 19:16:24 +02:00
Nick Treleaven
a733bf9b2a Merge pull request #327 from ntrel/open-file-exists
Allow user to edit open dialog filename when file doesn't exist
2014-09-01 17:01:41 +01:00
Colomban Wendling
666fdf30fa Document document_find_by_id() parameter so Doxygen is happy 2014-08-29 17:06:51 +02:00
Nick Treleaven
7047152a1f Allow user to edit open dialog filename when file doesn't exist 2014-08-29 12:23:38 +01:00
Nick Treleaven
2f6815841d Merge pull request #256 from ntrel/doc-id
Support pseudo-unique IDs for documents
2014-08-27 16:19:33 +01:00
Nick Treleaven
d62fd48b44 Merge pull request #315 from ntrel/move-session
Properly handle existing session when creating new project
2014-08-27 16:17:03 +01:00
Nick Treleaven
355f0c804e Fix GLib warning 'app->project == NULL failed'
Occurred on Project->New with an existing project when closing an
unsaved file was cancelled.
2014-08-27 16:10:59 +01:00
Nick Treleaven
5964d2e086 Properly close abandoned new project that couldn't be written
Also rewrite the default session in case it was cleared.
2014-08-27 16:10:57 +01:00
Nick Treleaven
c990cd9dca Properly handle existing session when creating new project
Ask whether to adopt the existing session documents.

Also fixes the existing bug of not reloading the default session when
an existing project is open and a new project is cancelled.
2014-08-21 16:45:15 +01:00
Nick Treleaven
18181c2e90 Support pseudo-unique IDs for documents
Add GeanyDocument::id, document_find_by_id() to plugin API.

This also fixes clicking on a Messages item whose document has been
closed and reused. Now the click will be ignored instead of jumping to
an unexpected line in the new document.
2014-08-19 15:40:05 +01:00
Nick Treleaven
ff0fde30cb Use enum for Messages list store IDs 2014-08-19 15:40:02 +01:00
elextr
a8e8e2cd9e Merge pull request #312 from elextr/reflow_fix
Make reflow paragraph leave cursor at end of reflowed text, which is more likely to be useful than where it was left at the start of the last line.
2014-08-19 18:05:38 +10:00
Colomban Wendling
dc140165ae Use GeanyFindFlags instead of plain integer when expecting Geany find flags
This makes the API more obvious on what argument is expected, and avoid
confusion between Geany and Scintilla find flags.
2014-08-19 03:42:58 +02:00
Colomban Wendling
bdc0f720e7 Remove unused flags from document_search_bar_find()
Passed-in flags was always 0, so the argument is not useful.
Also, this function expected Scintilla search flags rather than Geany
ones, making the API confusing for no good reason.
2014-08-19 03:40:52 +02:00
Colomban Wendling
8812e39e2e Fix searching backwards from the Find dialog
search_find_prev() wasn't properly updated to work on GeanyFindFlags
leading to incorrect flags handling.
2014-08-19 03:31:34 +02:00
asmblur
0a063c1a72 Fix regexp search & replace. 2014-08-18 19:06:27 -05:00
Colomban Wendling
91d0ed2183 Find in Files: start search when pressing return in all field
Patch partly from Yosef Or Boczko, thanks.  Closes #959.
2014-08-14 17:12:58 +02:00
Colomban Wendling
521778ad31 Color scheme dialog: scroll to the initially selected item 2014-08-12 20:40:21 +02:00
Colomban Wendling
df964312b2 Remove a global in colorscheme dialog code 2014-08-12 20:38:59 +02:00
Colomban Wendling
8b0990e52a Fix relative project base path when creating a new project
Closes #1062.
2014-08-12 16:42:50 +02:00
Colomban Wendling
cc1c36d009 project: Sanitize entries_modified scope 2014-08-12 16:42:46 +02:00
Colomban Wendling
87c6cefc19 Remove dead assignment
`entries_modified` global is only used by on_name_entry_changed() and
on_entries_changed(), both of which are only ever called from
project_new() scope -- which already initializes this variable.
2014-08-12 16:17:39 +02:00
Colomban Wendling
0b2b647a6d Remove an unnecessary dynamic allocation 2014-08-12 14:39:53 +02:00
Colomban Wendling
6ed6a99565 about: Don't leak global variables to the program scope 2014-08-12 14:38:48 +02:00
Colomban Wendling
36a6dd2e2c dialogs: Don't abuse GObject data 2014-08-11 16:52:26 +02:00
Colomban Wendling
571239e0bf dialogs: Remove an unnecessary function indirection
Having add_input_widgets() didn't really make the code any simpler,
rather obfuscating it a little.
2014-08-11 16:38:09 +02:00
Colomban Wendling
5fcacf066d Add user data to GeanyInputCallback, avoiding global variable hacks 2014-08-11 15:44:51 +02:00
Colomban Wendling
2559cda954 prefs: Remove some global state in keybinding-related code
Use gtk_dialog_run() to run the key input dialog, which is modal anyway.
This avoids having to pass the label and the iter around for the dialog
response callback to have them, as they now only are used directly in the
function setting them in the first place.
2014-08-10 15:47:18 +02:00
Colomban Wendling
852f326650 prefs: Pack keybinding-related globals together and avoid much direct access
This however doesn't get rid of any of the global data itself, it only pack it
in a struct and passes pointer to this struct around instead of accessing the
global whenever possible.
2014-08-10 15:46:44 +02:00
Colomban Wendling
74ef1b8344 Update for new Scintilla styles 2014-08-10 02:21:54 +02:00
Colomban Wendling
593b9dd2c9 Merge branch 'single-line-regex' 2014-08-10 01:51:48 +02:00
Colomban Wendling
673c3c36a3 Add UI elements to control single-line regex settings 2014-08-10 01:46:31 +02:00
Colomban Wendling
482d2732af Add support for single-line regular expressions 2014-08-10 01:46:16 +02:00
Colomban Wendling
a26bdd628f Fix crash when closing a document with visible infobars
Apparently the ::unrealize symbol is sent too late, after we destroyed
the widget and freed the GeanyDocument, and some signals like
::focus-in-event can still be fired on the widget after that.

So, properly use the ::destroy signal that is supposed to be fired when
others should release references to that instance.
2014-08-07 15:14:22 +02:00
elextr
ed20a4373d Make reflow paragraph leave cursor at end.
The cursor was left at the beginning of the last line, leaving
it at the end is more likely to be a useful position to continue
typing.
2014-08-06 13:15:07 +10:00
Matthew Brush
3c2d93eca4 Refactor win32 native dialog-mainloop update code
Just cleaning up last commit.
2014-08-03 04:23:19 -07:00
Matthew Brush
eb267d30cb For native win32 dialogs, pump main window loop a bit
Mostly gets rid of re-drawing issues, however is not great.
2014-08-02 20:29:02 -07:00