7499 Commits

Author SHA1 Message Date
Colomban Wendling
299f624f65 Autotools: Fix checking for Git revision
Fix check when building out of tree, and properly handle errors.
2014-11-11 19:01:58 +01:00
Colomban Wendling
c40263709f Merge branch 'css-update' 2014-11-11 18:38:42 +01:00
Colomban Wendling
f765463af0 Import new CSS parser from fishman-ctags
Some highlights:
* Fixes handling of comments
* Adds support for attribute and namespace selectors
* Adds support for @supports blocks
* Fixes tag type for many selectors
* Adds support for pseudo-classes with arguments
2014-11-11 02:01:41 +01:00
Colomban Wendling
2072797283 Import CSS test cases from fishman-ctags 2014-11-11 01:59:12 +01:00
Colomban Wendling
67cc8faf4b Fix closing of the "missing file" infobar
The issue was introduced in b646424ddb715382a937d233a75bc684c22e18ec as
it removed the default handler that used to destroy the infobar.

Now, the infobar is properly closed, but only if the action succeeded.

Closes #375.
2014-11-09 22:14:12 +01:00
Colomban Wendling
1dc09597b2 Fix check for fnmatch and remove strict dependency on it for Windows
Strict dependency on fnmatch was removed in 52076d19e8fe7ab41ebc92928e.

We still have an optional dependency on it from CTags, but I don't
think we use this code, and anyways the checks we had for the optional
path to be taken were incorrect, so it was never actually used.

So, drop the dependency on libibrety for Windows builds, and fix the
remaining checks for an optional fnmatch so if it is found it can
actually be used.
2014-11-09 17:40:03 +01:00
Enrico Tröger
fea71a282f Allow MRU file list length to be set to 0 to disable it
Since the rest of the code is already prepared for it, setting mru_length
to 0 just disables the recent files menu.
2014-11-09 11:22:16 +01:00
Colomban Wendling
aa06427c71 Merge branch 'plugin-symbols-protoypes' 2014-11-09 00:19:14 +01:00
Colomban Wendling
8c77accfd0 Merge PR#356 from 'b4n/techee/tm'
Huge TagManager improvements
2014-11-08 19:37:20 +01:00
Colomban Wendling
ba8ff712b0 Merge pull request #374 from kugel-/for-upstream
project: Remove unecessary calls after loading project files
2014-11-08 19:04:20 +01:00
Colomban Wendling
fd4f31cc07 Bump Geany API and ABI for TagManager API changes 2014-11-08 18:34:15 +01:00
Colomban Wendling
6a0673f4ae TM: Don't allow passing NULL to tm_workspace API 2014-11-08 18:32:41 +01:00
Colomban Wendling
0ed236db30 TM: Fix some test results after sort changes from 90944c77 2014-11-08 18:13:13 +01:00
Colomban Wendling
b38f1f99d5 TM: Use gsize everywhere for the memory buffer size 2014-11-08 18:13:13 +01:00
Thomas Martitz
53101dd5fa project: Remove unecessary calls after loading project files
document_new_file_if_non_open() and ui_focus_current_document() only make sense
when files where actually opened, but the preceeding
configuration_load_session_files() only loads the file names into the global
session_files variable, from which the files are actually opened by a later
call to configuration_open_files(). These two calls should be done after that
one and the callers generally do this already.
2014-11-08 17:59:05 +01:00
Frank Lanitz
202ecf8bcb Merge pull request #372 from cousteaulecommandant/patch-1
"Execute commands" -> "Comandos de ejecución"
2014-11-07 16:31:23 +01:00
cousteaulecommandant
e67f63dd0b "Execute commands" -> "Comandos de ejecución"
"Execute commands" (from the Set Build Commands dialog) is translated to Spanish as if it were a sentence (like "Execute these commands"), but it's actually a name ("<language> commands", "Independent commands", and "Execute commands"; so it means "Commands for 'execute'").  Therefore, +"Comandos de ejecución" is a better translation than -"Ejecutar comandos".
2014-11-07 12:48:04 +01:00
Jiří Techet
f441a121d3 Parse file from buffer only if the file isn't too big
By loading e.g. a huge DB dump into memory we could run out of memory.
Check the size of the file and determine whether to use file parsing
or buffer parsing.

Give up early if LANG_IGNORE set - there's no need to read the file in
this case.
2014-11-06 11:39:40 +01:00
Jiří Techet
0ad85aee04 Fix comment wording 2014-11-05 21:50:07 +01:00
Jiří Techet
a95fc1a994 Don't expose the source file update function to plugins 2014-11-05 21:50:07 +01:00
Jiří Techet
90944c77b0 Unify tag sorting and simplify tag comparison function
Use the same (or compatible) sorting criteria everywhere.

Add tm_tag_attr_line_t to sort options so even after merging file tags
into workspace tags, the same tags defined at different lines are preserved
and not removed as duplicates.

Sort type before scope because it's cheaper to compare (string vs int comparison).

For some reason, the above changes make the sorting performance worse.
Simplify the tag comparison function a bit and reorder the case statements
in the switch to match the sort order. This (again not sure why), makes the
performance like before.
2014-11-05 21:50:07 +01:00
Jiří Techet
29000cf104 Always parse buffer instead of file
This brings the linux kernel parsing time from about 20s to 12s on my machine.
2014-11-05 21:50:07 +01:00
Jiří Techet
448f1fd20e Make sure gboolean tm_source_file_parse() returns the right value
Previously, after finishing the while loop TRUE was returned - this is
wrong because the while was running because parsing was unsuccessful.
Make it work the same way as in ctags (parser() always succeeds,
parser2() returns whether to retry or not).

(The return value actually isn't used, it's just to make sure we know
what we are doing.)
2014-11-05 21:50:07 +01:00
Jiří Techet
f35d0b9c0c Move tm_get_current_tag() from tm_workspace to tm_tag
This function has nothing to do with the workspace so it rather belongs
to tm_tag.
2014-11-02 11:40:05 +01:00
Jiří Techet
71cc1ecb20 Cleaner and safer TMWorkspace API
With the previous TMWorkspace API it was possible to make the workspace
inconsistent by e.g. removing source files and forgetting to update
workspace. This could lead to non-obvious and not immediately visible
crashes.

The new set of the public (but also Geany private) API calls always
updates the workspace accordingly and neither of the calls can lead
to an inconsistent state of the workspace.

In addition, perform some minor cleanups and simplifications - unify
parsing from buffer and from file, support "parsing" of 0-sized buffers
and improve documentation.
2014-11-02 11:39:57 +01:00
Colomban Wendling
48718f4b79 Remove an unused parameter 2014-10-31 20:25:59 +01:00
Colomban Wendling
013c47c6e3 TM: Fix various integer signedness issues 2014-10-31 20:25:13 +01:00
Colomban Wendling
61ee7de86e Return an unisgned tag count in tm_tags_find()
There is no reason to return a signed value an it help unifying
caller's types.
2014-10-31 20:20:25 +01:00
Colomban Wendling
42a9603f4a Use TMTagType everywhere to hold tag types 2014-10-31 20:07:27 +01:00
Nick Treleaven
4e5ed012f2 Recommend Glade 3.8.5, add link for fishman ctags fork 2014-10-31 17:26:24 +00:00
Jiří Techet
d7ed48f86b Fix a problem in tm_tags_remove_file_tags() when more tags of the same name exist 2014-10-31 02:03:13 +01:00
Jiří Techet
cb9e4bbf74 Microoptimization in merge
Improves performance by about 10%.
2014-10-30 22:08:17 +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
32a3dfab7f Use binary search when removing file tags
Even though the binary search requires expensive string comparisons,
there are just log(n) of them to find the tag in the workspace array
and the result is much faster than scanning the array linearly (this
of course works only under the condition that

len(source_file->tags_array) << len(workspace_array)

This is however satisfied for big projects (and doesn't matter for small
projects).

Also make the tm_tags_find() function more user friendly by returning
tagCount 0 when no tags found.
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
6ba3bb46a4 Don't pass arguments to search/sort functions using static variables
Instead of qsort() it's possible to use g_ptr_array_sort_with_data() with
similar performance. Unfortunately it seems there's no bsearch_with_data()
anywhere so the patch uses a modified bsearch() implementation from libc
(still probably cleaner than passing arguments using static variables).
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
Nick Treleaven
cfcbc6a205 Make Next/Previous Message keybindings work without a document open 2014-10-30 16:34:00 +00:00
Colomban Wendling
4546b6f7a6 Merge pull request #363 from techee/prj_dialog
Always set project description and file patterns in the dialog
2014-10-27 21:19:57 +01:00
Jiří Techet
41dcde623d Always set project description and file patterns in the dialog
Set them also when they are NULL in the project (which happens when new
project is created) because otherwise there are left-over values from
the previous project.
2014-10-27 20:58:59 +01:00
Colomban Wendling
fc5d8d145a Merge pull request #362 from ntrel/fb-cmd
Make File Browser use explorer as default open command on Windows
2014-10-27 19:24:09 +01:00
Enrico Tröger
a7a893a22f Set -O2 compiler flag by default for gcc
But only if no other optimization flags could be found.
2014-10-26 23:44:19 +01:00
Nick Treleaven
36c155cbe8 Make File Browser use explorer as default open command on Windows 2014-10-26 15:06:16 +00:00
Jiří Techet
a183d9cb97 Move the refcount TMTag member up in the structure and don't document it for plugins 2014-10-22 16:58:38 +02:00
Jiří Techet
11866938cc Remove unused return value 2014-10-22 16:23:07 +02:00
Jiří Techet
6ef41c65a9 Various cleanups in the merge algorithm
Remove the continue statement and use if/else instead. Initialize the
val1 variable only with the value used for the chosen path (normal/fast).
2014-10-22 16:14:59 +02:00
Jiří Techet
9a2a55a252 Reinclude tm_tag.h in tm_workspace.c
To make Colomban happy.
2014-10-22 16:04:06 +02:00
Jiří Techet
d8b178e4cb Whitespace changes 2014-10-22 15:59:36 +02:00