4638 Commits

Author SHA1 Message Date
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
Nick Treleaven
d4acd1e061 *View->Change Font* should respect native dialog setting (Windows, #1059) 2014-08-02 16:29:08 +02:00
Nick Treleaven
e1988964c1 Fix Windows build 2014-08-01 12:05:30 +01:00
Nick Treleaven
01b3103eaf Remove unread variable 2014-08-01 11:54:05 +01:00
Colomban Wendling
b65f49902f Fix closing the documents when quitting
When quitting we avoid doing some unnecessary actions, and used to
simply destroy the Scintilla widget (and thus the notebook page)
instead of the elaborate UI updates.

Unfortunately, when the infobars landed they changed what is packed as
a notebook page, and now destroying the Scintilla widget alone is not
enough to close the page.  Fix this by properly removing the whole page
no matter what it contains.

This issue was visible when quitting Geany with a project open.
2014-07-26 15:03:49 +02:00
Colomban Wendling
0682a25585 Fix crash when quitting with an infobar visible
When the infobar gets closed/destroyed it tries to focus the possibly
destroyed document, leading to a crash.
2014-07-26 13:36:19 +02:00
Colomban Wendling
a87655480f Merge most of PR#298 2014-07-11 18:06:59 +02:00
Colomban Wendling
487b8aea0b Custom commands dialog: Make sure the selected item is always visible
Always bring back the selected item after an user action, so the user
can see what she's doing.
2014-07-06 00:06:16 +02:00
Colomban Wendling
47e9e6c000 Ask whether to overwrite the project file when creating a new project 2014-07-04 17:54:07 +02:00
Colomban Wendling
7f7f66978b Add tooltips to explain the purpose of the New Project dialog fields 2014-07-04 17:53:24 +02:00
Colomban Wendling
11b50493fc Use ui_button_new_with_image() to build image buttons 2014-07-04 17:50:37 +02:00