5822 Commits

Author SHA1 Message Date
Nick Treleaven
736c398467 Fix setptr to work in an 'if' clause & improve documentation
Use do {...} while (0) instead of {...}.
Document the order of events and purpose of setptr properly.
2011-11-15 13:50:28 +00:00
Colomban Wendling
2e56a84b2a Fix highlightingmappings documentation not to reference a removed macro 2011-11-14 19:54:28 +01:00
Nick Treleaven
cca258ddb7 Workaround gcc function address comparison warning
E.g.
highlighting.c:950:3: error: the address of
'highlighting_styles_ADA' will always evaluate as 'true'

Note: This commit also contains some trailing whitespace removal.
2011-11-14 18:40:20 +00:00
Colomban Wendling
1436bd6ee2 Quote C89 draft rather than C99 one 2011-11-14 17:09:38 +01:00
Lex Trotman
a625955a43 Provide error message for extract regex
Print the GError message if the users filetype extract regex does
not compile.
2011-11-14 11:37:32 +11:00
Colomban Wendling
cb72e1d85f Fix possible crashers in filetypes_detect_from_file_internal()
* Never try to do a regex match on a NULL string;
* Don't try to unref a possibly NULL regex.
2011-11-13 20:39:39 +01:00
Enrico Tröger
70f41f6485 Merge branch 'master' of github.com:geany/geany 2011-11-13 17:35:29 +01:00
Matthew Brush
6cee28d677 Get rid of warning in on_file_notify()
Works around the issue discussed in commit 1e54fb6 by using the file
chooser's property accessor function.
Rename on_file_notify() to better explain its purpose.
2011-11-13 07:45:23 -08:00
Enrico Tröger
639e88add0 Display the plugin's description in the list of plugins instead of the plugin's filename
In the dialog, the plugin's description is more interesting and useful than the full filename.
Instead, show the filename in the bottom box for those interested in.
2011-11-13 13:32:05 +01:00
Enrico Tröger
ed1c5060e1 Rename Search and Goto text fields action names
This should avoid confusion in the toolbar customize dialog to not have
two identical named items.
2011-11-13 13:24:47 +01:00
Matthew Brush
d789c4d546 Queue colourise of the Scintilla widget after (re)setting type keywords 2011-11-12 18:15:28 -08:00
Colomban Wendling
8942bc810b Add Objective-C support
Based on a patch from Elias Pschernig, thanks.
Parser was taken from upstream CTags.

Closes patch#3325139.
2011-11-13 01:05:24 +01:00
Colomban Wendling
e53d5b8299 Merge branch 'highlighting-rewrite' 2011-11-12 19:21:36 +01:00
Colomban Wendling
a00366b266 Update HACKING for highlighting setup refactoring 2011-11-12 02:07:36 +01:00
Matthew Brush
9bffb94cc4 Real-time type keyword highlighting
* Add new function: document_update_tags().
* Refactor the various tag update functions into document_update_tags().
* Remove extra call to update the tags in document_new_file().
2011-11-11 16:08:26 -08:00
Colomban Wendling
d8d6f2908e Remove an unnecessary macro indirection 2011-11-11 20:02:59 +01:00
Colomban Wendling
8bf9a7cb0c Add Matthew Brush as developer 2011-11-11 16:41:52 +01:00
Frank Lanitz
f70dcf038a Update of Mongolian translation 2011-11-10 19:23:22 +01:00
Colomban Wendling
511d5276a3 Merge apply_filetype_properties() into styleset_from_mapping() 2011-11-10 15:40:30 +01:00
Colomban Wendling
cc63453a97 Remove now unused old init_styleset_case() and rename new one 2011-11-10 15:35:03 +01:00
Colomban Wendling
b96d22374a Make HTML filetype the "primary" one XML and PHP inherits from
XML used to be the one holding the actual definitions, but the HTML
filetype is actually superset of XML (XML filetypes had definitions
for non-XML things), and most definitions names referenced HTML rather
than XML.

So, move the actual definitions from filetypes.xml to filetypes.html
and make XML and PHP inherit from HTML.
2011-11-09 22:59:56 +01:00
Colomban Wendling
ad1bc032ab Port XML, HTML and PHP filetypes to new automated setup
This changes these three filetypes to "normal" ones rather than HTML
and PHP being hard-coded together with XML.  Now the definitions
simply references each other and the filetypes.* files simply inherits
styling and keywords from the appropriate filetype.

This also makes these filetypes have their own Python styles like they
had their own JavaScript ones, rather than trickily reference the
Python ones.
2011-11-09 22:50:26 +01:00
Colomban Wendling
55edeb876d Fix a DocBook style mapping 2011-11-09 17:32:21 +01:00
Colomban Wendling
21e0c037da Port DocBook filetype to new automated setup 2011-11-09 17:14:48 +01:00
Colomban Wendling
69769e0edc Add support for EOLFILLED style flag 2011-11-09 17:14:05 +01:00
Colomban Wendling
493b5284f7 Remove some unnecessary initializers
Leave some initialization to the implicit C initialization rules to
have less unnecessary items in initializer lists
2011-11-09 16:58:45 +01:00
Lex Trotman
f67ed6b636 Fix potential NULL dereference
Found by codebrainz using clang static analyser.
2011-11-09 19:08:27 +11:00
Colomban Wendling
80eeb484c6 Remove lexer argument from STYLESET_FROM_MAPPING() 2011-11-08 23:33:47 +01:00
Colomban Wendling
1a91e53586 Rewrite two functions for better readability 2011-11-08 23:30:34 +01:00
Colomban Wendling
ab2663e9ae Refactor highlighting setup 2011-11-08 22:50:53 +01:00
Frank Lanitz
ba0e6353af Update of Mongolian translation 2011-11-08 17:17:23 +01:00
Matthew Brush
c9cd6c096c Set a parent GtkWindow on build command label edit input dialogs
This prevents losing the label edit input dialog below the build command
dialog which can be confusing since it prevents the build command dialog
from accepting input even though it's on-top of the (potentially hidden)
label edit input dialog.
2011-11-07 00:23:57 -08:00
Matthew Brush
c9a32bfdc9 Make use of gtk_widget_get_window() added in GTK+ 2.14 2011-11-06 18:25:48 -08:00
Enrico Tröger
28dc825e2a Update developer list in the About dialog 2011-11-06 13:53:46 +01:00
Frank Lanitz
f201434a28 Adding Mongolian translation 2011-11-06 12:36:38 +01:00
Lex Trotman
1e54fb6a01 Alter warning fix
Uninitialised GValue does not always work, but is an opaque type so
structure of initialiser isn't known.  Glib 2.30 on has G_VALUE_INIT
to use as initial value.  Fix so if not defined give it the previous literal
value { 0 }, although this leaves the warning, so it is not initialising
the GValue correctly but enough to work.
2011-11-06 20:58:32 +11:00
Lex Trotman
4d92e0530b Fix warnings
Fix warnings that appeared with GCC 4.6
js.c:1067:10: warning: variable ‘is_prototype’ set but not used
dialogs.c:173:2: warning: missing initializer
dialogs.c:173:2: warning: (near initialization for ‘value.data’)
sidebar.c:534:17: warning: unused variable ‘doc’
2011-11-06 18:10:56 +11:00
Colomban Wendling
3f31453ace Fix various integer sign and size issues 2011-11-06 01:12:42 +01:00
Colomban Wendling
19da0ce965 Fix or add a few Scintilla styles mappings
Closes #3432760.
2011-11-06 00:02:06 +01:00
Matthew Brush
c1df8a7263 Use file type instead of lexer to decide if type keywords are supported
Not every filetype for a specific lexer implements type keywords even if the
lexer supports it.
2011-11-04 19:23:55 -07:00
Colomban Wendling
b55a30c2bf Build recent data for GTK ourselves
This prevents GTK of trying to fetch the necessary information like
MIME-type itself, which leads to a significant speedup (> 30%), as
well as using the real MIME-type we use rather than the GIO-guessed
one.
2011-11-04 00:11:21 +01:00
Colomban Wendling
0167f589b3 Small code cleanup
Use foreach_document() in a few places where appropriate and make
some code more consistent.
2011-11-03 19:22:40 +01:00
Nick Treleaven
c39390aae8 Fix using American spelling of color 2011-11-03 18:16:13 +00:00
Nick Treleaven
822240d17f Add Style example for structs, doc-comments 2011-11-03 17:38:55 +00:00
Nick Treleaven
efcce8808e Add note not to use G_LIKELY or G_UNLIKELY (except in critical loops)
These add noise to the code with little real benefit.
2011-11-03 17:38:54 +00:00
Matthew Brush
ff663c1678 Remove init_doc_struct() function from documents.c
This function was only used from document_create() and most of this code is
not needed since the memset() and g_new0() calls set the memory to all 0's,
which in this case should suffice to (re)set all the members to 0/NULL/FALSE.

Refactor so all the resetting to defaults code is done in remove_page()
only and then only do the required non-FALSE/NULL initialization in
document_create().

Move the remove_page() prototype to the top of the file and various other
minor changes in remove_page().
2011-11-02 23:24:10 -07:00
Matthew Brush
ea51c487d3 Use Scintilla's buffer directly for parsing tags 2011-11-02 21:50:34 -07:00
Matthew Brush
6ceb5ac164 Remove editor_lexer_get_type_keyword_idx() function
It was used only in one place in document_update_type_keywords() which
already did a similar check using the file type before calling this function.

Update HACKING file and very minor cleanup of other code in
document_update_type_keywords().
2011-11-02 20:18:12 -07:00
Nick Treleaven
de559ef5d4 Make document_save_file() show the Save As dialog when necessary
Previously an error message was shown if doc->file_name is NULL.

The Save As dialog is now shown if the document does not have an
absolute path. This is because the user should confirm where to save
the document in this case.

Although this changes plugin API behaviour, it seems the best way to
ensure the Save As dialog is always shown when needed so the user
knows where the document has been saved.
2011-11-02 15:17:17 +00:00
Nick Treleaven
f1b9c58612 Fix auto-saving documents when the current document has no filename 2011-11-02 15:10:50 +00:00