max397574 / startup.nvim

A highly configurable neovim startup screen
GNU General Public License v2.0
428 stars 34 forks source link

Unordered content #10

Closed crivotz closed 2 years ago

crivotz commented 2 years ago

The display of the values in content does not reflect the order of insertion and change on every launch.

content = {
      ["  New file"] = { ":ene <BAR> startinsert <CR>", "e" },
      ["ﭯ  Recently opened files"] = { ":Telescope oldfiles<CR>", "h" },
      ["  Find file"] = { ":lua require('plugins.telescope').project_files()<CR>", "f" },
      ["  Find project"] = { ":lua require('telescope').extensions.project.project{}<CR>", "p" },
      ["  Find word"] = { ":lua require('telescope.builtin').live_grep()<CR>", "r" },
      ["  Find modified file"] = { ":lua require('plugins.telescope').my_git_status()<CR>", "g" },
      ["  NV-IDE plugins"] = { ":e ~/.config/nvim/lua/plugins.lua<CR>", "s" },
      ["  Sync plugins"] = { ":PackerSync<CR>", "u" },
      ["  Quit"] = { ":qa<CR>", "q" },
},

Schermata del 2021-12-17 16-27-43

max397574 commented 2 years ago

This is because of pairs goes through the table in random order. I think the only way to fix this would be to change the format of the mapping table to not require keys. Is this a big issue for you? Because I prefer the syntax as it is now and in my opinion this never was a problem.

danymat commented 2 years ago

You can still use this trick: https://stackoverflow.com/questions/17436947/how-to-iterate-through-table-in-lua

max397574 commented 2 years ago

I'm working on a fix for this (I'll change the syntax)

max397574 commented 2 years ago

@crivotz this should be fixed now Can you confirm?

max397574 commented 2 years ago

I'll close this because the issue should be fixed if it still exists reopen it