File tree Expand file tree Collapse file tree 3 files changed +29
-12
lines changed
Expand file tree Collapse file tree 3 files changed +29
-12
lines changed Original file line number Diff line number Diff line change @@ -323,6 +323,17 @@ require("tinygit").setup {
323323 resetHunk = " <C-r>" ,
324324 },
325325 moveToNextHunkOnStagingToggle = false ,
326+
327+ -- accepts the common telescope picker config
328+ telescopeOpts = {
329+ layout_strategy = " horizontal" ,
330+ layout_config = {
331+ horizontal = {
332+ preview_width = 0.65 ,
333+ height = { 0.7 , min = 20 },
334+ },
335+ },
336+ },
326337 },
327338 commit = {
328339 preview = true , -- requires `nvim-notify` or `snacks.nvim`
Original file line number Diff line number Diff line change @@ -105,19 +105,14 @@ end
105105-- DOCS https://github.com/nvim-telescope/telescope.nvim/blob/master/developers.md
106106--- @param hunks Tinygit.Hunk[]
107107function M .pickHunk (hunks )
108- local icon = require (" tinygit.config" ).config .appearance .mainIcon
108+ local config = require (" tinygit.config" ).config
109+ local title = vim .trim (config .appearance .mainIcon .. " Git hunks" )
110+ local telescopeOpts = config .stage .telescopeOpts
111+
109112 pickers
110- .new ({}, {
111- prompt_title = vim .trim (icon .. " Git hunks" ),
112- sorter = telescopeConf .generic_sorter {},
113-
114- layout_strategy = " horizontal" ,
115- layout_config = {
116- horizontal = {
117- preview_width = 0.65 ,
118- height = { 0.7 , min = 20 },
119- },
120- },
113+ .new (telescopeOpts , {
114+ prompt_title = title ,
115+ sorter = telescopeConf .generic_sorter (telescopeOpts ),
121116
122117 finder = newFinder (hunks ),
123118
Original file line number Diff line number Diff line change @@ -12,6 +12,17 @@ local defaultConfig = {
1212 resetHunk = " <C-r>" ,
1313 },
1414 moveToNextHunkOnStagingToggle = false ,
15+
16+ -- accepts the common telescope picker config
17+ telescopeOpts = {
18+ layout_strategy = " horizontal" ,
19+ layout_config = {
20+ horizontal = {
21+ preview_width = 0.65 ,
22+ height = { 0.7 , min = 20 },
23+ },
24+ },
25+ },
1526 },
1627 commit = {
1728 preview = true , -- requires `nvim-notify` or `snacks.nvim`
You can’t perform that action at this time.
0 commit comments