Skip to content

Commit 629b5f7

Browse files
chore(refactor): use list instead of array naming, custom iter for types, indent latex
## Details Mostly a refactor but does include a latex functional change. Anywhere we use array replace it with list since that's what various neovim functions use. Create an `iter` module with `map` and `filter` setup in such that the lua language server automatically infers function arguments and out correctly. For latex pad the output such that it lines up with the column of the input formula, should be mildly nicer than always at the start.
1 parent af51e3a commit 629b5f7

File tree

15 files changed

+156
-108
lines changed

15 files changed

+156
-108
lines changed

README.md

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -247,32 +247,32 @@ require('render-markdown').setup({
247247
position = 'overlay',
248248
-- Replaces '#+' of 'atx_h._marker'
249249
-- The number of '#' in the heading determines the 'level'
250-
-- The 'level' is used to index into the array using a cycle
250+
-- The 'level' is used to index into the list using a cycle
251251
icons = { '󰲡 ', '󰲣 ', '󰲥 ', '󰲧 ', '󰲩 ', '󰲫 ' },
252252
-- Added to the sign column if enabled
253-
-- The 'level' is used to index into the array using a cycle
253+
-- The 'level' is used to index into the list using a cycle
254254
signs = { '󰫎 ' },
255255
-- Width of the heading background:
256256
-- block: width of the heading text
257257
-- full: full width of the window
258-
-- Can also be an array of the above values in which case the 'level' is used
259-
-- to index into the array using a clamp
258+
-- Can also be a list of the above values in which case the 'level' is used
259+
-- to index into the list using a clamp
260260
width = 'full',
261261
-- Amount of margin to add to the left of headings
262262
-- If a floating point value < 1 is provided it is treated as a percentage of the available window space
263263
-- Margin available space is computed after accounting for padding
264-
-- Can also be an array of numbers in which case the 'level' is used to index into the array using a clamp
264+
-- Can also be a list of numbers in which case the 'level' is used to index into the list using a clamp
265265
left_margin = 0,
266266
-- Amount of padding to add to the left of headings
267267
-- If a floating point value < 1 is provided it is treated as a percentage of the available window space
268-
-- Can also be an array of numbers in which case the 'level' is used to index into the array using a clamp
268+
-- Can also be a list of numbers in which case the 'level' is used to index into the list using a clamp
269269
left_pad = 0,
270270
-- Amount of padding to add to the right of headings when width is 'block'
271271
-- If a floating point value < 1 is provided it is treated as a percentage of the available window space
272-
-- Can also be an array of numbers in which case the 'level' is used to index into the array using a clamp
272+
-- Can also be a list of numbers in which case the 'level' is used to index into the list using a clamp
273273
right_pad = 0,
274274
-- Minimum width to use for headings when width is 'block'
275-
-- Can also be an array of integers in which case the 'level' is used to index into the array using a clamp
275+
-- Can also be a list of integers in which case the 'level' is used to index into the list using a clamp
276276
min_width = 0,
277277
-- Determins if a border is added above and below headings
278278
border = false,
@@ -284,7 +284,7 @@ require('render-markdown').setup({
284284
above = '',
285285
-- Used below heading for border
286286
below = '',
287-
-- The 'level' is used to index into the array using a clamp
287+
-- The 'level' is used to index into the list using a clamp
288288
-- Highlight for the heading icon and extends through the entire line
289289
backgrounds = {
290290
'RenderMarkdownH1Bg',
@@ -294,7 +294,7 @@ require('render-markdown').setup({
294294
'RenderMarkdownH5Bg',
295295
'RenderMarkdownH6Bg',
296296
},
297-
-- The 'level' is used to index into the array using a clamp
297+
-- The 'level' is used to index into the list using a clamp
298298
-- Highlight for the heading and sign icons
299299
foregrounds = {
300300
'RenderMarkdownH1',
@@ -323,7 +323,7 @@ require('render-markdown').setup({
323323
-- Amount of padding to add around the language
324324
-- If a floating point value < 1 is provided it is treated as a percentage of the available window space
325325
language_pad = 0,
326-
-- An array of language names for which background highlighting will be disabled
326+
-- A list of language names for which background highlighting will be disabled
327327
-- Likely because that language has background highlights itself
328328
disable_background = { 'diff' },
329329
-- Width of the code block background:
@@ -373,7 +373,7 @@ require('render-markdown').setup({
373373
enabled = true,
374374
-- Replaces '-'|'+'|'*' of 'list_item'
375375
-- How deeply nested the list is determines the 'level'
376-
-- The 'level' is used to index into the array using a cycle
376+
-- The 'level' is used to index into the list using a cycle
377377
-- If the item is a 'checkbox' a conceal is used to hide the bullet instead
378378
icons = { '', '', '', '' },
379379
-- Padding to add to the left of bullet point
@@ -587,11 +587,11 @@ require('render-markdown').setup({
587587

588588
</details>
589589

590-
We use the following definitions when discussing indexing into arrays:
590+
We use the following definitions when discussing indexing into lists:
591591

592592
1. Cycle: Indexed `mod` the length.
593593
Example: `{ 1, 2, 3 }` @ 4 = 1.
594-
2. Clamp: Indexed normally but larger values use the last value in the array.
594+
2. Clamp: Indexed normally but larger values use the last value in the list.
595595
Example: `{ 1, 2, 3 }` @ 4 = 3.
596596

597597
## Headings
@@ -615,32 +615,32 @@ require('render-markdown').setup({
615615
position = 'overlay',
616616
-- Replaces '#+' of 'atx_h._marker'
617617
-- The number of '#' in the heading determines the 'level'
618-
-- The 'level' is used to index into the array using a cycle
618+
-- The 'level' is used to index into the list using a cycle
619619
icons = { '󰲡 ', '󰲣 ', '󰲥 ', '󰲧 ', '󰲩 ', '󰲫 ' },
620620
-- Added to the sign column if enabled
621-
-- The 'level' is used to index into the array using a cycle
621+
-- The 'level' is used to index into the list using a cycle
622622
signs = { '󰫎 ' },
623623
-- Width of the heading background:
624624
-- block: width of the heading text
625625
-- full: full width of the window
626-
-- Can also be an array of the above values in which case the 'level' is used
627-
-- to index into the array using a clamp
626+
-- Can also be a list of the above values in which case the 'level' is used
627+
-- to index into the list using a clamp
628628
width = 'full',
629629
-- Amount of margin to add to the left of headings
630630
-- If a floating point value < 1 is provided it is treated as a percentage of the available window space
631631
-- Margin available space is computed after accounting for padding
632-
-- Can also be an array of numbers in which case the 'level' is used to index into the array using a clamp
632+
-- Can also be a list of numbers in which case the 'level' is used to index into the list using a clamp
633633
left_margin = 0,
634634
-- Amount of padding to add to the left of headings
635635
-- If a floating point value < 1 is provided it is treated as a percentage of the available window space
636-
-- Can also be an array of numbers in which case the 'level' is used to index into the array using a clamp
636+
-- Can also be a list of numbers in which case the 'level' is used to index into the list using a clamp
637637
left_pad = 0,
638638
-- Amount of padding to add to the right of headings when width is 'block'
639639
-- If a floating point value < 1 is provided it is treated as a percentage of the available window space
640-
-- Can also be an array of numbers in which case the 'level' is used to index into the array using a clamp
640+
-- Can also be a list of numbers in which case the 'level' is used to index into the list using a clamp
641641
right_pad = 0,
642642
-- Minimum width to use for headings when width is 'block'
643-
-- Can also be an array of integers in which case the 'level' is used to index into the array using a clamp
643+
-- Can also be a list of integers in which case the 'level' is used to index into the list using a clamp
644644
min_width = 0,
645645
-- Determins if a border is added above and below headings
646646
border = false,
@@ -652,7 +652,7 @@ require('render-markdown').setup({
652652
above = '',
653653
-- Used below heading for border
654654
below = '',
655-
-- The 'level' is used to index into the array using a clamp
655+
-- The 'level' is used to index into the list using a clamp
656656
-- Highlight for the heading icon and extends through the entire line
657657
backgrounds = {
658658
'RenderMarkdownH1Bg',
@@ -662,7 +662,7 @@ require('render-markdown').setup({
662662
'RenderMarkdownH5Bg',
663663
'RenderMarkdownH6Bg',
664664
},
665-
-- The 'level' is used to index into the array using a clamp
665+
-- The 'level' is used to index into the list using a clamp
666666
-- Highlight for the heading and sign icons
667667
foregrounds = {
668668
'RenderMarkdownH1',
@@ -706,7 +706,7 @@ require('render-markdown').setup({
706706
-- Amount of padding to add around the language
707707
-- If a floating point value < 1 is provided it is treated as a percentage of the available window space
708708
language_pad = 0,
709-
-- An array of language names for which background highlighting will be disabled
709+
-- A list of language names for which background highlighting will be disabled
710710
-- Likely because that language has background highlights itself
711711
disable_background = { 'diff' },
712712
-- Width of the code block background:
@@ -786,7 +786,7 @@ require('render-markdown').setup({
786786
enabled = true,
787787
-- Replaces '-'|'+'|'*' of 'list_item'
788788
-- How deeply nested the list is determines the 'level'
789-
-- The 'level' is used to index into the array using a cycle
789+
-- The 'level' is used to index into the list using a cycle
790790
-- If the item is a 'checkbox' a conceal is used to hide the bullet instead
791791
icons = { '', '', '', '' },
792792
-- Padding to add to the left of bullet point

0 commit comments

Comments
 (0)