fix: added b and B text objects and note about failing case.
All checks were successful
Run Test Suite / test (push) Successful in 47s
All checks were successful
Run Test Suite / test (push) Successful in 47s
This commit is contained in:
parent
aa156971ad
commit
5405d5a6bd
@ -95,6 +95,8 @@ func NewNormalKeymap() *Keymap {
|
|||||||
"\"": textobject.Delimiter{Char: '"'},
|
"\"": textobject.Delimiter{Char: '"'},
|
||||||
"'": textobject.Delimiter{Char: '\''},
|
"'": textobject.Delimiter{Char: '\''},
|
||||||
"`": textobject.Delimiter{Char: '`'},
|
"`": textobject.Delimiter{Char: '`'},
|
||||||
|
"b": textobject.Delimiter{Char: '('},
|
||||||
|
"B": textobject.Delimiter{Char: '{'},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -142,8 +144,9 @@ func NewVisualKeymap() *Keymap {
|
|||||||
"a": nil,
|
"a": nil,
|
||||||
},
|
},
|
||||||
textObjects: map[string]action.TextObject{
|
textObjects: map[string]action.TextObject{
|
||||||
"w": textobject.Word{},
|
"w": textobject.Word{},
|
||||||
"W": textobject.WORD{},
|
"W": textobject.WORD{},
|
||||||
|
// TODO: 's' and 'p'
|
||||||
"{": textobject.Delimiter{Char: '{'},
|
"{": textobject.Delimiter{Char: '{'},
|
||||||
"}": textobject.Delimiter{Char: '}'},
|
"}": textobject.Delimiter{Char: '}'},
|
||||||
"(": textobject.Delimiter{Char: '('},
|
"(": textobject.Delimiter{Char: '('},
|
||||||
@ -155,6 +158,8 @@ func NewVisualKeymap() *Keymap {
|
|||||||
"\"": textobject.Delimiter{Char: '"'},
|
"\"": textobject.Delimiter{Char: '"'},
|
||||||
"'": textobject.Delimiter{Char: '\''},
|
"'": textobject.Delimiter{Char: '\''},
|
||||||
"`": textobject.Delimiter{Char: '`'},
|
"`": textobject.Delimiter{Char: '`'},
|
||||||
|
"b": textobject.Delimiter{Char: '('},
|
||||||
|
"B": textobject.Delimiter{Char: '{'},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -47,6 +47,9 @@ type Delimiter struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// TODO: This should allow for many lines, not just a single line
|
// TODO: This should allow for many lines, not just a single line
|
||||||
|
//
|
||||||
|
// BUG: This does not work properly when the cursor is not inside a delimiter. If the cursor
|
||||||
|
// does not fall inside a delimiter range, it should search forward and find the delimiter.
|
||||||
func (to Delimiter) GetRange(m action.Model, cursor core.Position, modifier string) (core.Position, core.Position, core.MotionType) {
|
func (to Delimiter) GetRange(m action.Model, cursor core.Position, modifier string) (core.Position, core.Position, core.MotionType) {
|
||||||
buf := m.ActiveBuffer()
|
buf := m.ActiveBuffer()
|
||||||
line := buf.Lines[cursor.Line]
|
line := buf.Lines[cursor.Line]
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user