Fix the symbols tree hierarchy by considering the whole scope when
adding a tag, avoiding choosing the wrong parent when several tags have
the same name. Until now, to avoid such misbehavior we only used to
choose the parent candidate that appeared last (line-wise) before the
child. It works in most typical situations as generally tag names are
fairly unique, and children appear right after their parent.
However, there are cases that are trickier and cannot be handled that
way. In the following valid C++ snippet, it is impossible to know
whether `function` should be listed under the namespace `A` or the
class `A` without looking at its full scope:
```C++
namespace A {
namespace B {
class A {
void method() {}
};
};
void function() {}
};
```
And it is a real-world problem for some parsers like the JSON parser
that generates numeric indices for array elements name, often leading
to several possibly close duplicates.
Additionally, to prevent trying to set a tag as its own parent, the
code guarded against accepting a parent if the child had the same name,
lading to incorrect hierarchy for `method` in cases like this:
```C++
namespace A {
class A {
void method() {}
};
};
```
So to fix this, consider the whole hierarchy of a tag for choosing its
parent, when that information is available from the parser.
Fixes#1583.
This will allow the compiler to notify any callers that it's deprecated.
The macro is guarded-out for when Geany is compiling so it won't cause
warnings when tagmanager uses it internally and for the utils_ wrapper.
Now that a new enough GLib is available the signal can be
handled cleanly on the main loop using the GSource for Unix signals.
This replaces the illegal SIGTERM handling that was disabled in
fbb89f523af47b35e238678d348cfa98e56c760a.
Closes#1255
This behavior might be unwanted when changing project settings which
is unrelated to project base path and also fixes filebrowser behavior
with the updated way project-save signal is emitted.
The patch also handles the situation where "realized" is called after
project-save is called and overrides file browser's path (which is
something we don't want).
For some reason "project-save" isn't emitted when closing project - see
write_config(FALSE) in project_close(). This means that in this case
plugins cannot save their configuration into the config file. This doesn't
even correspond to the documentation of the signal
"Sent when a project is saved (happens when the project is created, the
properties dialog is closed or Geany is exited)"
as the signal isn't emitted when exiting Geany because at this point Geany
closes the project.
The comment seems to indicate that the reason is that "project-save"
shouldn't be emitted when "project-close" is emitted but I don't see any
reason why.
Bump API so plugins can rely on the changed behavior.
Increment one time for both, and fix the corresponding doc comments.
The comment for keybindings_load_keyfile() is reflowed to split into
brief/detail sections properly.
This indicates that TMTag is GBoxed-derived, and can be copied/ref'd.
This helps plugins that must store a tag pointer for later usage while the
tagmanager might let it go in the meantime (can happen quickly if the user
comments a function out when starting a doxygen-comment).
Closes#1465
Since filedef config files are now stored under the "filedef" subdirectory
of app->datadir, we need to add the subdirectory name when creating path
from the corresponding app->configdir otherwise the file isn't found.
Closes#1482
* Add missing string and comment styles for various lexers
A bunch of string and comment styles were missing and so Geany could not
detect the corresponding styles in code.
* Add more string styles
* Add regex styles as string styles
Do not allow more than one plugin manager dialog at a time. It doesn't
make sense and the code is not fully re-entrant and leads to a crash
toggling plugins in both dialogs.
Fixes#1563.
The variable used for setting the cursor isn't used anymore and
was used uninitialized. It's simply deleted now and the correct var is used.
This was only a problem if editor_insert_text_block() was used directly,
the snippet code path doesn't reach to it.
* Update Scintilla to version 3.7.5
This now requires a C++11-capable compiler.
Closes#1308.
* Test using newer dist on Travis
Since Scintilla needs C++11
* Add debugging code for when configure fails
* Workaround a pkg-config-corsswrapper bug on Ubuntu 14.04
See https://bugs.launchpad.net/ubuntu/+source/mingw-w64/+bug/1327242
* snippets: Allow keybinding overloading of snippet-next-cursor.
This allows to use the same key as for inserting snippets, or plugins to
map something to the same keybinding (e.g. if they implement a similar facility).
* snippets: Remove cursor position at the end of constructs.
This is not consistently done for all languages, and hard to get right
e.g. for python. It's probably not terribly useful either.
* snippets: Use Scintilla indicators for cursor posititons
* api: Increment API version.
* snippets: restore behavior of cursor-less snippets
* snippts: use ascii character for the placeholder.
Do not require documents to be UTF-8 for using snippets.
* snippets: fix start/end detection, when searching for the next cursor
Tested @vfaronov
When option is enabled geany automatically reloads files which
have changed on disk but have no changes in the buffer.
When the option is disabled (default) geany shows the reload
dialog as before.
Tested @vfaronov