Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
F
fuchsia.googlesource.com-third_party-rust-mirrors-rustyline
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Analyze
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
fuchsia-mirror
fuchsia.googlesource.com-third_party-rust-mirrors-rustyline
Commits
98b50b67
Commit
98b50b67
authored
8 years ago
by
gwenn
Browse files
Options
Downloads
Patches
Plain Diff
Fix vi redo
parent
d021db76
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/keymap.rs
+9
-1
9 additions, 1 deletion
src/keymap.rs
with
9 additions
and
1 deletion
src/keymap.rs
+
9
−
1
View file @
98b50b67
...
@@ -168,6 +168,7 @@ pub struct EditState {
...
@@ -168,6 +168,7 @@ pub struct EditState {
// numeric arguments: http://web.mit.edu/gnu/doc/html/rlman_1.html#SEC7
// numeric arguments: http://web.mit.edu/gnu/doc/html/rlman_1.html#SEC7
num_args
:
i16
,
num_args
:
i16
,
last_cmd
:
Cmd
,
// vi only
last_cmd
:
Cmd
,
// vi only
consecutive_insert
:
bool
,
last_char_search
:
Option
<
CharSearch
>
,
// vi only
last_char_search
:
Option
<
CharSearch
>
,
// vi only
}
}
...
@@ -178,6 +179,7 @@ impl EditState {
...
@@ -178,6 +179,7 @@ impl EditState {
insert
:
true
,
insert
:
true
,
num_args
:
0
,
num_args
:
0
,
last_cmd
:
Cmd
::
Noop
,
last_cmd
:
Cmd
::
Noop
,
consecutive_insert
:
false
,
last_char_search
:
None
,
last_char_search
:
None
,
}
}
}
}
...
@@ -500,6 +502,10 @@ impl EditState {
...
@@ -500,6 +502,10 @@ impl EditState {
if
cmd
.is_repeatable_change
()
{
if
cmd
.is_repeatable_change
()
{
self
.update_last_cmd
(
cmd
.clone
());
self
.update_last_cmd
(
cmd
.clone
());
}
}
self
.consecutive_insert
=
match
cmd
{
Cmd
::
SelfInsert
(
_
,
_
)
=>
true
,
_
=>
false
,
};
Ok
(
cmd
)
Ok
(
cmd
)
}
}
...
@@ -686,7 +692,9 @@ impl EditState {
...
@@ -686,7 +692,9 @@ impl EditState {
fn
update_last_cmd
(
&
mut
self
,
new
:
Cmd
)
{
fn
update_last_cmd
(
&
mut
self
,
new
:
Cmd
)
{
// consecutive char inserts are repeatable not only the last one...
// consecutive char inserts are repeatable not only the last one...
if
let
Cmd
::
SelfInsert
(
_
,
c
)
=
new
{
if
!
self
.consecutive_insert
{
self
.last_cmd
=
new
;
}
else
if
let
Cmd
::
SelfInsert
(
_
,
c
)
=
new
{
match
self
.last_cmd
{
match
self
.last_cmd
{
Cmd
::
SelfInsert
(
_
,
pc
)
=>
{
Cmd
::
SelfInsert
(
_
,
pc
)
=>
{
let
mut
text
=
String
::
new
();
let
mut
text
=
String
::
new
();
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment