summaryrefslogtreecommitdiff
path: root/command.c
diff options
context:
space:
mode:
authorLeo Tenenbaum <pommicket@gmail.com>2021-02-11 15:13:11 -0500
committerLeo Tenenbaum <pommicket@gmail.com>2021-02-11 15:13:11 -0500
commit9396a9f602727bc78d7c9dcc95142038edfad51a (patch)
treeb6afc92e959590ebde903969f914459e9d25c760 /command.c
parent143ed955b939b3292801fb9503ad8759467defcd (diff)
fixed some problems with find+replace
Diffstat (limited to 'command.c')
-rw-r--r--command.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/command.c b/command.c
index 9cc7ad7..8db46f9 100644
--- a/command.c
+++ b/command.c
@@ -99,7 +99,7 @@ void command_execute(Ted *ted, Command c, i64 argument) {
case CMD_TAB:
if (ted->replace && buffer == &ted->find_buffer) {
- ted->active_buffer = &ted->replace_buffer;
+ buffer = ted->active_buffer = &ted->replace_buffer;
buffer_select_all(buffer);
} else if (buffer) {
if (buffer->selection)
@@ -109,9 +109,9 @@ void command_execute(Ted *ted, Command c, i64 argument) {
}
break;
case CMD_BACKTAB:
- if (ted->replace && ted->active_buffer == &ted->replace_buffer) {
- ted->active_buffer = &ted->find_buffer;
- buffer_select_all(ted->active_buffer);
+ if (ted->replace && buffer == &ted->replace_buffer) {
+ buffer = ted->active_buffer = &ted->find_buffer;
+ buffer_select_all(buffer);
} else if (buffer) {
if (buffer->selection)
buffer_dedent_selection(buffer);