4638 Commits

Author SHA1 Message Date
Colomban Wendling
42a9603f4a Use TMTagType everywhere to hold tag types 2014-10-31 20:07:27 +01:00
Jiří Techet
bdee1336aa Keep a separate list of typenames for Scintilla syntax highlighting
Manage the list the same way as workspace tags_array by the fast tag removal
and merge. Thanks to this, typename tags don't have to be extracted from
tags_array periodically, which speeds up editing.
2014-10-30 22:08:17 +01:00
Jiří Techet
be131b00f9 Extend dedup() and merge() to unref the duplicate tag when needed 2014-10-30 22:08:17 +01:00
Jiří Techet
15c90b63c9 Get rid of lazy initialization in TM
Lazy initializing various member pointers doesn't bring any real performance
improvement but it requires lots of additional NULL checks - get rid of
this.

Make some more cleanups on the way.

In addition, remove success/failure return values from tm_workspace_add_source_file()
and tm_workspace_remove_source_file() which have no real use.
2014-10-30 22:08:17 +01:00
Jiří Techet
43b8ab8d23 Only keep the minimal set of parameter in the TM API calls
Avoid "utility" parameters like do_free for which we already have API calls
and which actually don't perform any free if the source file isn't
in TM. Clarify when to set the update_workspace parameter.
2014-10-30 22:08:17 +01:00
Jiří Techet
0285ec28a5 Move tm_source_file_update() to tm_workspace.c
The placement of this function in tm_source_file is not right - by moving
it to the workspace we can make the source file unaware of the existence
of the workspace (no inclusion of tm_workspace.h in tm_source_file any
more). Also change tm_source_file_new() so it doesn't offer the source file
update.

After this change
* TMWorkspace knows TMSourceFile and TMTag
* TMSourceFile knows TMTag
* TMTag knows TMSourceFile
2014-10-30 22:08:17 +01:00
Jiří Techet
62332e19aa Since lang is now always part of TMTag, always set its value
This makes it less confusing for code accessing TMTag so it can always
find the language in tag->lang and there is no need to access it through
tag->file.lang.
2014-10-18 21:40:11 +02:00
Jiří Techet
54a9fd83ea Get rid of the nested members in TMTag
The only real change is the removal of struct and union in TMTag, the
rest is purely mechanical removal of "atts.entry." everywhere.
2014-10-18 21:40:11 +02:00
Jiří Techet
48725e4188 Get rid of the file struct in TMTag, preparation for the union removal
The union on TMTag is very confusing and rather dangerous. The fields
file/timestamp and line/lang overlap. Some implicit assumptions are made
in the code - timestamp is never set so when file is NULL, the file
struct should be used to get the lang member. Rather avoid using unions
and move the lang member to the entry struct together with the other
attributes.
2014-10-18 21:40:10 +02:00
Jiří Techet
8c25ff871c Make tm_workspace_update() public 2014-10-18 21:40:10 +02:00
Jiří Techet
26587454b0 Remove TmWorkObject and all the OO related stuff
In addition, rename all functions, parameters, comments etc. mentioning
work_object and remove unnecessary parameters of various functions.
Delete dead code paths.

Also move common functions like tm_get_real_path() from tm_work_object to
tm_source_file.
2014-10-18 21:40:10 +02:00
Colomban Wendling
d42837f021 Merge pull request #351 from techee/guards
Protect private definitions by the GEANY_PRIVATE macro in headers
2014-10-18 18:13:45 +02:00
Colomban Wendling
608ab0f60c Document the fact utils_spawn_sync() accepts NULL for all output arguments 2014-10-14 23:23:13 +02:00
Jiří Techet
6d6dd7444b Fix doxygen warnings
Make documents_array public and accessible by doxygen and describe all
parameters of tm_source_file_new().
2014-10-12 23:33:51 +02:00
Colomban Wendling
f5230f334e Fix moving editor tabs through keybindings 2014-10-12 18:00:12 +02:00
Enrico Tröger
3966ba8c4b Query GdkWindow reference only if available
On startup, the Geany main window doesn't have a GdkWindow yet
(probably because it is not yet mapped). This causes many
'gdkdrawable-win32.c:2013 drawable is not a pixmap or window'
warnings when resolving shortcuts on Windows.
Since we pass the SLR_NO_UI to the Windows API, we probably
don't need the parent hWnd reference at all.
2014-10-12 16:35:46 +02:00
Colomban Wendling
75ab7103f1 Merge pull request #353 from b4n/tm-no-update-on-quit
Don't rebuild TagManager workspace tags when quitting
2014-10-12 16:02:40 +02:00
Nick Treleaven
2d59f110df Merge pull request #350 from ntrel/reload-prompt
Don't prompt for reload from infobar when there are no unsaved changes
2014-10-12 13:27:00 +01:00
Colomban Wendling
eb7fd066b1 Don't alter GeanyEditor internal state in editor_create_widget()
When editor_create_widget() is used on an editor with already existing
widget, don't reset the internal indentation settings of that editor.
2014-10-11 14:53:21 +02:00
Matthew Brush
41c66e0eb0 Change "replace_and_find_by_default" default to true 2014-10-10 18:40:54 -07:00
Matthew Brush
bae420a768 Merge branch 'rpalli/replace1'
Closes #189
2014-10-10 18:02:29 -07:00
Colomban Wendling
f1da4b9914 Don't rebuild TagManager workspace tags when quitting
Updating the workspace is useless as the application will be shut down,
and not doing it can save a lot of time (almost 50% speedup quitting an
instance with all Geany source from `src/` open).
2014-10-11 01:40:10 +02:00
Nick Treleaven
ab7a0018b2 Don't prompt for reload from infobar when there are no unsaved changes
Also warn about losing undo history when there are no changes.
2014-10-10 16:59:43 +01:00
Roland Pallai
9b2ccb9965 Turn "replace and find by default" boolean pref into a "various" preference. 2014-10-10 00:04:38 +02:00
Jiří Techet
10a28b4191 Protect private definitions by the GEANY_PRIVATE macro in headers
In addition, this patch defines the GEANY_PRIVATE macro for the tag
manager library where it wasn't defined before, removes 2 tag manager
headers from distribution as they are not needed by plugins and
in the tag manager changes the docstrings to ordinary comments for
private definitions.
2014-10-09 20:51:32 +02:00
Enrico Tröger
63266a1254 Remove unused variable 2014-10-06 17:28:10 +02:00
Colomban Wendling
b1b9e6d19a Fix configuration directory location on non-Windows
3e089e4c2c914a4b8885daa65e784a227bd2d6b0 accidentally switched from
`g_get_user_config_dir()` to `g_get_user_data_dir()` as the location
for the user's configuration directory.
2014-10-06 16:24:26 +02:00
Nick Treleaven
e69bbe25fd Merge pull request #342 from ntrel/save-disk-check
Force disk check before save to prevent accidental overwriting
2014-10-06 12:20:54 +01:00
Nick Treleaven
fa20ec4ffb Merge pull request #343 from ntrel/more-project-prefs
Add project prefs for line breaking column & multiline comment completion
2014-10-06 12:20:15 +01:00
Enrico Tröger
3e089e4c2c Reading the config directory from the Windows API instead of GLib
Before we used g_get_user_config_dir() but GLib changed the returned
location in newer versions, so use the Windows API directly
to get the old location, at least for now.
Also add utils_get_user_config_dir() wrapper.

Code is based almost completely on a patch from Matthew.
2014-10-05 12:55:33 +02:00
Nick Treleaven
7a8c091af0 Reformat g_signal_connect calls 2014-10-03 17:42:23 +01:00
Nick Treleaven
e566aae6b2 Add project prefs for line breaking column & multiline comments 2014-10-03 12:25:05 +01:00
Nick Treleaven
541cb8dbcc Force disk check before save to prevent accidental overwriting
Useful e.g. with Save All when the modified file is not the current tab.
2014-09-30 17:10:53 +01:00
Colomban Wendling
5df59cefcb Fix build with GLib 2.20
Don't use `g_regex_get_compile_flags()` that is new in 2.26, but we
only depend on 2.20.

Closes #340.
2014-09-30 16:31:44 +02:00
Nick Treleaven
bbf63d131a Fixups
Fix adding stash group and applying defaults.
Don't let Properties dialog override per-document line wrapping state.
Use "editor" for key group name.
Remove code already handled by stash group.
2014-09-29 16:12:57 +01:00
Tim Tassonis
cb2aebcfd9 Enable per-project line wrapping 2014-09-29 16:12:55 +01:00
Nick Treleaven
2b98487a70 Merge pull request #335 from ntrel/save-cleanup
Notify user when trying to save read-only document
2014-09-26 11:45:27 +01:00
Nick Treleaven
3ab6579091 Notify user when trying to save read-only document 2014-09-26 11:44:07 +01:00
Nick Treleaven
4ceb9fb1f2 Add comment about throwing away read-only for renamed documents 2014-09-26 11:44:05 +01:00
Colomban Wendling
d7aa4b5916 Update for new Scintilla styles 2014-09-26 00:23:37 +02:00
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