File tree 4 files changed +27
-9
lines changed
4 files changed +27
-9
lines changed Original file line number Diff line number Diff line change 24
24
version : latest
25
25
args : --color always --check lua/ tests/
26
26
27
+ luacheck :
28
+ runs-on : ubuntu-22.04
29
+ steps :
30
+ - uses : actions/checkout@v4
31
+ - name : Prepare
32
+ run : |
33
+ sudo apt-get update
34
+ sudo apt-get install -y luarocks
35
+ sudo luarocks install luacheck
36
+ - name : Lint
37
+ run : luacheck lua/
38
+
27
39
unit_test :
28
40
runs-on : ubuntu-latest
29
41
Original file line number Diff line number Diff line change
1
+ read_globals = { " vim" }
Original file line number Diff line number Diff line change @@ -174,20 +174,18 @@ end
174
174
175
175
local cache_request = {}
176
176
177
- --- @param motion string
178
177
--- @return nil
179
- M .debugprint_operatorfunc_regular = function (motion )
178
+ M .debugprint_operatorfunc_regular = function ()
180
179
addline (cache_request )
181
180
utils_operator .set_callback (
182
181
" v:lua.require'debugprint'.debugprint_operatorfunc_regular"
183
182
)
184
183
end
185
184
186
- --- @param motion string
187
185
--- @return nil
188
- M .debugprint_operatorfunc_motion = function (motion )
186
+ M .debugprint_operatorfunc_motion = function ()
189
187
cache_request .variable_name = utils_buffer .get_operator_selection ()
190
- M .debugprint_operatorfunc_regular (motion )
188
+ M .debugprint_operatorfunc_regular ()
191
189
end
192
190
193
191
--- @param opts DebugprintFunctionOptionsInternal
@@ -209,8 +207,9 @@ M.debugprint_regular = function(opts)
209
207
end
210
208
211
209
cache_request = opts
212
- vim . go . operatorfunc =
210
+ utils_operator . set_operatorfunc (
213
211
" v:lua.require'debugprint'.debugprint_operatorfunc_regular"
212
+ )
214
213
return " g@l"
215
214
end
216
215
@@ -228,8 +227,9 @@ M.debugprint = function(opts)
228
227
229
228
if func_opts .motion == true then
230
229
cache_request = func_opts
231
- vim . go . operatorfunc =
230
+ utils_operator . set_operatorfunc (
232
231
" v:lua.require'debugprint'.debugprint_operatorfunc_motion"
232
+ )
233
233
return " g@"
234
234
else
235
235
cache_request = {}
Original file line number Diff line number Diff line change @@ -3,12 +3,17 @@ local M = {}
3
3
--- @return nil
4
4
M .NOOP = function () end
5
5
6
+ --- @param value string
7
+ M .set_operatorfunc = function (value )
8
+ vim .api .nvim_set_option_value (" operatorfunc" , value , {})
9
+ end
10
+
6
11
--- @param func_name string
7
12
--- @return nil
8
13
M .set_callback = function (func_name )
9
- vim . go . operatorfunc = " v:lua.require'debugprint.utils.operator'.NOOP"
14
+ M . set_operatorfunc ( " v:lua.require'debugprint.utils.operator'.NOOP" )
10
15
vim .cmd (" normal! g@l" )
11
- vim . go . operatorfunc = func_name
16
+ M . set_operatorfunc ( func_name )
12
17
end
13
18
14
19
return M
You can’t perform that action at this time.
0 commit comments