6082 Commits

Author SHA1 Message Date
Colomban Wendling
319a6355fe Use GSlice to allocate cached tree iters 2011-11-21 03:52:51 +01:00
Colomban Wendling
ef0b059917 Rewrite symbols tree updating code
Old implementation was not really fitting the updating needs and had a
bug making symbols disappear if they haven't changed but their parent
did (e.g. when a C++ constructor's signature changed).

New implementation does:
1) walk old tree, updating or removing rows;
2) add remaining tags.

It walks less than (new_tags + old_tags + new_tags) in the worst case,
thanks to some hash table-based caching;  and also gets rid of the
"valid" column in the symbols tree, saving a few bytes in memory.

Finally, there is a ~7% performance gain (from 21 to 18ms) upon common
tree updates, sometimes more.
2011-11-21 03:52:42 +01:00
Enrico Tröger
39606dd17c Add Close menu item to the notebook tab menu
This is especially useful if tab close buttons are disabled.
2011-11-20 16:10:02 +01:00
Enrico Tröger
cfa334de74 Fix using the current document on 'Close Other Documents' from the GtkNotebook tab menu
Instead we should use that tab which is under mouse cursor where the user clicked (this might be a
different one than the current document). To be able to do so, we need to handle the right-click signal
per tab not on the GtkNotebook tab area to identify the tab under the mouse cursor.
2011-11-20 16:05:39 +01:00
Enrico Tröger
7aa9160b5f Mention new openro command 2011-11-20 14:48:05 +01:00
Enrico Tröger
a62d99a5f2 Add --read-only option to the manpage 2011-11-20 14:46:30 +01:00
Enrico Tröger
22ba6de142 Remove set but unused variable dwStatus (closes #3440276). 2011-11-20 13:39:20 +01:00
Enrico Tröger
917ce32ccc Prefix header guards with GEANY_ for consistency 2011-11-20 13:31:56 +01:00
Enrico Tröger
7edcb7978f Remove double underscores around header guards (closes #3440258)
While this is a violation of the C standard in theory, it should not affect anything.
Anyway, removing the double underscores makes the header guard scheme more
consistent with the rest of Geany header files so it's still a good thing.
2011-11-20 13:31:07 +01:00
Colomban Wendling
f994427319 Fix walking a tree branch twice when removing the last leaf
When removing the last leaf of a symbols tree branch, make sure not
to start walking parent's children again.
2011-11-18 21:35:24 +01:00
Nick Treleaven
03152902a9 Mention 'Go to tag' commands can use the current selection
Cleanup 'Go to tag' sections and keybinding descriptions.
2011-11-17 16:15:38 +00:00
Nick Treleaven
9ae71ab6cc Add default keybindings for Go to Tag, remove Transpose default
This does not affect existing users.

Ctrl-T          Go to tag definition
Ctrl-Shift-T    Go to tag declaration

A default keybinding for 'Transpose current line' is no longer
necessary as it does the same as 'Move line(s) up', which we now have
a default for.
2011-11-17 15:58:27 +00:00
Nick Treleaven
82769a046c Set Move Line(s) default keybindings, change Move Tab defaults
This does not affect existing users.

Ctrl-Shift-PageUp   Move document left
Ctrl-Shift-PageDown Move document right

The above shortcuts were aliases for selecting left/rightmost
documents, but those are not necessary as Alt-1/Alt-0 does the same.

Alt-PageUp      Move line(s) up
Alt-PageDown    Move line(s) down

Alt is easier to press than Ctrl-Shift, so is better for moving lines
as this needs more accuracy.
2011-11-17 15:49:09 +00:00
Thomas Martitz
8f280ed884 New --read-only commandline option
This adds a new commandline option --read-only (or -r). It's implemented
according to the behavior agreed on on the mailing list:

--read-only applies to all files on the command line
irrespective of positioning and has no effect on any other files
opened by session or menu (...)

Current behaviour on attempting to re-open a file with different
read-only status is that nothing happens, the already open
file is raised but not changed. (...)
2011-11-17 16:41:51 +01:00
Colomban Wendling
80d5e07c6c Revert granting an unexpected check to an assertion
It actually happens, and until fixing this properly, don't output
useless useless scary warnings.  Anyway, this is not a big problem
or anything.
2011-11-17 03:57:15 +01:00
Colomban Wendling
59eb0557b6 Add a configurable prefix for commands sent to the shell in the VTE
This adds an hidden VTE preference, send_cmd_prefix, that allows to
define a prefix for the commands Geany sends to the shell in the VTE
like "cd" when following current path.

This can be used for example to prevent some shells (Bash, ZSH, maybe
others) from putting these commands in the history by setting this to
a space.
2011-11-17 03:57:14 +01:00
Nick Treleaven
5b41e177de Explain Windows paths for data and plugins 2011-11-16 17:27:33 +00:00
Nick Treleaven
70b3cae060 Verify active plugin paths on startup
Geany saves the path for each active plugin on shutdown, but the 3
valid plugin paths can each change.
2011-11-16 17:27:32 +00:00
Nick Treleaven
58729d4de9 Use foo.o instead of foo.dll.o to enable Make Object (Windows build) 2011-11-16 17:27:31 +00:00
Colomban Wendling
048e6a6c3c Fix an assertion logic 2011-11-15 20:32:36 +01:00
Colomban Wendling
c73ee49758 Fix a few things, most of them reported by clang's static analyzer 2011-11-15 19:40:29 +01:00
Nick Treleaven
172825390a Deprecate setptr in favour of SETPTR
SETPTR makes it clear that a macro is being used in code.
Restore setptr without do/while in case of use without semi-colon.
2011-11-15 16:13:46 +00:00
Nick Treleaven
a97c3597eb Add default shortcuts for Find Usage, Forward/Back, Make Object
Note: This doesn't affect existing user shortcuts.

Ctrl-Shift-D    Find Document Usage
Ctrl-Shift-E    Find [Session] Usage (one letter after doc usage and
                close on the keyboard)

These are standard shortcuts for browsers:
Alt-Right   Forward
Alt-Left    Back

This matches the build/make symmetry for compile (F8):
Shift-F8    Make Object
2011-11-15 13:50:29 +00:00
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