Notepad-like mode crash bug fixes

master
Allen Webster 2020-05-01 06:52:22 -07:00
parent 2d1d69e2c9
commit 5561704e2e
2 changed files with 19 additions and 7 deletions

View File

@ -454,10 +454,21 @@ CUSTOM_DOC("Inserts text and auto-indents the line on which the cursor sits if a
if (do_auto_indent){
View_ID view = get_active_view(app, Access_ReadWriteVisible);
Buffer_ID buffer = view_get_buffer(app, view, Access_ReadWriteVisible);
Range_i64 pos = {};
pos.min = view_get_cursor_pos(app, view);
if (view_has_highlighted_range(app, view)){
pos = get_view_range(app, view);
}
else{
pos.min = pos.max = view_get_cursor_pos(app, view);
}
write_text_input(app);
pos.max= view_get_cursor_pos(app, view);
i64 end_pos = view_get_cursor_pos(app, view);
pos.min = Min(pos.min, end_pos);
pos.max = Max(pos.max, end_pos);
auto_indent_buffer(app, buffer, pos, 0);
move_past_lead_whitespace(app, view, buffer);
}

View File

@ -5,6 +5,7 @@
+ Fix: when generated/metadata* files are missing buildsuper still succeeds
+ Fix: mac does not hang opening multiple files
+ Fix: line number margin performance
+ Fix: crash in notepade like mode when replacing a highlighted range in a parsed file
4.1.4
+ MAJOR: The clipboard history is now a fully custom layer implemented system. Users maintaining a customization layer should try to update their call sites to the old clipboard API. #define FCODER_TRANSITION_TO 4001004 to disable the transitional function wrappers when you are ready to make the transition.