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.
This commit is contained in:
Clément Joly 2022-11-13 17:26:15 +00:00 committed by Clément Joly
parent 5d68c5666b
commit 090b4fdb16
3 changed files with 45 additions and 43 deletions

View File

@ -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|. in each group. “Modes” have the same meaning as in the |map-table|.
-------------------------------------------------------------------------------- --------------------------------------------------------------------------------
require("bepo").tabs() *bepo.nvim-tabs* require("bepo").easy_access() *bepo.nvim-easy_access*
le couple [gb]/[gé] agit sur les tabs
Modes Bepo Qwerty Modes Bepo Qwerty
n gb gT n « <
n gé gt x « <gv
n gB :execute "silent! tabfirst"<CR> n » >
n gÉ :execute "silent! tablast"<CR> x » >gv
n gT <C-]> nx g, g;
nx g; g,
-------------------------------------------------------------------------------- nx é w
require("bepo").window() *bepo.nvim-window* nx É W
[w] est libre pour faire <C-w>, grâce à easy_access ox aé aw
ox aÉ aW
Modes Bepo Qwerty ox ié iw
n w <C-w> ox iÉ iW
n W <C-w><C-w>
n wc <C-w>h
n wt <C-w>j
n ws <C-w>k
n wr <C-w>l
n wC <C-w>H
n wT <C-w>J
n wS <C-w>K
n wR <C-w>L
n wh <C-w>s
n wé <C-w>t
n wÉ <C-w>T
-------------------------------------------------------------------------------- --------------------------------------------------------------------------------
require("bepo").movement() *bepo.nvim-movement* require("bepo").movement() *bepo.nvim-movement*
@ -102,21 +89,34 @@ on préserve {hjkl} pour les directions
nx K S 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 Modes Bepo Qwerty
n « < n gb gT
x « <gv n gé gt
n » > n gB :execute "silent! tabfirst"<CR>
x » >gv n gÉ :execute "silent! tablast"<CR>
nx g, g; n gT <C-]>
nx g; g,
nx é w --------------------------------------------------------------------------------
nx É W require("bepo").window() *bepo.nvim-window*
ox aé aw [w] est libre pour faire <C-w>, grâce à easy_access
ox aÉ aW
ox ié iw Modes Bepo Qwerty
ox iÉ iW n w <C-w>
n W <C-w><C-w>
n wc <C-w>h
n wt <C-w>j
n ws <C-w>k
n wr <C-w>l
n wC <C-w>H
n wT <C-w>J
n wS <C-w>K
n wR <C-w>L
n wh <C-w>s
n wé <C-w>t
n wÉ <C-w>T
vim:tw=78:ts=8:ft=help:norl: vim:tw=78:ts=8:ft=help:norl:

View File

@ -138,4 +138,3 @@
:tabs mapping-tabs :tabs mapping-tabs
:easy_access mapping-easy-access :easy_access mapping-easy-access
:window mapping-window} :window mapping-window}

View File

@ -102,11 +102,14 @@ in each group. “Modes” have the same meaning as in the |map-table|.
(let [tbl (collect [name docstruct (pairs bepo)] (let [tbl (collect [name docstruct (pairs bepo)]
(if (= name :setup) nil (if (= name :setup) nil
(= (type docstruct) :table) (values name docstruct) (= (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 (do
(table.sort tbl) (table.sort tbl_keys)
(each [name docstruct (pairs tbl)] (each [_ name (pairs tbl_keys)]
(do (do
(local docstruct (. tbl name))
(var need-header true) (var need-header true)
(fn print-header [] (fn print-header []
(do (do