225 Commits

Author SHA1 Message Date
Colomban Wendling
491a45f614 Improve symbols_get_current_function() a lot and make it more flexible
Finding the current function now better handles the case the current
line is after a function but outside its scope, and many other issues
the scope reporting had.
2012-09-17 22:50:32 +02:00
Colomban Wendling
9d2dab8fcf Fix an off-by-one issue in sci_get_position_from_line()
Scintilla counts lines from 0 but TagManager from 1, so convert them.
2012-09-17 20:22:52 +02:00
Colomban Wendling
afb1eaaa01 Remove improper caching of the current function
The code assumed that if both old and new fold levels were above the
minimal function fold level the function couldn't have been changed,
which is wrong if a function can appear both inside and outside another
fold level (e.g. inside or outside a class).
2012-09-17 14:44:33 +02:00
Colomban Wendling
adbd162c7b Also consider tags up to date if realtime parsing is active
This makes symbols_get_current_function() more accurate by using TM
data even on a modified file if realtime tag parsing is enabled, thus
if the data has reasonable chances to be correct.
2012-09-17 14:44:33 +02:00
Colomban Wendling
49dafc8536 Use namespaces icon for Ruby modules
It's not perfect but better than nothing since other tags have icons.
2012-09-06 20:43:49 +02:00
Miguel Sánchez de León Peque
e469aa27e0 Update VHDL parser to display blocks in the symbols list 2012-09-02 19:42:25 +02:00
Colomban Wendling
d80bc7ce56 Update FSF address
Closes #3557875.
2012-08-24 19:25:57 +02:00
Matthew Brush
e62bec43fc Use g_build_filename() instead of g_strconcat() for paths 2012-08-09 18:21:43 -07:00
Colomban Wendling
1c2c455b1d Update copyright information 2012-06-18 01:15:04 +02:00
Colomban Wendling
13a7fb521e Don't sort tags file list since the order doesn't matter 2012-05-31 21:58:14 +02:00
Colomban Wendling
6f62a55370 g_slist_prepend() is faster than _append() and the order doesn't matter 2012-05-31 21:58:08 +02:00
Nick Treleaven
3f7b888b32 Avoid unnecessary hash table for global tag filenames 2012-04-26 13:18:05 +01:00
Nick Treleaven
c17d128bcd Add current dir to include path for tag preprocessing 2012-04-24 17:19:40 +01:00
Nick Treleaven
3275d510d8 Remove unportable pipe-to-grep tag generation hack
Instead always ignore G_BEGIN_DECLS and G_END_DECLS tags.
2012-04-23 16:58:55 +01:00
Nick Treleaven
d2d4f0b623 Enforce filetype extension for user tag files 2012-04-23 13:44:22 +01:00
Lex Trotman
4bd962ee8d Remove hard coded option that prevents 64 bit tag generation.
On GNU X86-64 systems the predefined macros are required
to choose the correct headers, so tag definition fails with
-undef.  Removed it from hardcoded, systems that need it can
add it to CFLAGS.
2012-04-22 10:54:41 +10:00
Colomban Wendling
7b8add4019 Better handling of duplicated tags in the sidebar 2012-03-24 01:19:20 +01:00
Nick Treleaven
9426104f0b Remove utils_build_path() - use g_build_filename instead 2012-02-06 16:41:18 +00:00
Nick Treleaven
b287553e4a Use 'SETPTR' instead of 'setptr'
This makes it clearer we're using a macro.
2012-01-25 16:26:16 +00:00
Nick Treleaven
5b02efb6f8 Separate interfaces and structs in the symbol list 2012-01-06 13:39:26 +00:00
Nick Treleaven
308f98a2b9 Use gssize to avoid casts for encodings_convert_to_utf8_*() 2012-01-03 13:30:38 +00:00
Colomban Wendling
0aea05d10d Fix various integer signedness and minor styling issues
Most noteworthy change is that all build commands IDs and groups are
now unsigned everywhere negative values aren't explicitly handled with
a special meaning.  This should not change anything in behavior, only
makes clear the index won't underflow.
2011-12-18 00:32:22 +01:00
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
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
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
c73ee49758 Fix a few things, most of them reported by clang's static analyzer 2011-11-15 19:40:29 +01:00
Colomban Wendling
3f31453ace Fix various integer sign and size issues 2011-11-06 01:12:42 +01:00
Colomban Wendling
274e01f555 Fix various coding style issues 2011-10-30 22:55:25 +01:00
Matthew Brush
bd5fba7eb5 Remove extra whitespace at end of lines in all source files.
* Processed with rstrip-whitespace.py script added to scripts/ directory.
* Script run on all .c and .h files in src/ and plugins/ directories.
* Also remove more than one newline at the end of files.
2011-10-11 21:52:58 -07:00
Colomban Wendling
d06e9f4575 Remove $Id$ and $Date$ SVN keywords 2011-10-09 22:57:35 +02:00
Colomban Wendling
92c95ad06b Fix a few warnings
git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@5949 ea778897-0a13-0410-b9d1-a72fbfd435f5
2011-09-22 18:04:03 +00:00
Colomban Wendling
aace32fb69 Fix updating symbol list for overloaded C++ symbols
When searching for an old entry to reuse when updating an existing
symbol list, take into account the symbol's argument list not to
always match the same entry for overloaded symbols.

Closes #3406644.

git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@5910 ea778897-0a13-0410-b9d1-a72fbfd435f5
2011-09-12 16:58:31 +00:00
Colomban Wendling
9d2975b8fa Fix generating global tags (geany -g) when the configdir doesn't exist
When creating temporary files for generating global tag files, use
the system directory for temporary files rather than the configuration
directory, so it works even if the configuration directory doesn't
already exist.

git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@5890 ea778897-0a13-0410-b9d1-a72fbfd435f5
2011-08-19 00:07:41 +00:00
Colomban Wendling
ddb4ad5fa5 Fix some whitespace style errors
git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@5886 ea778897-0a13-0410-b9d1-a72fbfd435f5
2011-08-06 18:34:14 +00:00
Colomban Wendling
6380810550 Remove treeview-related pre GTK 2.12 support
git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@5848 ea778897-0a13-0410-b9d1-a72fbfd435f5
2011-06-13 23:03:19 +00:00
Nick Treleaven
8a817e694b Make utils_build_path() return a copy for safety.
git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@5721 ea778897-0a13-0410-b9d1-a72fbfd435f5
2011-04-13 12:59:20 +00:00
Enrico Tröger
6dd81cb341 Fix mapping of SQL tags for Geany's symbol list (closes #3216474).
git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@5704 ea778897-0a13-0410-b9d1-a72fbfd435f5
2011-04-10 14:52:57 +00:00
Nick Treleaven
e6a7d02fbe Fix sign warning in tag_hash().
git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@5589 ea778897-0a13-0410-b9d1-a72fbfd435f5
2011-03-14 17:37:44 +00:00
Colomban Wendling
8e79a2255a Prefer prepend elements to lists rather than append them
This is for better performances since appending to a list means walking
it to find the last element to append to. When the list ordering
matters, simply reverse the list after prepengins.

git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@5586 ea778897-0a13-0410-b9d1-a72fbfd435f5
2011-03-10 22:27:04 +00:00
Colomban Wendling
3ebfcceafe When sorting tags by line, also sort by scope if line is the same
This avoids wrong sorting, and then wrong display in the symbols list,
if a parent tag is on the same line than its children, and one of it's 
children would be sorted before alphabetically (closes #3193982).


git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@5580 ea778897-0a13-0410-b9d1-a72fbfd435f5
2011-03-06 17:25:15 +00:00
Colomban Wendling
6f7a06780f Improve performances of symbol list updating
Rather than walking the whole tree for each tag to find a possibly
corresponding row, use a hash table as cache.
This is a very significant improvement on large files with many tags,
reducing for example to about 170ms an update that took more than 18s
before.

Also fix merging of tags with same name and scope (probably unlikely to
exist in real-world files, but the tagmanager extract them correctly
and they used to display correctly too).


git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@5567 ea778897-0a13-0410-b9d1-a72fbfd435f5
2011-03-05 22:56:55 +00:00
Colomban Wendling
57d00f48d0 Update the symbol list rather than clearing and re-building it
The main advantages of not clearing and rebuilding the whole list is
that it doesn't loose the folding and selection (as far as the selected
row(s) still exist after the update, of course), and it reduces
flickering upon update.

The current implementation works in 3-steps:
1) mark all rows as invalid;
2) insert/update the rows, according to the new tag list, marking them
   as valid;
3) remove all rows that are still invalid.
This walks (rows) the first time, (tags*rows) the second and (rows) the
third. This also uses an extra column to store the row's validity.

A (probably) better implementation would be to:
1) walk the current rows, updating them if necessary, or removing them;
2) add the remaining tags that weren't there before.
This is probably faster in theory (and probably also in practice), but
it needs to refactor a lot the code to easily update *or* create a row,
what the current code does not provide.
Basically this is would be a two-pass update, walking (rows*tags) in
the first pass, and only the remaining non-added tags in the second.


git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@5562 ea778897-0a13-0410-b9d1-a72fbfd435f5
2011-03-05 22:53:13 +00:00
Colomban Wendling
f120554364 Provide a GType for TMTag and use it
It is a boxed type but uses reference counting behind the scene. This
allow for example the tag store to make sure the tags it holds are
always valid.


git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@5560 ea778897-0a13-0410-b9d1-a72fbfd435f5
2011-03-05 22:50:04 +00:00
Colomban Wendling
88aa81b6a8 Improve implementation of hide_empty_rows() to do all in one shot
git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@5558 ea778897-0a13-0410-b9d1-a72fbfd435f5
2011-03-05 22:47:13 +00:00
Enrico Tröger
ec408fa4b9 Add filetype Cobol (based on a patch by Seth Keiper).
git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@5533 ea778897-0a13-0410-b9d1-a72fbfd435f5
2011-01-30 15:03:51 +00:00
Enrico Tröger
6ac2623208 Update copyright information.
git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@5528 ea778897-0a13-0410-b9d1-a72fbfd435f5
2011-01-19 19:39:09 +00:00
Nick Treleaven
c61a189c00 If the current word's tag is on the current line, make Go to Tag
Definition look for a tag declaration instead, as this is more
useful. Likewise make Go to Tag Declaration search for a tag
definition in this case also.



git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@5428 ea778897-0a13-0410-b9d1-a72fbfd435f5
2010-11-23 13:17:42 +00:00
Nick Treleaven
f346f985df Add filetypes_get_display_name() to get translations for filetype
None.



git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@5366 ea778897-0a13-0410-b9d1-a72fbfd435f5
2010-11-04 18:06:09 +00:00
Nick Treleaven
568f1853d2 Remove unnecessary uses of FILETYPE_ID() macro with
GeanyDocument::file_type.



git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@5323 ea778897-0a13-0410-b9d1-a72fbfd435f5
2010-10-25 17:24:47 +00:00