From 090b4fdb1668cdaf620ba022ac39b6ef9c435518 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Joly?= Date: Sun, 13 Nov 2022 17:26:15 +0000 Subject: [PATCH] doc: make section order actually stable We were already trying to achieve that by sorting the table, but we were actually sorting by values (i.e. documentation text of a particular section). To fix this, we now extract the keys, sort them and get back the items from the initial table, in alphabetical order now. --- doc/bepo-nvim.txt | 78 ++++++++++++++++++++++----------------------- fnl/bepo.fnl | 1 - scripts/gen_doc.fnl | 9 ++++-- 3 files changed, 45 insertions(+), 43 deletions(-) diff --git a/doc/bepo-nvim.txt b/doc/bepo-nvim.txt index d85ea0f..52596c2 100644 --- a/doc/bepo-nvim.txt +++ b/doc/bepo-nvim.txt @@ -44,34 +44,21 @@ The following subsections go into details of exactly what mappings are in each group. “Modes” have the same meaning as in the |map-table|. -------------------------------------------------------------------------------- -require("bepo").tabs() *bepo.nvim-tabs* -le couple [gb]/[gé] agit sur les tabs +require("bepo").easy_access() *bepo.nvim-easy_access* Modes Bepo Qwerty - n gb gT - n gé gt - n gB :execute "silent! tabfirst" - n gÉ :execute "silent! tablast" - n gT - --------------------------------------------------------------------------------- -require("bepo").window() *bepo.nvim-window* -[w] est libre pour faire , grâce à easy_access - - Modes Bepo Qwerty - n w - n W - n wc h - n wt j - n ws k - n wr l - n wC H - n wT J - n wS K - n wR L - n wh s - n wé t - n wÉ T + n « < + x « + x » >gv + nx g, g; + nx g; g, + nx é w + nx É W + ox aé aw + ox aÉ aW + ox ié iw + ox iÉ iW -------------------------------------------------------------------------------- require("bepo").movement() *bepo.nvim-movement* @@ -102,21 +89,34 @@ on préserve {hjkl} pour les directions nx K S -------------------------------------------------------------------------------- -require("bepo").easy_access() *bepo.nvim-easy_access* +require("bepo").tabs() *bepo.nvim-tabs* +le couple [gb]/[gé] agit sur les tabs Modes Bepo Qwerty - n « < - x « - x » >gv - nx g, g; - nx g; g, - nx é w - nx É W - ox aé aw - ox aÉ aW - ox ié iw - ox iÉ iW + n gb gT + n gé gt + n gB :execute "silent! tabfirst" + n gÉ :execute "silent! tablast" + n gT + +-------------------------------------------------------------------------------- +require("bepo").window() *bepo.nvim-window* +[w] est libre pour faire , grâce à easy_access + + Modes Bepo Qwerty + n w + n W + n wc h + n wt j + n ws k + n wr l + n wC H + n wT J + n wS K + n wR L + n wh s + n wé t + n wÉ T vim:tw=78:ts=8:ft=help:norl: diff --git a/fnl/bepo.fnl b/fnl/bepo.fnl index 0a41e96..142f78e 100644 --- a/fnl/bepo.fnl +++ b/fnl/bepo.fnl @@ -138,4 +138,3 @@ :tabs mapping-tabs :easy_access mapping-easy-access :window mapping-window} - diff --git a/scripts/gen_doc.fnl b/scripts/gen_doc.fnl index 2cc8fcc..2a7eae5 100644 --- a/scripts/gen_doc.fnl +++ b/scripts/gen_doc.fnl @@ -102,11 +102,14 @@ in each group. “Modes” have the same meaning as in the |map-table|. (let [tbl (collect [name docstruct (pairs bepo)] (if (= name :setup) nil (= (type docstruct) :table) (values name docstruct) - (error (.. "Invalid type for " name))))] + (error (.. "Invalid type for " name)))) + tbl_keys (icollect [name docstructy (pairs tbl)] + name)] (do - (table.sort tbl) - (each [name docstruct (pairs tbl)] + (table.sort tbl_keys) + (each [_ name (pairs tbl_keys)] (do + (local docstruct (. tbl name)) (var need-header true) (fn print-header [] (do