diff --git a/FOCUS-CHANGELOG.txt b/FOCUS-CHANGELOG.txt index 4813b13e8..fdbbbf8f5 100644 --- a/FOCUS-CHANGELOG.txt +++ b/FOCUS-CHANGELOG.txt @@ -1,10 +1,23 @@ # Main Git Branch ++ New features: + + ... ++ Bug fixes: + + ... ++ Other changes: + + ... + + +# RELEASES ================================================================== + +# Version 0.3.7 + + New features: + New command: `move_current_file`. Works as `save_as`, but removes the old file (thanks @simonvallz) + New config options: + `search_is_case_sensitive_when_uppercase_present`. Set to `true` to automatically make local search case sensitive when there are uppercase chars in the search bar. Currently only works with ASCII. + `projects_sorting_order`: `most_recent_first` (default), `alphabetical` or `alphabetical_no_case`. Determines the sorting order for projects in the Switch To Project dialog. (thanks @Roman-Skabin for the fix) + + Option `strip_trailing_whitespace_on_save` now accepts the following values: `all` (strip all trailing whitespace), `except_lines_with_cursor` (leave cursors where they are), and `disabled` (don't strip) + Pressing the close active editor shortcut in the Open Files dialog will close the selected file + When reloading workspace the user will be able to kill any running build command via a confirmation dialog + Build commands can be killed and restarted via a confirmation dialog (previously any running commands had to be manually killed before starting another one) @@ -17,7 +30,6 @@ + Fixed a bug with typing the letter 'q' when trying to exit the editor via Cmd-Q + Other changes: + Various highlighting improvements (thanks @simonvallz) - + When you strip trailing whitespace on save the cursors will now stay where they are. Use the explicit command `strip_trailing_whitespace` if you want to strip all trailing whitespace even if there is a cursor on it + Temporary unsaved buffers will disappear from file lists when closed. If you accidentally closed one, go back in editor history + The `delete_to_start_of_line` command will now delete to the indentation level first, not to the very start of the line right away + Many internal changes to reduce the memory footprint and improve the cache friendliness of internal data structures @@ -25,8 +37,6 @@ + Hitting save when in the color preview editor will save the target config file, instead of attempting to save the color preview sample text somewhere -# RELEASES ================================================================== - # Version 0.3.6 + New features: diff --git a/config/default.focus-config b/config/default.focus-config index 54dc503c3..6e3a9e198 100644 --- a/config/default.focus-config +++ b/config/default.focus-config @@ -1,4 +1,4 @@ -[5] # Version number. Do not delete. +[6] # Version number. Do not delete. [[workspace]] # These directories and files will be scanned when a workspace is opened so that search etc. works. @@ -37,12 +37,12 @@ cursor_blink_time_in_seconds: 5 highlight_selection_occurrences: true highlight_line_with_cursor: false highlight_matching_brackets: false -disable_that_annoying_paste_effect: false +show_paste_effect: true disable_file_open_close_animations: false double_shift_to_search_in_workspace: false tab_size: 4 insert_spaces_when_pressing_tab: true -strip_trailing_whitespace_on_save: false +strip_trailing_whitespace_on_save: except_lines_with_cursor smooth_scrolling: true scroll_beyond_last_line: true line_height_scale_percent: 120 diff --git a/config/default_macos.focus-config b/config/default_macos.focus-config index f4b569981..02ff0abfa 100644 --- a/config/default_macos.focus-config +++ b/config/default_macos.focus-config @@ -1,4 +1,4 @@ -[5] # Version number. Do not delete. +[6] # Version number. Do not delete. [[workspace]] # These directories and files will be scanned when a workspace is opened so that search etc. works. @@ -37,11 +37,11 @@ cursor_blink_time_in_seconds: 5 highlight_selection_occurrences: true highlight_line_with_cursor: false highlight_matching_brackets: false -disable_that_annoying_paste_effect: false +show_paste_effect: true disable_file_open_close_animations: false tab_size: 4 insert_spaces_when_pressing_tab: true -strip_trailing_whitespace_on_save: false +strip_trailing_whitespace_on_save: except_lines_with_cursor smooth_scrolling: true scroll_beyond_last_line: true double_shift_to_search_in_workspace: false diff --git a/config/example-project.focus-config b/config/example-project.focus-config index fe965f5e4..bf2c04455 100644 --- a/config/example-project.focus-config +++ b/config/example-project.focus-config @@ -1,4 +1,4 @@ -[5] # Version number. Do not delete. +[6] # Version number. Do not delete. [[workspace]] # These directories and files will be scanned when a workspace is opened so that search etc. works. diff --git a/config/themes/basic-light.focus-theme b/config/themes/basic-light.focus-theme index 70880b5c2..d02906b39 100644 --- a/config/themes/basic-light.focus-theme +++ b/config/themes/basic-light.focus-theme @@ -1,4 +1,4 @@ -[5] # Version number. Do not delete +[6] # Version number. Do not delete [colors] background0: FFFFFFFF diff --git a/config/themes/everforest-hard.focus-theme b/config/themes/everforest-hard.focus-theme index 70880b5c2..d02906b39 100644 --- a/config/themes/everforest-hard.focus-theme +++ b/config/themes/everforest-hard.focus-theme @@ -1,4 +1,4 @@ -[5] # Version number. Do not delete +[6] # Version number. Do not delete [colors] background0: FFFFFFFF diff --git a/config/themes/gruber-darker.focus-theme b/config/themes/gruber-darker.focus-theme index caeaaecd0..9a4b246db 100644 --- a/config/themes/gruber-darker.focus-theme +++ b/config/themes/gruber-darker.focus-theme @@ -1,4 +1,4 @@ -[5] # Version number. Do not delete +[6] # Version number. Do not delete # Based on the gruber darker theme by Jason Blevins # https://github.com/rexim/gruber-darker-theme diff --git a/config/themes/gruvbox-flat.focus-theme b/config/themes/gruvbox-flat.focus-theme index 255e6f57f..bc49509c0 100644 --- a/config/themes/gruvbox-flat.focus-theme +++ b/config/themes/gruvbox-flat.focus-theme @@ -1,4 +1,4 @@ -[5] # Version number. Do not delete +[6] # Version number. Do not delete [colors] diff --git a/config/themes/halogen.focus-theme b/config/themes/halogen.focus-theme index ab52175cd..218a5572c 100644 --- a/config/themes/halogen.focus-theme +++ b/config/themes/halogen.focus-theme @@ -1,4 +1,4 @@ -[5] # Version number. Do not delete +[6] # Version number. Do not delete [colors] background0: 181818FF diff --git a/config/themes/handmade-hero.focus-theme b/config/themes/handmade-hero.focus-theme index cba6bf36c..db587c2f5 100644 --- a/config/themes/handmade-hero.focus-theme +++ b/config/themes/handmade-hero.focus-theme @@ -1,4 +1,4 @@ -[5] # Version number. Do not delete +[6] # Version number. Do not delete # Based on Casey Muratori's emacs theme used on Handmade Hero series diff --git a/config/themes/jblow-nostalgia.focus-theme b/config/themes/jblow-nostalgia.focus-theme index fd55b3d0a..ba679fbd9 100644 --- a/config/themes/jblow-nostalgia.focus-theme +++ b/config/themes/jblow-nostalgia.focus-theme @@ -1,4 +1,4 @@ -[5] # Version number. Do not delete +[6] # Version number. Do not delete [colors] diff --git a/config/themes/jblowtorch.focus-theme b/config/themes/jblowtorch.focus-theme index f7e3774f9..3c68aa504 100644 --- a/config/themes/jblowtorch.focus-theme +++ b/config/themes/jblowtorch.focus-theme @@ -1,4 +1,4 @@ -[5] # Version number. Do not delete +[6] # Version number. Do not delete [colors] background0: 072626FF diff --git a/config/themes/nord-midnight.focus-theme b/config/themes/nord-midnight.focus-theme index b5dd63e77..cd004b301 100644 --- a/config/themes/nord-midnight.focus-theme +++ b/config/themes/nord-midnight.focus-theme @@ -1,4 +1,4 @@ -[5] # Version number. Do not delete +[6] # Version number. Do not delete [colors] background0: 1D2129FF diff --git a/config/themes/nord.focus-theme b/config/themes/nord.focus-theme index 583e3af39..e6ec06e23 100644 --- a/config/themes/nord.focus-theme +++ b/config/themes/nord.focus-theme @@ -1,4 +1,4 @@ -[5] # Version number. Do not delete +[6] # Version number. Do not delete [colors] background0: 2E3440FF diff --git a/config/themes/solarized-dark.focus-theme b/config/themes/solarized-dark.focus-theme index 1c024e3aa..1ea1c0609 100644 --- a/config/themes/solarized-dark.focus-theme +++ b/config/themes/solarized-dark.focus-theme @@ -1,4 +1,4 @@ -[5] # Version number. Do not delete +[6] # Version number. Do not delete [colors] background0: 002B36FF diff --git a/config/themes/spacemacs-light.focus-theme b/config/themes/spacemacs-light.focus-theme index 425b8c7fa..477afc0f6 100644 --- a/config/themes/spacemacs-light.focus-theme +++ b/config/themes/spacemacs-light.focus-theme @@ -1,4 +1,4 @@ -[5] # Version number. Do not delete +[6] # Version number. Do not delete [colors] background0: fbf8efFF diff --git a/config/themes/steel-breeze.focus-theme b/config/themes/steel-breeze.focus-theme index 4ec303f14..9962de5cb 100644 --- a/config/themes/steel-breeze.focus-theme +++ b/config/themes/steel-breeze.focus-theme @@ -1,4 +1,4 @@ -[5] # Version number. Do not delete +[6] # Version number. Do not delete [colors] diff --git a/config/themes/tokyo-night-light.focus-theme b/config/themes/tokyo-night-light.focus-theme index e5273ccc3..4c31a756b 100644 --- a/config/themes/tokyo-night-light.focus-theme +++ b/config/themes/tokyo-night-light.focus-theme @@ -1,4 +1,4 @@ -[5] # Version number. Do not delete +[6] # Version number. Do not delete [colors] background0: D5D6DBFF diff --git a/config/themes/tokyo-night.focus-theme b/config/themes/tokyo-night.focus-theme index 239f0cb61..44dd06fa3 100644 --- a/config/themes/tokyo-night.focus-theme +++ b/config/themes/tokyo-night.focus-theme @@ -1,4 +1,4 @@ -[5] # Version number. Do not delete +[6] # Version number. Do not delete [colors] background0: 1A1B26FF diff --git a/config/themes/zenburn.focus-theme b/config/themes/zenburn.focus-theme index 208e98015..e52d6ff62 100644 --- a/config/themes/zenburn.focus-theme +++ b/config/themes/zenburn.focus-theme @@ -1,4 +1,4 @@ -[5] # Version number. Do not delete +[6] # Version number. Do not delete # Based on the original Zenburn Vim theme: # https://github.com/jnurmine/Zenburn/blob/master/colors/zenburn.vim diff --git a/first.jai b/first.jai index 2599f7787..c0b86777f 100644 --- a/first.jai +++ b/first.jai @@ -1,16 +1,16 @@ -VERSION :: #run -> string { - result, revision := run_command("git", "rev-parse", "--short", "HEAD", capture_and_return_output = true); - if revision return sprint("0.3.6-%", trim(revision)); - return "0.3.6-dev"; -} -RELEASE_DATE :: #run -> string { - current_time := to_calendar(current_time_consensus()); - return calendar_to_string(current_time); -} - -// // NOTE: Uncomment when releasing, comment out when not releasing -// VERSION :: "0.3.6"; -// RELEASE_DATE :: "26 August 2024"; +// VERSION :: #run -> string { +// result, revision := run_command("git", "rev-parse", "--short", "HEAD", capture_and_return_output = true); +// if revision return sprint("0.3.7-%", trim(revision)); +// return "0.3.7-dev"; +// } +// RELEASE_DATE :: #run -> string { +// current_time := to_calendar(current_time_consensus()); +// return calendar_to_string(current_time); +// } + +// NOTE: Uncomment when releasing, comment out when not releasing +VERSION :: "0.3.7"; +RELEASE_DATE :: "15 September 2024"; #run,stallable build(); diff --git a/src/buffer.jai b/src/buffer.jai index 766f1a94b..b2e6105b0 100644 --- a/src/buffer.jai +++ b/src/buffer.jai @@ -715,7 +715,9 @@ save_buffer :: (using buffer: *Buffer, buffer_id: s64) { assert(has_file, "Trying to save a buffer without an associated file. This is a bug."); - if config.settings.strip_trailing_whitespace_on_save then strip_trailing_whitespace(buffer, buffer_id, on_save = true); + if config.settings.strip_trailing_whitespace_on_save != .disabled { + strip_trailing_whitespace(buffer, buffer_id, except_lines_with_cursor = config.settings.strip_trailing_whitespace_on_save == .except_lines_with_cursor); + } if config.settings.insert_final_newline_on_save then insert_final_newline(buffer); // important to do it after stripping success := write_entire_file(file.full_path, to_string(bytes)); @@ -788,7 +790,7 @@ delete_buffer_from_disk :: (using buffer: *Buffer) -> deleted: bool { return true; } -strip_trailing_whitespace :: (using buffer: *Buffer, buffer_id: s64, on_save := false) { +strip_trailing_whitespace :: (using buffer: *Buffer, buffer_id: s64, except_lines_with_cursor := false) { auto_release_temp(); // Get active cursor positions if we're saving the active buffer @@ -811,7 +813,7 @@ strip_trailing_whitespace :: (using buffer: *Buffer, buffer_id: s64, on_save := line := string.{ count = line_end - line_start, data = bytes.data + line_start }; pos_of_rightmost_cursor_on_this_line := -1; - if on_save { + if except_lines_with_cursor { // Keep cursors where they are c := active_cursors; for pos : c { diff --git a/src/config.jai b/src/config.jai index e24ac98c1..0fd9b170b 100644 --- a/src/config.jai +++ b/src/config.jai @@ -1,4 +1,4 @@ -CURRENT_CONFIG_VERSION :: 5; +CURRENT_CONFIG_VERSION :: 6; load_global_config :: (fallback_to_default_on_failure := false, force := false) -> success: bool, changed: bool, there_were_warnings: bool { config_path := tprint("%/global.focus-config", config_dir); @@ -548,13 +548,13 @@ Settings :: struct { highlight_selection_occurrences := true; highlight_line_with_cursor := false; highlight_matching_brackets := false; - disable_that_annoying_paste_effect := false; + show_paste_effect := true; disable_file_open_close_animations := false; disable_viewport_chasing_cursor_near_the_edge := false; double_shift_to_search_in_workspace := false; tab_size := 4; insert_spaces_when_pressing_tab := true; - strip_trailing_whitespace_on_save := false; + strip_trailing_whitespace_on_save := Strip_Trailing_Whitespace.except_lines_with_cursor; insert_final_newline_on_save := false; smooth_scrolling := true; scroll_beyond_last_line := true; @@ -600,6 +600,12 @@ Status_Bar_Position :: enum { top; } +Strip_Trailing_Whitespace :: enum { + except_lines_with_cursor; + all; + disabled; +} + Color_Preview_Popup :: enum { enabled; minimized; diff --git a/src/config_migrator.jai b/src/config_migrator.jai index a7976c519..b3eeb61af 100644 --- a/src/config_migrator.jai +++ b/src/config_migrator.jai @@ -378,10 +378,27 @@ DONE setting_name, setting_value := break_by_spaces(line); setting_name = trim_right(setting_name, ":"); - // TODO: check version when we have version [3] - for removed : REMOVED_SETTINGS { - if setting_name == removed.name { - offset_difference += replace_line(*modified_data, line_start_offset, ""); + for setting : RENAMED_SETTINGS { + if setting_name == setting.name && valid_version(setting.version, config_info.version) { + if !setting.new_name { + // Removed setting + offset_difference += replace_line(*modified_data, line_start_offset, ""); + } else { + // Renamed setting + indent := cast(s64) (setting_value.data - setting_name.data); + padding := get_tmp_spaces(indent - setting.new_name.count - 1); + comment := ifx setting.comment then tprint(" # %", setting.comment) else ""; + + value := setting_value; + for map : setting.value_map { + if setting_value == map.old_value { + value = map.new_value; + break; + } + } + new_line := tprint("%1:%2%3%4\n", setting.new_name, padding, value, comment); + offset_difference += replace_line(*modified_data, line_start_offset, new_line); + } } } @@ -477,10 +494,15 @@ ADDED_SETTINGS :: Added_Setting.[ .{ 5, "load_most_recent_project_on_start", "false" }, .{ 5, "color_preview_popup", "enabled # options: enabled, minimized, disabled" }, .{ 5, "highlight_matching_brackets", "false" }, + + .{ 6, "search_is_case_sensitive_when_uppercase_present", "false" }, + .{ 6, "projects_sorting_order", "most_recent_first #options: most_recent_first, alphabetical, alphabetical_no_case" }, ]; -REMOVED_SETTINGS :: Removed_Setting.[ - .{ 2, "max_entries_in_open_file_dialog" }, +RENAMED_SETTINGS :: Renamed_Setting.[ + .{ 2, "max_entries_in_open_file_dialog", "", .[], "" }, // removed + .{ 6, "strip_trailing_whitespace_on_save", "strip_trailing_whitespace_on_save", .[.{"true", "except_lines_with_cursor"}, .{"false", "disabled"}], "options: all, except_lines_with_cursor, disabled"}, + .{ 6, "disable_that_annoying_paste_effect", "show_paste_effect", .[.{"true", "false"}, .{"false", "true"}], ""}, ]; SETTING_VALUES_INDENT :: #run -> int { @@ -611,9 +633,17 @@ Added_Setting :: struct { value: string; } -Removed_Setting :: struct { - version: int; - name: string; +Renamed_Setting :: struct { + version: int; + name: string; + new_name: string; + value_map: [] Value_Map; + comment: string; + + Value_Map :: struct { + old_value: string; + new_value: string; + } } Added_Color :: struct { @@ -732,7 +762,7 @@ todo.txt : todo FOCUS_CONFIG WORKSPACE_3_EXPECTED :: #string FOCUS_CONFIG -[5] # Version number. Do not delete. +[6] # Version number. Do not delete. [[workspace]] # These directories and files will be scanned when a workspace is opened so that search etc. works. @@ -789,7 +819,7 @@ C:/projects/project1 FOCUS_CONFIG PROJECT_WORKSPACE_3_EXPECTED :: #string FOCUS_CONFIG -[5] # Version number. Do not delete. +[6] # Version number. Do not delete. [[workspace]] # These directories and files will be scanned when a workspace is opened so that search etc. works. @@ -845,7 +875,7 @@ todo.txt : todo FOCUS_CONFIG WORKSPACE_4_EXPECTED :: #string FOCUS_CONFIG -[5] # Version number. Do not delete. +[6] # Version number. Do not delete. [[keymap]] [common] @@ -904,6 +934,7 @@ Ctrl-P show_open_file_dialog_in_search_mode [[settings]] maximize_on_start: false +disable_that_annoying_paste_effect: false tab_size: 4 build_panel_width_percent: 50 max_entries_in_open_file_dialog: 2000 @@ -911,11 +942,12 @@ insert_spaces_when_pressing_tab: true prefer_system_file_dialogs: false # Windows only show_cursors_off_screen: true persist_local_search_results: false +strip_trailing_whitespace_on_save: true FOCUS_CONFIG SETTINGS_1_EXPECTED :: #string FOCUS_CONFIG -[5] # Version number. Do not delete. +[6] # Version number. Do not delete. [[workspace]] # These directories and files will be scanned when a workspace is opened so that search etc. works. @@ -931,7 +963,7 @@ SETTINGS_1_EXPECTED :: #string FOCUS_CONFIG [common] Ctrl-P open_file_by_name -# Added after migration to version [5] +# Added after migration to version [6] Ctrl-B toggle_build_panel F11 toggle_fullscreen Ctrl-Tab switch_between_open_files @@ -945,32 +977,36 @@ Shift-Ctrl-F8 go_to_previous_build_error_on_the_side [[settings]] maximize_on_start: false +show_paste_effect: true tab_size: 4 build_panel_width_percent: 50 insert_spaces_when_pressing_tab: true prefer_system_file_dialogs: false # Windows only show_cursors_off_screen: true persist_local_search_results: false - -# Added after migration to version [5] -build_panel_height_percent: 50 -build_panel_stays_in_one_place: false # if false, the build panel will flip to the inactive pane in two pane layouts -build_panel_line_wrap_always_on: true -highlight_line_with_cursor: false -draw_indent_guides: false -auto_surround_with_brackets_and_quotes: false -scroll_beyond_last_line: true -save_current_buffer_on_build: false -save_all_file_backed_buffers_on_build: false -disable_viewport_chasing_cursor_near_the_edge: false # if true, the viewport will not scroll smoothly to cursor when you move the cursor outside it by small amounts -show_selected_text_length: false -window_width: -1 -window_height: -1 -insert_final_newline_on_save: false -status_bar_position: bottom # options: top, bottom -load_most_recent_project_on_start: false -color_preview_popup: enabled # options: enabled, minimized, disabled -highlight_matching_brackets: false +strip_trailing_whitespace_on_save: except_lines_with_cursor # options: all, except_lines_with_cursor, disabled + +# Added after migration to version [6] +build_panel_height_percent: 50 +build_panel_stays_in_one_place: false # if false, the build panel will flip to the inactive pane in two pane layouts +build_panel_line_wrap_always_on: true +highlight_line_with_cursor: false +draw_indent_guides: false +auto_surround_with_brackets_and_quotes: false +scroll_beyond_last_line: true +save_current_buffer_on_build: false +save_all_file_backed_buffers_on_build: false +disable_viewport_chasing_cursor_near_the_edge: false # if true, the viewport will not scroll smoothly to cursor when you move the cursor outside it by small amounts +show_selected_text_length: false +window_width: -1 +window_height: -1 +insert_final_newline_on_save: false +status_bar_position: bottom # options: top, bottom +load_most_recent_project_on_start: false +color_preview_popup: enabled # options: enabled, minimized, disabled +highlight_matching_brackets: false +search_is_case_sensitive_when_uppercase_present: false +projects_sorting_order: most_recent_first #options: most_recent_first, alphabetical, alphabetical_no_case FOCUS_CONFIG @@ -1001,6 +1037,8 @@ insert_spaces_when_pressing_tab: true prefer_system_file_dialogs: false # Windows only show_cursors_off_screen: true persist_local_search_results: false +disable_that_annoying_paste_effect: true +strip_trailing_whitespace_on_save: false # Added after migration to version [2] highlight_line_with_cursor: false @@ -1011,7 +1049,7 @@ scroll_beyond_last_line: true FOCUS_CONFIG SETTINGS_2_EXPECTED :: #string FOCUS_CONFIG -[5] # Version number. Do not delete. +[6] # Version number. Do not delete. [[workspace]] # These directories and files will be scanned when a workspace is opened so that search etc. works. @@ -1032,7 +1070,7 @@ Ctrl-B toggle_build_panel F11 toggle_fullscreen Ctrl-Tab switch_between_open_files -# Added after migration to version [5] +# Added after migration to version [6] Ctrl-Shift-Alt-N open_another_editor_instance F8 go_to_next_build_error Ctrl-F8 go_to_next_build_error_on_the_side @@ -1049,6 +1087,8 @@ insert_spaces_when_pressing_tab: true prefer_system_file_dialogs: false # Windows only show_cursors_off_screen: true persist_local_search_results: false +show_paste_effect: false +strip_trailing_whitespace_on_save: disabled # options: all, except_lines_with_cursor, disabled # Added after migration to version [2] highlight_line_with_cursor: false @@ -1056,18 +1096,20 @@ draw_indent_guides: false auto_surround_with_brackets_and_quotes: false scroll_beyond_last_line: true -# Added after migration to version [5] -save_current_buffer_on_build: false -save_all_file_backed_buffers_on_build: false -disable_viewport_chasing_cursor_near_the_edge: false # if true, the viewport will not scroll smoothly to cursor when you move the cursor outside it by small amounts -show_selected_text_length: false -window_width: -1 -window_height: -1 -insert_final_newline_on_save: false -status_bar_position: bottom # options: top, bottom -load_most_recent_project_on_start: false -color_preview_popup: enabled # options: enabled, minimized, disabled -highlight_matching_brackets: false +# Added after migration to version [6] +save_current_buffer_on_build: false +save_all_file_backed_buffers_on_build: false +disable_viewport_chasing_cursor_near_the_edge: false # if true, the viewport will not scroll smoothly to cursor when you move the cursor outside it by small amounts +show_selected_text_length: false +window_width: -1 +window_height: -1 +insert_final_newline_on_save: false +status_bar_position: bottom # options: top, bottom +load_most_recent_project_on_start: false +color_preview_popup: enabled # options: enabled, minimized, disabled +highlight_matching_brackets: false +search_is_case_sensitive_when_uppercase_present: false +projects_sorting_order: most_recent_first #options: most_recent_first, alphabetical, alphabetical_no_case FOCUS_CONFIG @@ -1101,7 +1143,7 @@ persist_local_search_results: false FOCUS_CONFIG PROJECT_SETTINGS_1_EXPECTED :: #string FOCUS_CONFIG -[5] # Version number. Do not delete. +[6] # Version number. Do not delete. [[workspace]] # These directories and files will be scanned when a workspace is opened so that search etc. works. @@ -1110,7 +1152,7 @@ PROJECT_SETTINGS_1_EXPECTED :: #string FOCUS_CONFIG [common] Ctrl-P open_file_by_name -# Added after migration to version [5] +# Added after migration to version [6] Ctrl-B toggle_build_panel F11 toggle_fullscreen Ctrl-Tab switch_between_open_files @@ -1158,7 +1200,7 @@ scrollbar_background: FF191F4C FOCUS_CONFIG COLORS_1_EXPECTED :: #string FOCUS_CONFIG -[5] # Version number. Do not delete. +[6] # Version number. Do not delete. [[style]] @@ -1176,7 +1218,7 @@ background4: 21333FFF scrollbar_hover: FFCCCC4C scrollbar_background: FF191F4C -# Added after migration to version [5] +# Added after migration to version [6] code_warning: E4D97DFF region_scope_export: 15212AFF region_scope_file: 15212AFF @@ -1240,7 +1282,7 @@ scrollbar_background: FF191F4C FOCUS_CONFIG COLORS_2_EXPECTED :: #string FOCUS_CONFIG -[5] # Version number. Do not delete. +[6] # Version number. Do not delete. [[style]] @@ -1258,7 +1300,7 @@ background4: 21333FFF scrollbar_hover: FFCCCC4C scrollbar_background: FF191F4C -# Added after migration to version [5] +# Added after migration to version [6] region_heredoc: 10191FFF code_invalid: FF0000FF code_multiline_string: D4BC7DFF @@ -1330,7 +1372,7 @@ scrollbar_background: FF191F4C FOCUS_CONFIG COLORS_AND_SETTINGS_1_EXPECTED :: #string FOCUS_CONFIG -[5] # Version number. Do not delete. +[6] # Version number. Do not delete. [[workspace]] # These directories and files will be scanned when a workspace is opened so that search etc. works. @@ -1351,26 +1393,28 @@ insert_spaces_when_pressing_tab: true prefer_system_file_dialogs: false # Windows only show_cursors_off_screen: true -# Added after migration to version [5] -build_panel_height_percent: 50 -build_panel_stays_in_one_place: false # if false, the build panel will flip to the inactive pane in two pane layouts -build_panel_line_wrap_always_on: true -highlight_line_with_cursor: false -draw_indent_guides: false -auto_surround_with_brackets_and_quotes: false -scroll_beyond_last_line: true -persist_local_search_results: false # if true, search results will stay highlighted and you have to dismiss them using the `escape` action -save_current_buffer_on_build: false -save_all_file_backed_buffers_on_build: false -disable_viewport_chasing_cursor_near_the_edge: false # if true, the viewport will not scroll smoothly to cursor when you move the cursor outside it by small amounts -show_selected_text_length: false -window_width: -1 -window_height: -1 -insert_final_newline_on_save: false -status_bar_position: bottom # options: top, bottom -load_most_recent_project_on_start: false -color_preview_popup: enabled # options: enabled, minimized, disabled -highlight_matching_brackets: false +# Added after migration to version [6] +build_panel_height_percent: 50 +build_panel_stays_in_one_place: false # if false, the build panel will flip to the inactive pane in two pane layouts +build_panel_line_wrap_always_on: true +highlight_line_with_cursor: false +draw_indent_guides: false +auto_surround_with_brackets_and_quotes: false +scroll_beyond_last_line: true +persist_local_search_results: false # if true, search results will stay highlighted and you have to dismiss them using the `escape` action +save_current_buffer_on_build: false +save_all_file_backed_buffers_on_build: false +disable_viewport_chasing_cursor_near_the_edge: false # if true, the viewport will not scroll smoothly to cursor when you move the cursor outside it by small amounts +show_selected_text_length: false +window_width: -1 +window_height: -1 +insert_final_newline_on_save: false +status_bar_position: bottom # options: top, bottom +load_most_recent_project_on_start: false +color_preview_popup: enabled # options: enabled, minimized, disabled +highlight_matching_brackets: false +search_is_case_sensitive_when_uppercase_present: false +projects_sorting_order: most_recent_first #options: most_recent_first, alphabetical, alphabetical_no_case [[keymap]] # ... @@ -1391,7 +1435,7 @@ background4: 21333FFF scrollbar_hover: FFCCCC4C scrollbar_background: FF191F4C -# Added after migration to version [5] +# Added after migration to version [6] code_warning: E4D97DFF region_scope_export: 15212AFF region_scope_file: 15212AFF @@ -1482,7 +1526,7 @@ Ctrl-Alt-P switch_to_project FOCUS_CONFIG KEYBINDS_1_EXPECTED :: #string FOCUS_CONFIG -[5] # Version number. Do not delete. +[6] # Version number. Do not delete. [[style]] @@ -1500,7 +1544,7 @@ background4: 21333FFF scrollbar_hover: FFCCCC4C scrollbar_background: FF191F4C -# Added after migration to version [5] +# Added after migration to version [6] code_warning: E4D97DFF region_scope_export: 15212AFF region_scope_file: 15212AFF @@ -1552,7 +1596,7 @@ Ctrl-Escape remove_additional_cursors Ctrl-D select_word_or_create_another_cursor Ctrl-Shift-A select_all_occurrences -# Added after migration to version [5] +# Added after migration to version [6] Alt-Shift-I add_cursors_to_line_ends Alt-Shift-Ctrl-I add_cursors_to_line_starts Alt-A align_cursors @@ -1571,7 +1615,7 @@ Ctrl-Tab switch_between_open_files Ctrl-Alt-P switch_to_project -# Added after migration to version [5] +# Added after migration to version [6] Ctrl-B toggle_build_panel F11 toggle_fullscreen Ctrl-Tab switch_between_open_files @@ -1618,7 +1662,7 @@ Ctrl-Alt-P switch_to_project FOCUS_CONFIG KEYBINDS_2_EXPECTED :: #string FOCUS_CONFIG -[5] # Version number. Do not delete. +[6] # Version number. Do not delete. [[keymap]] @@ -1647,7 +1691,7 @@ Ctrl-Tab switch_between_open_files Ctrl-Alt-P switch_to_project -# Added after migration to version [5] +# Added after migration to version [6] Ctrl-Shift-Alt-N open_another_editor_instance F8 go_to_next_build_error Ctrl-F8 go_to_next_build_error_on_the_side @@ -1679,7 +1723,7 @@ scrollbar_background: FF191F4C FOCUS_CONFIG THEME_1_EXPECTED :: #string FOCUS_CONFIG -[5] # Version number. Do not delete. +[6] # Version number. Do not delete. [fonts] font: default @@ -1695,7 +1739,7 @@ background4: 21333FFF scrollbar_hover: FFCCCC4C scrollbar_background: FF191F4C -# Added after migration to version [5] +# Added after migration to version [6] code_warning: E4D97DFF region_scope_export: 15212AFF region_scope_file: 15212AFF @@ -1808,7 +1852,7 @@ build_panel_title_bar: 121212FF FOCUS_CONFIG THEME_3_EXPECTED :: #string FOCUS_CONFIG -[5] # Version number. Do not delete +[6] # Version number. Do not delete [colors] @@ -1875,7 +1919,7 @@ build_panel_scrollbar_hover: CDAA7D4C build_panel_scrollbar_background: CDAA7D11 build_panel_title_bar: 121212FF -# Added after migration to version [5] +# Added after migration to version [6] code_invalid: FF0000FF code_multiline_string: 6B8E23FF code_raw_string: 6B8E23FF diff --git a/src/editors.jai b/src/editors.jai index 099cb2245..9ea4fda56 100644 --- a/src/editors.jai +++ b/src/editors.jai @@ -718,7 +718,7 @@ get_max_y_scroll :: (editor: Editor, buffer: Buffer) -> s32 { } add_paste_animation :: (editor_id: s64, range: Offset_Range) { - if config.settings.disable_that_annoying_paste_effect return; + if !config.settings.show_paste_effect return; anim := array_add(*editor_paste_animations); anim.editor_id = editor_id; diff --git a/src/utils.jai b/src/utils.jai index c1bb6d5bd..0a8a56f5b 100644 --- a/src/utils.jai +++ b/src/utils.jai @@ -387,6 +387,7 @@ get_visual_indent_in_spaces :: (line: string, spaces := " \t") -> indent: int { } get_tmp_spaces :: (num: int) -> string { + if num <= 0 return ""; spaces := talloc_string(num); memset(spaces.data, cast(u8) #char " ", num); return spaces;