From dbcee57fa416c763f93359303c1c953eda54fce3 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Loi=CC=88c=20Correnson?= <loic.correnson@cea.fr>
Date: Mon, 29 Jun 2020 15:49:01 +0200
Subject: [PATCH] [frama-c] sort functions by name (alpha)

---
 ivette/src/renderer/Globals.tsx | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/ivette/src/renderer/Globals.tsx b/ivette/src/renderer/Globals.tsx
index 5d4e1cd82df..edc8a40d566 100644
--- a/ivette/src/renderer/Globals.tsx
+++ b/ivette/src/renderer/Globals.tsx
@@ -5,6 +5,7 @@
 import React from 'react';
 import { Section, Item } from 'dome/frame/sidebars';
 import * as States from 'frama-c/states';
+import { alpha } from 'dome/data/compare';
 import { functions, functionsData } from 'api/kernel/ast';
 
 // --------------------------------------------------------------------------
@@ -15,7 +16,9 @@ export default () => {
 
   // Hooks
   const [selection, updateSelection] = States.useSelection();
-  const fcts = States.useSyncArray(functions);
+  const fcts = States.useSyncArray(functions).sort(
+    (f, g) => alpha(f.name, g.name),
+  );
 
   // Items
   const current: undefined | string = selection?.current?.function;
-- 
GitLab