parent
66e422e397
commit
7ba24c043a
|
@ -472,6 +472,7 @@ Commands beginning with g are used to goto certain position and or buffer:
|
|||
|
||||
* `gh`: select to line begin
|
||||
* `gl`: select to line end
|
||||
* `gi`: select to line begin (non blank)
|
||||
|
||||
* `gg`, `gk`: go to the first line
|
||||
* `gj`: go to the last line
|
||||
|
|
|
@ -306,6 +306,7 @@ Changes
|
|||
|
||||
Goto Commands
|
||||
-------------
|
||||
|
||||
If a count is given prior to hitting *g*, *g* will jump to the given line
|
||||
|
||||
*gh*::
|
||||
|
@ -314,6 +315,9 @@ If a count is given prior to hitting *g*, *g* will jump to the given line
|
|||
*gl*::
|
||||
select to line end
|
||||
|
||||
*gi*::
|
||||
select to non blank line start
|
||||
|
||||
*gg*, *gk*::
|
||||
go to the first line
|
||||
|
||||
|
|
|
@ -141,6 +141,9 @@ void goto_commands(Context& context, NormalParams params)
|
|||
case 'h':
|
||||
select<mode, select_to_line_begin<true>>(context, {});
|
||||
break;
|
||||
case 'i':
|
||||
select<mode, select_to_first_non_blank>(context, {});
|
||||
break;
|
||||
case 'j':
|
||||
context.push_jump();
|
||||
select_coord<mode>(buffer, buffer.line_count() - 1, context.selections());
|
||||
|
@ -233,6 +236,7 @@ void goto_commands(Context& context, NormalParams params)
|
|||
"g,k: buffer top \n"
|
||||
"l: line end \n"
|
||||
"h: line begin \n"
|
||||
"i: line non blank start\n"
|
||||
"j: buffer bottom \n"
|
||||
"e: buffer end \n"
|
||||
"t: window top \n"
|
||||
|
|
|
@ -181,6 +181,14 @@ Selection select_to_line_begin(const Buffer& buffer, const Selection& selection)
|
|||
template Selection select_to_line_begin<false>(const Buffer&, const Selection&);
|
||||
template Selection select_to_line_begin<true>(const Buffer&, const Selection&);
|
||||
|
||||
Selection select_to_first_non_blank(const Buffer& buffer, const Selection& selection)
|
||||
{
|
||||
auto it = buffer.iterator_at(selection.cursor().line);
|
||||
skip_while(it, buffer.iterator_at(selection.cursor().line+1),
|
||||
is_horizontal_blank);
|
||||
return {it.coord()};
|
||||
}
|
||||
|
||||
Selection select_matching(const Buffer& buffer, const Selection& selection)
|
||||
{
|
||||
Vector<Codepoint> matching_pairs = { '(', ')', '{', '}', '[', ']', '<', '>' };
|
||||
|
|
|
@ -40,6 +40,8 @@ Selection select_to_line_end(const Buffer& buffer, const Selection& selection);
|
|||
template<bool only_move>
|
||||
Selection select_to_line_begin(const Buffer& buffer, const Selection& selection);
|
||||
|
||||
Selection select_to_first_non_blank(const Buffer& buffer, const Selection& selection);
|
||||
|
||||
enum class ObjectFlags
|
||||
{
|
||||
ToBegin = 1,
|
||||
|
|
Loading…
Reference in New Issue
Block a user