irongit

A Neovim plugin enabling you to solve LeetCode problems.

refactor: picker width/height

kawreauthored
parent 6abdcf6commit 45988461386adb9e3616dda816878ee1c8d87211Browse files

4 files changed, +10 -7

+3-2lua/leetcode/picker/language/snacks.lua
@@ -19,7 +19,6 @@ return function(question, cb)
1919 end
2020
2121 picker.pick({
22- source = "select",
2322 items = finder_items,
2423 format = function(item)
2524 local ret = {}
@@ -36,8 +35,10 @@ return function(question, cb)
3635 title = t("Available Languages"),
3736 layout = {
3837 preview = false,
38+ preset = "select",
3939 layout = {
40- height = math.floor(math.min(vim.o.lines * 0.8 - 10, #items + 2) + 0.5),
40+ height = language_picker.height,
41+ width = language_picker.width,
4142 },
4243 },
4344 actions = {
+1-1lua/leetcode/picker/question/init.lua
@@ -9,7 +9,7 @@ local Picker = require("leetcode.picker")
99 local P = {}
1010
1111 P.width = 100
12-P.height = 20
12+P.height = 0.6
1313
1414 ---@param items lc.cache.Question[]
1515 ---@param opts table<string, string[]>
+3-2lua/leetcode/picker/question/snacks.lua
@@ -19,7 +19,6 @@ return function(questions, opts)
1919 end
2020
2121 picker.pick({
22- source = "select",
2322 items = finder_items,
2423 format = function(item)
2524 local ret = {}
@@ -35,9 +34,11 @@ return function(questions, opts)
3534 end,
3635 title = t("Select a Question"),
3736 layout = {
37+ preset = "select",
3838 preview = false,
3939 layout = {
40- height = math.floor(math.min(vim.o.lines * 0.8 - 10, #items + 2) + 0.5),
40+ height = question_picker.height,
41+ width = question_picker.width,
4142 },
4243 },
4344 actions = {
+3-2lua/leetcode/picker/tabs/snacks.lua
@@ -21,7 +21,6 @@ return function(tabs)
2121 end
2222
2323 picker.pick({
24- source = "select",
2524 items = finder_items,
2625 format = function(item)
2726 local ret = {}
@@ -38,8 +37,10 @@ return function(tabs)
3837 title = t("Select a Question"),
3938 layout = {
4039 preview = false,
40+ preset = "select",
4141 layout = {
42- height = math.floor(math.min(vim.o.lines * 0.8 - 10, #items + 2) + 0.5),
42+ height = tabs_picker.height,
43+ width = tabs_picker.width,
4344 },
4445 },
4546 actions = {