Skip to content

Commit bc2e87d

Browse files
committed
more testing text objects
1 parent d2cc953 commit bc2e87d

4 files changed

Lines changed: 22 additions & 7 deletions

File tree

lua/motioncoach-nvim/config.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ local defaultConfig = {
3333
keyRingBufferSize = 260,
3434
--- The time within that a "patern" of keys will be analyzed
3535
--- default 2000ms
36-
keyPatternWindowMilliseconds = 4000,
36+
keyPatternWindowMilliseconds = 10000,
3737
--- Capture command keys (eg. i a p o x d c r y u ...) -- If this is true, a lot more Advanced suggestions are enabled
3838
--- default false
3939
captureCommandLineKeys = false,

lua/motioncoach-nvim/episodes.lua

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -283,6 +283,10 @@ local function on_cursor_moved()
283283
'<ScrollWheelDown>',
284284
}
285285

286+
if config.coachingLevel >= 2 then
287+
excludeKeys = {}
288+
end
289+
286290
currentMode = vim.api.nvim_get_mode().mode
287291
local match = Keylog.has_exclude_match(excludeKeys)
288292
if match then

lua/motioncoach-nvim/suggestions/advanced/textobject.lua

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,10 @@ function M.text_object_suggestion(keys, get_line)
3636
)
3737
)
3838

39+
-- some tto {sal}
40+
3941
local keyString = Utils.build_key_string(keys)
42+
vim.notify(keyString)
4043
local usedOperator = (keyString:find(' d ') or keyString:find(' c ') or keyString:find(' y '))
4144
~= nil
4245
local usedVisual = (keyString:find(' v ') or keyString:find(' V ') or keyString:find('<C%-v>'))
@@ -74,6 +77,12 @@ function M.text_object_suggestion(keys, get_line)
7477
if b < a then
7578
a, b = b, a
7679
end
80+
if a > 1 then
81+
a = a - 2
82+
end
83+
if b < #lineText - 1 then
84+
b = b + 2
85+
end
7786
local segment = lineText:sub(a, b)
7887

7988
-- NOTE: WORDS ciw diw yiw caw daw yaw

lua/motioncoach-nvim/utils.lua

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -47,12 +47,12 @@ function M.detect_last_operator_range()
4747
local startPos = vim.fn.getpos("'[")
4848
-- local startPos = vim.fn.getpos("'^")
4949
local endPos = vim.fn.getpos("']")
50-
-- vim.notify(
51-
-- vim.inspect(startPos)
52-
-- .. ' : '
53-
-- .. vim.inspect(endPos)
54-
-- .. ' -- from Utils.detect_last_operator_range'
55-
-- )
50+
vim.notify(
51+
vim.inspect(startPos)
52+
.. ' : '
53+
.. vim.inspect(endPos)
54+
.. ' -- from Utils.detect_last_operator_range'
55+
)
5656
if not startPos or not endPos then
5757
return nil
5858
end
@@ -63,6 +63,8 @@ function M.detect_last_operator_range()
6363
-- local jumps, last_idx = unpack(vim.fn.getjumplist())
6464
-- print('vim.inspect(jumps): ' .. vim.inspect(jumps))
6565

66+
-- sdlfkgjhal sdf ghasdf;g a sdfg af
67+
6668
return {
6769
bufferNumber = startPos[1],
6870
startRow = startPos[2],

0 commit comments

Comments
 (0)