Skip to content

Commit

Permalink
Update line before Alt+Enter, fix delete_current_line crash (821).
Browse files Browse the repository at this point in the history
  • Loading branch information
AliceLR committed May 26, 2021
1 parent f8f4685 commit e656628
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 deletions.
8 changes: 6 additions & 2 deletions docs/changelog.txt
Expand Up @@ -105,8 +105,12 @@ USERS
ending with ? to sometimes fail.
+ Fixed a bug where multichar char tile movement could still
sometimes jump to the -/+/= chars in the main charset.
+ Opening the block action menu in the robot editor now updates
the contents of the current line.
+ Opening the block action menu in the robot editor (either with
Alt+B or Alt+Enter) now updates the current line, fixing bugs
where it could copy old line contents to the buffer.
+ Fixed a robot editor crash that could occur when combining two
lines with backspace or delete if one of the lines contained
the start or end block mark.
+ Fixed a bug in the robot editor where Ctrl+Home and Ctrl+End
would only set the current line (and not the current column).
+ Fixed a robot editor extended macro crash that would occur:
Expand Down
9 changes: 6 additions & 3 deletions src/editor/robo_ed.c
Expand Up @@ -241,10 +241,10 @@ static void delete_current_line(struct robot_editor_context *rstate, int move)
if(rstate->mark_mode)
{
if(rstate->mark_start_rline == current_rline)
rstate->mark_start_rline = current_rline->next;
rstate->mark_start_rline = next;

if(rstate->mark_end_rline == current_rline)
rstate->mark_end_rline = current_rline->previous;
rstate->mark_end_rline = previous;

if(rstate->mark_start > rstate->current_line)
rstate->mark_start--;
Expand Down Expand Up @@ -3976,8 +3976,11 @@ static boolean robot_editor_key(context *ctx, int *key)

case IKEY_RETURN:
{
// Block action menu (also see Alt+B).
if(get_alt_status(keycode_internal))
{
end_intake_undo_frame(rstate);
update_current_line(rstate, true);
block_action(rstate);
}
else
Expand Down Expand Up @@ -4293,7 +4296,7 @@ static boolean robot_editor_key(context *ctx, int *key)
break;
}

// Block action menu
// Block action menu (also see Alt+Enter).
case IKEY_b:
{
if(get_alt_status(keycode_internal))
Expand Down

0 comments on commit e656628

Please sign in to comment.