File tree 2 files changed +26
-29
lines changed
2 files changed +26
-29
lines changed Original file line number Diff line number Diff line change @@ -121,34 +121,6 @@ M.map_keys_and_commands = function(global_opts)
121
121
desc = " Comment/uncomment all debugprint statements in the current buffer" ,
122
122
})
123
123
124
- map_key (" x" , global_opts .keymaps .visual .variable_below , {
125
- callback = function ()
126
- feedkeys (debugprint .debugprint ({ variable = true }))
127
- end ,
128
- desc = " Variable debug below current line" ,
129
- })
130
-
131
- map_key (" x" , global_opts .keymaps .visual .variable_above , {
132
- callback = function ()
133
- feedkeys (debugprint .debugprint ({
134
- above = true ,
135
- variable = true ,
136
- }))
137
- end ,
138
- desc = " Variable debug above current line" ,
139
- })
140
-
141
- map_key (" n" , global_opts .keymaps .normal .variable_above_alwaysprompt , {
142
- callback = function ()
143
- return debugprint .debugprint ({
144
- above = true ,
145
- variable = true ,
146
- ignore_treesitter = true ,
147
- })
148
- end ,
149
- desc = " Variable debug above current line (always prompt})" ,
150
- })
151
-
152
124
if global_opts .commands .delete_debug_prints then
153
125
vim .api .nvim_create_user_command (
154
126
global_opts .commands .delete_debug_prints ,
Original file line number Diff line number Diff line change @@ -969,7 +969,7 @@ describe("can handle treesitter identifiers", function()
969
969
assert .are .same (vim .api .nvim_win_get_cursor (0 ), { 2 , 9 })
970
970
end )
971
971
972
- it (" disabled at function level " , function ()
972
+ it (" always prompt below " , function ()
973
973
debugprint .setup ({
974
974
keymaps = { normal = { variable_below_alwaysprompt = " zxa" } },
975
975
})
@@ -994,6 +994,31 @@ describe("can handle treesitter identifiers", function()
994
994
assert .are .same (vim .api .nvim_win_get_cursor (0 ), { 2 , 10 })
995
995
end )
996
996
997
+ it (" always prompt above" , function ()
998
+ debugprint .setup ({
999
+ keymaps = { normal = { variable_above_alwaysprompt = " zxb" } },
1000
+ })
1001
+
1002
+ local filename = init_file ({
1003
+ " function x()" ,
1004
+ " local xyz = 3" ,
1005
+ " end" ,
1006
+ }, " lua" , 2 , 10 )
1007
+
1008
+ feedkeys (" zxb<BS><BS><BS>apple<CR>" )
1009
+
1010
+ check_lines ({
1011
+ " function x()" ,
1012
+ " print('DEBUGPRINT[1]: "
1013
+ .. filename
1014
+ .. " :2: apple=' .. vim.inspect(apple))" ,
1015
+ " local xyz = 3" ,
1016
+ " end" ,
1017
+ })
1018
+
1019
+ assert .are .same (vim .api .nvim_win_get_cursor (0 ), { 3 , 10 })
1020
+ end )
1021
+
997
1022
it (" special case dot expression (lua)" , function ()
998
1023
debugprint .setup ()
999
1024
You can’t perform that action at this time.
0 commit comments