File tree 2 files changed +24
-0
lines changed
2 files changed +24
-0
lines changed Original file line number Diff line number Diff line change @@ -555,11 +555,21 @@ require("trouble").jump_only(opts)
555
555
--- @return trouble.View
556
556
require (" trouble" ).jump_split (opts )
557
557
558
+ -- Open the item in a split and close the trouble window
559
+ --- @param opts ? trouble.Mode | { new ? : boolean } | string
560
+ --- @return trouble.View
561
+ require (" trouble" ).jump_split_close (opts )
562
+
558
563
-- Open the item in a vsplit
559
564
--- @param opts ? trouble.Mode | { new ? : boolean } | string
560
565
--- @return trouble.View
561
566
require (" trouble" ).jump_vsplit (opts )
562
567
568
+ -- Open the item in a vsplit and close the trouble window
569
+ --- @param opts ? trouble.Mode | { new ? : boolean } | string
570
+ --- @return trouble.View
571
+ require (" trouble" ).jump_vsplit_close (opts )
572
+
563
573
-- Go to the last item
564
574
--- @param opts ? trouble.Mode | { new ? : boolean } | string
565
575
--- @return trouble.View
Original file line number Diff line number Diff line change @@ -114,12 +114,26 @@ local M = {
114
114
self :jump (ctx .item , { split = true })
115
115
end
116
116
end ,
117
+ -- Open the item in a split and close the trouble window
118
+ jump_split_close = function (self , ctx )
119
+ if ctx .item then
120
+ self :jump (ctx .item , { split = true })
121
+ self :close ()
122
+ end
123
+ end ,
117
124
-- Open the item in a vsplit
118
125
jump_vsplit = function (self , ctx )
119
126
if ctx .item then
120
127
self :jump (ctx .item , { vsplit = true })
121
128
end
122
129
end ,
130
+ -- Open the item in a vsplit and close the trouble window
131
+ jump_vsplit_close = function (self , ctx )
132
+ if ctx .item then
133
+ self :jump (ctx .item , { vsplit = true })
134
+ self :close ()
135
+ end
136
+ end ,
123
137
-- Dump the item to the console
124
138
inspect = function (_ , ctx )
125
139
vim .print (ctx .item or (ctx .node and ctx .node .item ))
You can’t perform that action at this time.
0 commit comments