Skip to content

Commit

Permalink
Release Focus 0.3.7
Browse files Browse the repository at this point in the history
  • Loading branch information
focus-editor committed Sep 15, 2024
1 parent 360576b commit e51c565
Show file tree
Hide file tree
Showing 26 changed files with 195 additions and 132 deletions.
16 changes: 13 additions & 3 deletions FOCUS-CHANGELOG.txt
Original file line number Diff line number Diff line change
@@ -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)
Expand All @@ -17,16 +30,13 @@
+ 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
+ Files larger than the limit of 2,147,483,647 bytes will now no longer be loaded with an error message rather than crashing
+ 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:
Expand Down
6 changes: 3 additions & 3 deletions config/default.focus-config
Original file line number Diff line number Diff line change
@@ -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.
Expand Down Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions config/default_macos.focus-config
Original file line number Diff line number Diff line change
@@ -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.
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion config/example-project.focus-config
Original file line number Diff line number Diff line change
@@ -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.
Expand Down
2 changes: 1 addition & 1 deletion config/themes/basic-light.focus-theme
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[5] # Version number. Do not delete
[6] # Version number. Do not delete

[colors]
background0: FFFFFFFF
Expand Down
2 changes: 1 addition & 1 deletion config/themes/everforest-hard.focus-theme
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[5] # Version number. Do not delete
[6] # Version number. Do not delete

[colors]
background0: FFFFFFFF
Expand Down
2 changes: 1 addition & 1 deletion config/themes/gruber-darker.focus-theme
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion config/themes/gruvbox-flat.focus-theme
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[5] # Version number. Do not delete
[6] # Version number. Do not delete

[colors]

Expand Down
2 changes: 1 addition & 1 deletion config/themes/halogen.focus-theme
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[5] # Version number. Do not delete
[6] # Version number. Do not delete

[colors]
background0: 181818FF
Expand Down
2 changes: 1 addition & 1 deletion config/themes/handmade-hero.focus-theme
Original file line number Diff line number Diff line change
@@ -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

Expand Down
2 changes: 1 addition & 1 deletion config/themes/jblow-nostalgia.focus-theme
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[5] # Version number. Do not delete
[6] # Version number. Do not delete

[colors]

Expand Down
2 changes: 1 addition & 1 deletion config/themes/jblowtorch.focus-theme
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[5] # Version number. Do not delete
[6] # Version number. Do not delete

[colors]
background0: 072626FF
Expand Down
2 changes: 1 addition & 1 deletion config/themes/nord-midnight.focus-theme
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[5] # Version number. Do not delete
[6] # Version number. Do not delete

[colors]
background0: 1D2129FF
Expand Down
2 changes: 1 addition & 1 deletion config/themes/nord.focus-theme
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[5] # Version number. Do not delete
[6] # Version number. Do not delete

[colors]
background0: 2E3440FF
Expand Down
2 changes: 1 addition & 1 deletion config/themes/solarized-dark.focus-theme
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[5] # Version number. Do not delete
[6] # Version number. Do not delete

[colors]
background0: 002B36FF
Expand Down
2 changes: 1 addition & 1 deletion config/themes/spacemacs-light.focus-theme
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[5] # Version number. Do not delete
[6] # Version number. Do not delete

[colors]
background0: fbf8efFF
Expand Down
2 changes: 1 addition & 1 deletion config/themes/steel-breeze.focus-theme
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[5] # Version number. Do not delete
[6] # Version number. Do not delete

[colors]

Expand Down
2 changes: 1 addition & 1 deletion config/themes/tokyo-night-light.focus-theme
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[5] # Version number. Do not delete
[6] # Version number. Do not delete

[colors]
background0: D5D6DBFF
Expand Down
2 changes: 1 addition & 1 deletion config/themes/tokyo-night.focus-theme
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[5] # Version number. Do not delete
[6] # Version number. Do not delete

[colors]
background0: 1A1B26FF
Expand Down
2 changes: 1 addition & 1 deletion config/themes/zenburn.focus-theme
Original file line number Diff line number Diff line change
@@ -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
Expand Down
26 changes: 13 additions & 13 deletions first.jai
Original file line number Diff line number Diff line change
@@ -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();

Expand Down
8 changes: 5 additions & 3 deletions src/buffer.jai
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand Down Expand Up @@ -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
Expand All @@ -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 {
Expand Down
12 changes: 9 additions & 3 deletions src/config.jai
Original file line number Diff line number Diff line change
@@ -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);
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down
Loading

0 comments on commit e51c565

Please sign in to comment.