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
|
* `gh`: select to line begin
|
||||||
* `gl`: select to line end
|
* `gl`: select to line end
|
||||||
|
* `gi`: select to line begin (non blank)
|
||||||
|
|
||||||
* `gg`, `gk`: go to the first line
|
* `gg`, `gk`: go to the first line
|
||||||
* `gj`: go to the last line
|
* `gj`: go to the last line
|
||||||
|
|
|
@ -306,6 +306,7 @@ Changes
|
||||||
|
|
||||||
Goto Commands
|
Goto Commands
|
||||||
-------------
|
-------------
|
||||||
|
|
||||||
If a count is given prior to hitting *g*, *g* will jump to the given line
|
If a count is given prior to hitting *g*, *g* will jump to the given line
|
||||||
|
|
||||||
*gh*::
|
*gh*::
|
||||||
|
@ -314,6 +315,9 @@ If a count is given prior to hitting *g*, *g* will jump to the given line
|
||||||
*gl*::
|
*gl*::
|
||||||
select to line end
|
select to line end
|
||||||
|
|
||||||
|
*gi*::
|
||||||
|
select to non blank line start
|
||||||
|
|
||||||
*gg*, *gk*::
|
*gg*, *gk*::
|
||||||
go to the first line
|
go to the first line
|
||||||
|
|
||||||
|
|
|
@ -141,6 +141,9 @@ void goto_commands(Context& context, NormalParams params)
|
||||||
case 'h':
|
case 'h':
|
||||||
select<mode, select_to_line_begin<true>>(context, {});
|
select<mode, select_to_line_begin<true>>(context, {});
|
||||||
break;
|
break;
|
||||||
|
case 'i':
|
||||||
|
select<mode, select_to_first_non_blank>(context, {});
|
||||||
|
break;
|
||||||
case 'j':
|
case 'j':
|
||||||
context.push_jump();
|
context.push_jump();
|
||||||
select_coord<mode>(buffer, buffer.line_count() - 1, context.selections());
|
select_coord<mode>(buffer, buffer.line_count() - 1, context.selections());
|
||||||
|
@ -230,17 +233,18 @@ void goto_commands(Context& context, NormalParams params)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}, "goto",
|
}, "goto",
|
||||||
"g,k: buffer top \n"
|
"g,k: buffer top \n"
|
||||||
"l: line end \n"
|
"l: line end \n"
|
||||||
"h: line begin \n"
|
"h: line begin \n"
|
||||||
"j: buffer bottom \n"
|
"i: line non blank start\n"
|
||||||
"e: buffer end \n"
|
"j: buffer bottom \n"
|
||||||
"t: window top \n"
|
"e: buffer end \n"
|
||||||
"b: window bottom \n"
|
"t: window top \n"
|
||||||
"c: window center \n"
|
"b: window bottom \n"
|
||||||
"a: last buffer \n"
|
"c: window center \n"
|
||||||
"f: file \n"
|
"a: last buffer \n"
|
||||||
".: last buffer change\n");
|
"f: file \n"
|
||||||
|
".: last buffer change \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<false>(const Buffer&, const Selection&);
|
||||||
template Selection select_to_line_begin<true>(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)
|
Selection select_matching(const Buffer& buffer, const Selection& selection)
|
||||||
{
|
{
|
||||||
Vector<Codepoint> matching_pairs = { '(', ')', '{', '}', '[', ']', '<', '>' };
|
Vector<Codepoint> matching_pairs = { '(', ')', '{', '}', '[', ']', '<', '>' };
|
||||||
|
|
|
@ -40,6 +40,8 @@ Selection select_to_line_end(const Buffer& buffer, const Selection& selection);
|
||||||
template<bool only_move>
|
template<bool only_move>
|
||||||
Selection select_to_line_begin(const Buffer& buffer, const Selection& selection);
|
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
|
enum class ObjectFlags
|
||||||
{
|
{
|
||||||
ToBegin = 1,
|
ToBegin = 1,
|
||||||
|
|
Loading…
Reference in New Issue
Block a user