[Github-comments] [geany/geany-plugins] lineoperations: add support for locale-aware sorting (#897)
LarsGit223
notifications at xxxxx
Wed Aug 28 19:29:16 UTC 2019
LarsGit223 requested changes on this pull request.
> + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+*/
+
+#ifndef LO_PREFS_H
+#define LO_PREFS_H
+
+#include <geanyplugin.h>
+#include "lo_prefs.h"
+
+
+typedef struct
+{
+ /* general settings */
+ gchar *config_file;
+ gboolean use_collation_compare;
+} AddonsInfo;
Is this intentionally named ```AddonsInfo``` or a copy&paste issue?
> +#ifndef LO_PREFS_H
+#define LO_PREFS_H
+
+#include <geanyplugin.h>
+#include "lo_prefs.h"
+
+
+typedef struct
+{
+ /* general settings */
+ gchar *config_file;
+ gboolean use_collation_compare;
+} AddonsInfo;
+
+
+extern AddonsInfo *lo_info;
Same question here.
> +appear ("Tools" > "Line Operations"). Click on each menu item to apply
+the operation on whole file, or selection. See descriptions below to
+see operations for each menu item.
+
+Preferences
+-----------
+
+To enable preferences ("Tools" > "Plugin Manager"), check the checkbox to
+enable Line Operations, and with the item highlighted click "Preferences"
+on bottom of the "Plugin Manager" frame.
+
+**Use collation based string compare** - When this option is enabled it will
+compare strings using linguistically correct rules for the current locale
+(g_utf8_collate).
+
+When it is disabled it will compare strings based off numerical value of the
Should it be _"based off"_ or _"based on"_?
> -#include "linefunctions.h"
+#include "lo_fns.h"
+#include "lo_prefs.h"
+
+
+/* Get sort function based on user preferences */
+lo_strcmpfns
+getcmpfns(void)
+{
+ if(lo_info->use_collation_compare)
+ {
+ return g_utf8_collate;
+ }
+ else
+ {
+ return strcmp;
Maybe you like to prefer ```g_strcmp0``` from the glib here? The same as ```strcmp``` just a bit safer but from glib.
--
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-plugins/pull/897#pullrequestreview-281047667
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.geany.org/pipermail/github-comments/attachments/20190828/7f0b445e/attachment.html>
More information about the Github-comments
mailing list