Hi!
I saw this code in src/symbols.c at line 1917:
while (sci_get_style_at(sci, start) != fn_style
&& start < max_pos) start++;
If start >= max_pos then sci_get_style_at will be called (with out of
bounds value?) and then the loop will bail out.
I suggest that the condition is reordered as:
while (start < max_pos
&& sci_get_style_at(sci, start) != fn_style)
start++;
Then sci_get_style_at will only be called if start is less than max_pos.
It is just my humble suggestion.
Best regards,
Daniel
Hello,
Attached a little patch concerning the file saving dialog.
I may have missed some use cases, but it works on all cases mentioned in
the commit message.
The main point is about the âRenameâ, the unsaved file one (last commit
message line) is a bonus.
Cheers,
--
Quentin "Sardem FF7" Glidic
Hi,
I'm sending my stack of patches against geany again, this time as individual patches. Here's the full list:
[PATCH 01/19] Prevent -Wmissing-prototypes report warning when compiling a plugin
[PATCH 02/19] Add signals for project options dialog opening and closing
[PATCH 03/19] Make the project menu accessible by plugins
[PATCH 04/19] Make it possible to change project patterns by plugins
[PATCH 05/19] Don't be annoying when not necessary
[PATCH 06/19] Make it possible for plugins to change the base directory of msgwindow
[PATCH 07/19] Open the file in the msgwindow even if no linenumber is specified
[PATCH 08/19] When closing tab, return to the document at the top of the MRU list
[PATCH 09/19] Use wider entry for project file path
[PATCH 10/19] New utils function to get relative path from one directory to another
[PATCH 11/19] File name in the project settings dialog shouldn't look it is editable
[PATCH 12/19] Use relative paths in the project files
[PATCH 13/19] Remove the "set" button from the project properties dialog
[PATCH 14/19] Rewrite tab switching queue
[PATCH 15/19] Do not insert --include= when the search pattern entry is empty
[PATCH 16/19] Use project patterns in the FIF dialog
[PATCH 17/19] Make the tab switching dialog a bit more useful
[PATCH 18/19] Use standard include paths for "open selected file"
[PATCH 19/19] Use per document indent sizes
Only some of them are required by gproject - others are just suggestions for improvements. I didn't explicitly distinguish between these two types of patches but it should be pretty clear from the description. There have been some minor changes since my last post - mainly the change of the FIF dialog to contain combo box for pattern selection and there are also some new patches - the detailed description is in the individual emails. Of course many of the patches are suggestions only so further discussion is welcome.
Cheers,
Jiri
Hello all,
I'm interested in beginning to contribute to Geany. I'm a freshman CS
major and I often find myself with way too much free time and needing
something productive to do. As I've enjoyed using Geany, its something I'd
like to get involved in. However, open source (and projects in general
written by more than 2 people) is new to me, so I'll probably take it slow
for a while. Any advice is greatly appreciated.
Thanks,
Jacob
Dear Geany Devs,
I recently switched from GeanyPRJ to Gproject. Since Gproject doesn't
support multiple open projects I have to switch between projects, but
it takes up to 4 minutes to close one project and open another. A
project consists of roughly 1000-2000 php-related files.
The "Generate tags for all project files" causes this massive delay,
but I really need that feature.
At work I have a 2-core CPU, where 1 is completely idle and on my
desktop at home there are 5 cores are doing nothing while generating
tags. Can't they be utilized to speed up the tag generation?
Cheers!
Harold
Hello,
I noticed a global misuse / misunderstanding of the Autotools (mostly
about the dist mechanism) among the geany-plugins.
Attached a patch to correct the Autotools build system. I can split this
commit into several ones if needed (one for each plugin plus some more
global ones). I just need a bit of time to do so (fortunately, git helps
a lot).
Cheers
--
Quentin "Sardem FF7" Glidic
Le 17/04/2012 18:20, Nick Treleaven a écrit :
> Hi,
> How's it going?
Hi,
Sorry for the long delays -- and also small activity -- recently. I
have/had a lot of non-Geany stuff to do and stuff, the whole story, you
know.
> Lex mentioned in this mail:
> http://lists.uvena.de/pipermail/geany/2012-April/007991.html
>
> that (according to him) you are working to 'replace it'. Maybe he's
> exaggerating, but this sounds interesting. If you have time could you
> maybe send me a link to the IRC log, or better, explain a little about
> the work on the devel list?
That's true, I have a WIP on writing a new ctags management code. It is
far from being ready for production, and I'm not even sure the ideas in
it are really appropriate. But yes, there is a something :)
I finally committed it and pushed it so you can see it, comment, blame,
flame & more: see https://github.com/b4n/geany/tree/wip%2Fctagsmanager
A few points, as they comes to my mind:
* it is under the new ctagsmanager/ directory;
* it uses the same tag parsers tagmanager used, in ctagsmanager/ctags;
* it support asynchronous parsing (though not concurrent parsing);
* all types have different names than the tagmanager ones, though
currently the API is almost an 1:1 mapping -- and that's maybe a
huge mistake?;
* there is 2 backends as of today:
- a "simple" one that is simple and that doesn't waste (too much)
memory, but that searches in O(n);
- a "multi-cache" one that, as its name suggests, maintains multiple
caches (sorted tags arrays). it uses a little more memory and is
slower on insertion since it maintains several sorted lists, but a
search on an already existing cache is very fast.
In practice I haven't yet tested anything big enough to see any
difference in performances between these two backends, and that's
something that probably isn't worth bothering about for now.
* this "backend" abstraction might be really overkill, and maybe we
could do better without it?;
* tags (and most types) are reference-counted (so they aren't
necessarily duplicated, e.g. in the multicache backend);
* tag matching/finding is done using ctm_data_backend_find() (or a
convenience wrapper), which takes 2 functions for performing the
search:
- a sort function, used to, heh, sort the tags to search and/or the
resulting list (the "simple" backend should use it to sort the
result; and the "multi-cache" backend uses it to sort the caches)
- a match function, use to check whether a tag should be included in
the results. Like the sort function it returns a strcmp()-like
value, with the only difference that it probably returns 0 for more
tags.
It is somewhat similar to what tagmanager did, but it's more flexible
-- and maybe complex, though many sort/match functions would already
be provided.
* no pruning is done yet, so there is duplicate in the results;
* there is an (almost) working scope completeion implementation;
* ... I don't see anything to add, so I'll stop here :)
All this isn't of course written in stone: if we already redo a lot of
things, let's get something nice -- though IMO we'll always be better
than with tagmanager, since each time I wanted to touch it it took me
hours, and sometimes I even haven't been able to fix the problem
(thinking of e.g. scope completion...).
> Also, later in the thread he says that performance problems with
> resorting global and workspace tags cannot be fixed with the design of
> tagmanager. I've been working yesterday on improving this significantly
> by merging the new tags each time instead of resorting *all* the tags. I
> hope to commit this in the next few days.
Cool! I haven't done any profiling on either tagmanager or may new
attempt, so I can't tell what's actually slow, but any improvement is
good to have :)
Regards,
Colomban
Hi all!
http://pastebin.geany.org/jdRsm/
The linked patch implement 'multicursor' mode in editor.c and give the
ability to insert text at different positions at the same time, similar to
rectangular selections but at random (user selected) places.
It works like this:
Ctrl+Alt+Click add a new 'multicursor' at click position, without actually
moving the caret, you can add as many as you want. Now you are in
multicursors mode, every inserted char is inserted also in all the other
positions.
To end the mode just move the caret with the arrow keys.
I implemented this in editor.c (and not as an external plugin) because I
have plans to also extend the snippets to support multi editing.
Actually the patch is really simple but is just a first test, it is not
ready as there are 3 open issue:
1. do you like the feature? :)
2. atm the multimode end when you press up/down/left/right....i don't like
it too much, some other idea?
3. is there a way to really show multiple carets? in the patch i'm using
the search indicator to highlight the other cursors, but it really should
be something like a caret, not an indicator. suggestions welcome
note: this is my first geany patch... plese be kind :P
davemds
---
dave(a)gurumeditation.it - www.gurumeditation.it
Geany Newsletter #5
-------------------
1 About Geany
2 New translations and updates
3 Wiki available
4 C++ plugins supported
5 Plugins
5.1 New Plugins
5.1.1 GeanyPyflakes
5.1.2 GeniusPaste
5.2 GeanyPG
6 Geany local
7 Geany Packages for Fedora
8 About this newsletter
1 About Geany
=============
Geany is a small and lightweight Integrated Development Environment.
It was developed to provide a small and fast IDE, which has only a
few dependencies from other packages. Another goal was to be as
independent as possible from a special Desktop Environment like KDE
or GNOME - Geany only requires the GTK2 runtime libraries.
More information about Geany can be found at
`geany.org <http://www.geany.org/>`_.
2 New translations and updates
==============================
Since our last newsletter a number of translations has been updated
or newly added to Geany. New translations are:
* Arabian
* Indonesian
* Lithuanian
* Mongolian (back in 2011)
But also translations like German, Kazakh, Hungarian, Italian,
Traditional Chinese and Swedish translations have been updated
during the last roughly four month.
3 Wiki available
================
We set up a wiki for additional documentation and resources related
to Geany at http://wiki.geany.org. Anyone can contribute to the wiki
simply by registering and then logging in.
In the wiki you can find configuration snippets and tips, snippets for
various programming languages and many additional tags files to enhance
Geany's autocompletion features.
Everybody is welcome to add additional useful content to the wiki.
4 C++ plugins supported
=======================
Geany's public plugin API headers have been updated to support
inclusion into C++ code. Most of the changes involve adding `extern
"C" {...}` blocks around the public headers' code (by way of GLIB's
`G_BEGIN_DECLS` and `G_END_DECLS` macros) to make them easier to
include, so the C++ code doesn't need to do this.
You can now write plugins in C++ and they will be loadable by Geany
at run-time. Of course using Geany's API will still involve using C
in your code, but the rest of your plugin can use whatever C++
features you want. You can even use gtkmm [1] in your plugin if you
want.
Any of the symbols Geany looks up at run-time must not have their
names mangled by the compiler. To avoid this, put that code inside
an `extern "C"` block.
Here's an example of Geany's Hello World plugin from the Plugin
HowTo [2] ported to C++::
#include <geanyplugin.h>
class HelloWorld
{
private:
gchar *hello_message;
GtkWidget *main_menu_item;
public:
HelloWorld(const gchar *message);
~HelloWorld();
void SayHelloWorld();
};
static HelloWorld *hello;
extern "C"
{
GeanyPlugin *geany_plugin;
GeanyData *geany_data;
GeanyFunctions *geany_functions;
PLUGIN_VERSION_CHECK(211)
PLUGIN_SET_INFO("HelloWorld C++",
"Just another tool to say hello world, this time in C++",
"1.0", "John Doe <john.doe(a)example.org>");
void plugin_init(GeanyData *data)
{
hello = new HelloWorld("Hello C++ World");
}
void plugin_cleanup(void)
{
delete hello;
}
static void on_menu_item_clicked(GtkMenuItem *item, gpointer user_data)
{
hello->SayHelloWorld();
}
}
HelloWorld::HelloWorld(const gchar *message)
{
hello_message = g_strdup(message);
main_menu_item = gtk_menu_item_new_with_mnemonic("Hello World");
gtk_widget_show(main_menu_item);
gtk_container_add(GTK_CONTAINER(geany->main_widgets->tools_menu), main_menu_item);
g_signal_connect(main_menu_item, "activate", G_CALLBACK(on_menu_item_clicked), NULL);
}
HelloWorld::~HelloWorld()
{
g_free(hello_message);
gtk_widget_destroy(main_menu_item);
}
void HelloWorld::SayHelloWorld()
{
dialogs_show_msgbox(GTK_MESSAGE_INFO, "%s", hello_message);
}
It's important to note that the dynamic library loading mechanism
that loads plugins is C functionality and does not know about C++
constructors. This means that global and static objects in the
plugin will *not* have their constructors called when the plugin is
loaded. Use dynamically created objects as show in the above example.
These changes will be available in the next Geany release but you
can start using them right away in your C++ plugins if you Build
Geany From Git [3].
1. http://developer.gnome.org/gtkmm-tutorial/2.24/sec-basics-gobj-and-wrap.htm…
2. http://www.geany.org/manual/reference/howto.html
3. http://www.geany.org/Download/Git
5 Plugins
=========
Notes from the plugin section.
5.1 New Plugins
***************
5.1.1 GeanyPyflakes
###################
Pyflakes is a command line tool that statically analyzes python
program and detects two kinds of errors: unused imports and
undefined symbols. geany-pyflakes runs pyflakes in the background
and parses its output. Afterwards puts markers on lines with errors
and adds the output to the panel at the bottom of editor (the one
with console, todo, etc.). Geany-pyflakes is available at its project
pages at http://code.google.com/p/geany-pyflakes/
Another way to check your Python code is described inside the wiki at
http://wiki.geany.org/howtos/check_python_code
5.1.2 GeniusPaste
#################
GeniusPaste is a plugin which is adding the possibility to paste
your code from Geany into different pastebins. It supports this
services:
* codepad.org
* pastebin.com
* pastebin.geany.org
* dpaste.de
* sprunge.us
During the paste process GeniusPaste detects automatically the
syntax of your code and paste it with syntax highlighting enabled.
Once this is done it is also able to redirect you to the pasted code
opening a new browser tab.
5.2 GeanyPG
***********
GeanyPG is a plugin that allows the user to encrypt, decrypt text
and verify signatures with GnuPG from inside Geany. It's created by
Hans Alves and is part of the geany-plugins project.
After the plugin has been installed successfully, it can be loaded
from inside Geany's plugin manager which will add a new menu item
into the Tools menu offering functions of the plugin.
To decrypt or encrypt, just select the interesting parts and choose
the function you wish -- If none text has been selected, the whole
document will be processed. In case you like to verify a signature
obviously you will have to select the whole block.
When encrypting a message you can choose to sign at the same time.
If a passphrase is needed, the GPGME library will decide how the
user is prompted. Usually this will use gpg-agent. If gpg-agent is
disabled, pinentry with one of its frontends will be used.
6 Geany local
=============
6.1 Geany at Chemnitzer Linuxtage 2012 (March 17th, 18th)
*********************************************************
As last year, Geany had a booth a Chemnitzer Linuxtage 2012 in
German city Chemnitz. Our booth was again located next to the guys
of Xfce as well as next (that was different to last year) to 2
lecture rooms. Even though the event wasn't as much crowded as last
year, a lot of people were passing by asking some question or just
saying hello. So Enrico and Frank had a lot of questions to answer
and a lot of feedback to respond to.
7 Geany Packages for Fedora
===========================
There are new packages unofficially available for Fedora. One is
containing the Geany Themes Matthew maintains at GitHub [1], the
other one provides the tags files listed in the Geany Wiki [2]. The
packages are not yet in Fedoras official repositories but available
at Dominic's Fedora People space [3]. Note the geany-themes package
is intended to work with current Git versions of Geany only. A
x86_64 package from the current Git master as well as an SRPM for
rebuilding is also available at [3].
The geany-tags package is split into subpackages containing the tags
for each programming language. Currently these are: geany-tags-c,
geany-tags-php and geany-tags-python. They can be installed
independently from each other, of course.
Contact Dominic if you have suggestions for improvements.
1. https://github.com/codebrainz/geany-themes
2. http://wiki.geany.org/tags/start
3. http://dmaphy.fedorapeople.org/
8 About this newsletter
=======================
This newsletter has been created in cooperation by people from Geany's
international community. Contributors to this newsletter and the
infrastructure behind it, ordered by alphabet:
Dominic Hopf
Enrico Tröger
Frank Lanitz
Lex Trotman
Matthew Brush
[posted to both devel and user lists, sorry to those on both]
Hi All,
Geany currently hard codes two actions to the <ctrl>-<left mouse down>
input, "goto tag" if the click is over an identifier or "goto matching
brace" otherwise.
This blocks the standard action of "add to selection" on <ctrl>-<left
click> and <ctrl>-<left drag>. (See Gnome HIG
http://developer.gnome.org/hig-book/2.32/hig-book.html#input-mouse
10.1.2)
I did a quick check on my system and didn't find any application that
did not comply with that guideline, so Geany is the odd one out.
Geany has not supported multiple selections so it hasn't been an issue
(other than being non-standard and occasionally confusing users), but
as there is a proposal to add support for multiple selections to Geany
this non-standard behavior is now a problem.
As both actions now have a default keybinding (in Git version) I
propose that the binding to <ctrl>-<left mouse down> simply be
removed.
Cheers
Lex