Re: [Github-comments] [geany/geany] Improve goto-symbols popup (#1445)

2018-12-04 Thread Thomas Martitz
Awesome, thanks! -- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/geany/geany/pull/1445#issuecomment-444275376

Re: [Github-comments] [geany/geany] Improve goto-symbols popup (#1445)

2018-12-04 Thread Colomban Wendling
Yep, thanks :) -- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/geany/geany/pull/1445#issuecomment-444274695

Re: [Github-comments] [geany/geany] Improve goto-symbols popup (#1445)

2018-12-04 Thread Colomban Wendling
Merged #1445 into master. -- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/geany/geany/pull/1445#event-2005586108

Re: [Github-comments] [geany/geany] Improve goto-symbols popup (#1445)

2018-12-04 Thread Thomas Martitz
@b4n are we good to go? -- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/geany/geany/pull/1445#issuecomment-444258483

Re: [Github-comments] [geany/geany] Improve goto-symbols popup (#1445)

2018-12-02 Thread Colomban Wendling
@kugel- See https://github.com/kugel-/geany/pull/6 -- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/geany/geany/pull/1445#issuecomment-443498042

Re: [Github-comments] [geany/geany] Improve goto-symbols popup (#1445)

2018-12-01 Thread Thomas Martitz
I rebased and imply removed the API bump that was causing the conflict. I hope that's what you wanted? -- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/geany/geany/pull/1445#issuecomment-443462293

Re: [Github-comments] [geany/geany] Improve goto-symbols popup (#1445)

2018-12-01 Thread Thomas Martitz
@kugel- pushed 1 commit. c599a1e fix inverted logic in assertion -- You are receiving this because you are subscribed to this thread. View it on GitHub: https://github.com/geany/geany/pull/1445/files/dbafede20cd3622867b2ec4649b16ee5947f6083..c599a1e7eab887ff2a792fd15eddb8a51d4570ed

Re: [Github-comments] [geany/geany] Improve goto-symbols popup (#1445)

2018-12-01 Thread Colomban Wendling
@kugel- just in case you didn't see my review here like on the other PR. -- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/geany/geany/pull/1445#issuecomment-443449989

Re: [Github-comments] [geany/geany] Improve goto-symbols popup (#1445)

2018-11-24 Thread Colomban Wendling
b4n commented on this pull request. > + * @return @transfer{full} A newly-allocated array of transformed paths > strings, terminated by +@c NULL. Use @c g_strfreev() to free it. + * + * @since 1.31 (API 232) + */ +GEANY_API_SYMBOL +gchar **utils_strv_shorten_file_list(gchar

Re: [Github-comments] [geany/geany] Improve goto-symbols popup (#1445)

2018-11-24 Thread Colomban Wendling
``` (geany:25173): Geany-CRITICAL **: utils_strv_shorten_file_list: assertion 'num != 0 && file_names == NULL' failed Erreur de segmentation ``` oops! Just tried to go to a location -- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on

Re: [Github-comments] [geany/geany] Improve goto-symbols popup (#1445)

2018-11-24 Thread Colomban Wendling
b4n requested changes on this pull request. Still annoying :) Otherwise looks good. You also should resolve the conflict, but apart from that I think we're good do go. > @@ -2031,6 +2031,208 @@ gchar **utils_strv_join(gchar **first, gchar **second) return strv; } +/* * Returns the

Re: [Github-comments] [geany/geany] Improve goto-symbols popup (#1445)

2018-11-18 Thread Thomas Martitz
@kugel- pushed 1 commit. 0789cf2 Changes for review comments -- You are receiving this because you are subscribed to this thread. View it on GitHub: https://github.com/geany/geany/pull/1445/files/16540421553139eb248e241118874c527737210f..0789cf2c9cafdaa381e47eb2e025c012ae0d596a

Re: [Github-comments] [geany/geany] Improve goto-symbols popup (#1445)

2018-11-18 Thread Thomas Martitz
kugel- commented on this pull request. > + + /* The return value shall have exactly the same size as the input. If the input is a +* GStrv (last element is NULL), the output will follow suit. */ + if (!num) + num = g_strv_length(file_names); + /* Always

Re: [Github-comments] [geany/geany] Improve goto-symbols popup (#1445)

2018-11-18 Thread Thomas Martitz
kugel- commented on this pull request. > + return lcs; +} + + +/** Transform file names in a list to be shorter. + * + * This function takes a list of file names (probably with absolute paths), and + * transforms the paths such that they are short but still unique. This is intended + * for

Re: [Github-comments] [geany/geany] Improve goto-symbols popup (#1445)

2018-11-17 Thread Matthew Brush
codebrainz commented on this pull request. > + return lcs; +} + + +/** Transform file names in a list to be shorter. + * + * This function takes a list of file names (probably with absolute paths), and + * transforms the paths such that they are short but still unique. This is intended + *

Re: [Github-comments] [geany/geany] Improve goto-symbols popup (#1445)

2018-11-17 Thread Colomban Wendling
b4n commented on this pull request. > + return lcs; +} + + +/** Transform file names in a list to be shorter. + * + * This function takes a list of file names (probably with absolute paths), and + * transforms the paths such that they are short but still unique. This is intended + * for

Re: [Github-comments] [geany/geany] Improve goto-symbols popup (#1445)

2018-11-16 Thread Thomas Martitz
kugel- commented on this pull request. > + return lcs; +} + + +/** Transform file names in a list to be shorter. + * + * This function takes a list of file names (probably with absolute paths), and + * transforms the paths such that they are short but still unique. This is intended + * for

Re: [Github-comments] [geany/geany] Improve goto-symbols popup (#1445)

2018-11-16 Thread Colomban Wendling
b4n commented on this pull request. > @@ -2031,6 +2031,209 @@ gchar **utils_strv_join(gchar **first, gchar **second) return strv; } +/* * Returns the common prefix in a list of strings. + * + * The size of the list may be given explicitely, but defaults to @c g_strv_length(strv). +

Re: [Github-comments] [geany/geany] Improve goto-symbols popup (#1445)

2018-11-16 Thread Colomban Wendling
b4n commented on this pull request. > + return lcs; +} + + +/** Transform file names in a list to be shorter. + * + * This function takes a list of file names (probably with absolute paths), and + * transforms the paths such that they are short but still unique. This is intended + * for

Re: [Github-comments] [geany/geany] Improve goto-symbols popup (#1445)

2018-11-16 Thread Thomas Martitz
kugel- commented on this pull request. > + + /* The return value shall have exactly the same size as the input. If the input is a +* GStrv (last element is NULL), the output will follow suit. */ + if (!num) + num = g_strv_length(file_names); + /* Always

Re: [Github-comments] [geany/geany] Improve goto-symbols popup (#1445)

2018-11-16 Thread Thomas Martitz
kugel- commented on this pull request. > @@ -2031,6 +2031,209 @@ gchar **utils_strv_join(gchar **first, gchar **second) return strv; } +/* * Returns the common prefix in a list of strings. + * + * The size of the list may be given explicitely, but defaults to @c g_strv_length(strv).

Re: [Github-comments] [geany/geany] Improve goto-symbols popup (#1445)

2018-11-16 Thread Colomban Wendling
b4n requested changes on this pull request. > @@ -1927,15 +1927,23 @@ static void show_goto_popup(GeanyDocument *doc, > GPtrArray *tags, gboolean have_b GdkEventButton *button_event = NULL; TMTag *tmtag; guint i; - + gchar **short_names, **file_names, **p; `p` is

Re: [Github-comments] [geany/geany] Improve goto-symbols popup (#1445)

2018-11-16 Thread Colomban Wendling
> Fixing this isn't trivial That's why I suggested in an earlier comment that the fact `utils_strv_find_lcs()` looks generic is cute, but in practice this function does *not* do what `utils_strv_shorten_file_list()` needs. > and without proper unit tests there is a risk to break previously

Re: [Github-comments] [geany/geany] Improve goto-symbols popup (#1445)

2018-11-15 Thread Colomban Wendling
@kugel- there still are problems shortening some paths, like e.g. */src/a/app-1.2.3/src/lib/module/source.c* and */src/b/app-2.2.3/src/module/source.c*: path | current result | my expectation --||-- `/src/a/app-1.2.3/src/lib/module/source.c` |

Re: [Github-comments] [geany/geany] Improve goto-symbols popup (#1445)

2018-04-03 Thread elextr
> (ellipsizing is clearer when the 3 dots are encosed by words. I've never seen > a ellipsizing that cuts of the entire front). I agree with @kugel- here, and would have expected what @b4n showed as "current result" anyway. -- You are receiving this because you are subscribed to this thread.

Re: [Github-comments] [geany/geany] Improve goto-symbols popup (#1445)

2018-04-03 Thread Thomas Martitz
@b4n friendly ping :-) -- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/geany/geany/pull/1445#issuecomment-378340497

Re: [Github-comments] [geany/geany] Improve goto-symbols popup (#1445)

2018-03-25 Thread Thomas Martitz
> Looking at the table below, is this expected, or is it a bug? it's debatable. From the plain algorithm, your expectation is right and the result is buggy. But one can argue that the actual result may be less confusing to the user (ellipsizing is clearer when the 3 dots are encosed by words.

Re: [Github-comments] [geany/geany] Improve goto-symbols popup (#1445)

2018-03-23 Thread Colomban Wendling
Also, your code doesn't seem to support Windows path separators. I'm not 100% sure we need it in Geany here, but it would probably be good to have support for it if it's supposed to be a generic utility. -- You are receiving this because you are subscribed to this thread. Reply to this email

Re: [Github-comments] [geany/geany] Improve goto-symbols popup (#1445)

2018-03-23 Thread Colomban Wendling
Looking at the table below, is this expected, or is it a bug? path | current result | what I expected | | `/aaa/bbb/cc/c/d` | `cc/.../d` | `.../d` `/aaa/bbb/xxx/yyy/cc/c/d` | `xxx/yyy/cc/.../d` | `xxx/yyy/.../d` -- You are receiving this because

Re: [Github-comments] [geany/geany] Improve goto-symbols popup (#1445)

2018-03-15 Thread Thomas Martitz
I hope the code is clearer now and the bug you mentioned should be fixed -- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/geany/geany/pull/1445#issuecomment-373435785

Re: [Github-comments] [geany/geany] Improve goto-symbols popup (#1445)

2018-03-15 Thread Thomas Martitz
@kugel- pushed 1 commit. 1654042 Refactoring and review comments -- You are receiving this because you are subscribed to this thread. View it on GitHub: https://github.com/geany/geany/pull/1445/files/47f43928054ba848d2e9b2c00daa1a7211bbf44f..16540421553139eb248e241118874c527737210f

Re: [Github-comments] [geany/geany] Improve goto-symbols popup (#1445)

2018-03-09 Thread Colomban Wendling
b4n commented on this pull request. small stuff I noticed first time I went over, if it can be useful. Not a complete review. > +{ + gchar *prefix, **ptr; + + if (!NZV(strv)) + return NULL; + + if (num == 0) + num = g_strv_length(strv); + +

Re: [Github-comments] [geany/geany] Improve goto-symbols popup (#1445)

2018-03-09 Thread Colomban Wendling
Well, yeah I don't like inefficient code when it can easily be improved in that aspect. OTOH, I prefer easy to read/maintain code. And I'll have to check again, maybe I was tired, but I found your code oddly hard to follow, and tricky to fix the issues I found. At the time I found that

Re: [Github-comments] [geany/geany] Improve goto-symbols popup (#1445)

2018-03-02 Thread Thomas Martitz
@b4n to be honest, I prefer my version. I find it easier to grasp because it's split into 3 strv-related utility functions that have well defined and separated functionality (the functions should be useful on their own). I don't so how your code is really any shorter (and neither is worryingly