sled

Једноставни уређивач текста
git clone https://git.sr.ht/~strahinja/sled
Дневник | Датотеке | Референце | ПРОЧИТАЈМЕ | ЛИЦЕНЦА

чување 6203159ccb7ebcd7a8f76d01b936ba98bbea2939
родитељ 68cc281d8aba9226507aeb9bd5b21550af4be4a3
Аутор: Страхиња Радић <sr@strahinja.org>
Датум:   Tue, 31 Mar 2026 14:08:58 +0000

Update patches

Diffstat:
Mpatch/bw-theme.patch | 6+++---
Mpatch/dark-theme.patch | 15+++++++--------
Mpatch/light-theme.patch | 15+++++++--------
Mpatch/syntax.patch | 58++++++++++++++++++++++++++++------------------------------
измењених датотека: 4, додавања: 45(+), брисања: 49(-)

diff --git a/patch/bw-theme.patch b/patch/bw-theme.patch @@ -1,6 +1,6 @@ -From 9eae6875a90fb3c6f53d9b59ec606f1d68d31c9e Mon Sep 17 00:00:00 2001 +From f5d2d5de69f3fc4c98f5f7cd82a2b385cad4b50a Mon Sep 17 00:00:00 2001 From: Страхиња Радић <sr@strahinja.org> -Date: Fri Mar 20 07:13:12 2026 UTC +Date: Tue Mar 31 13:58:45 2026 UTC Subject: [PATCH] Set black and white theme MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 @@ -11,7 +11,7 @@ Content-Transfer-Encoding: 8bit 1 file changed, 12 insertions(+), 15 deletions(-) diff --git a/config.def.h b/config.def.h -index 42070b9ab..9eae6875a 100644 +index 68cc281d8..f5d2d5de6 100644 --- a/config.def.h +++ b/config.def.h @@ -6,25 +6,22 @@ diff --git a/patch/dark-theme.patch b/patch/dark-theme.patch @@ -1,6 +1,6 @@ -From e98cf28b086507af68f311ebfc4bec5d3ab4f2ae Mon Sep 17 00:00:00 2001 +From b6327918dac3b32a89560e732d123d1f6cf1338c Mon Sep 17 00:00:00 2001 From: Страхиња Радић <sr@strahinja.org> -Date: Thu Mar 19 13:02:48 2026 UTC +Date: Tue Mar 31 13:58:42 2026 UTC Subject: [PATCH] Set dark theme MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 @@ -8,11 +8,11 @@ Content-Transfer-Encoding: 8bit --- config.def.h | 17+ 23- - sled.c | 2+ 0- - 2 files changed, 19 insertions(+), 23 deletions(-) + sled.c | 1+ 0- + 2 files changed, 18 insertions(+), 23 deletions(-) diff --git a/config.def.h b/config.def.h -index 2d7d3dab1..e98cf28b0 100644 +index 68cc281d8..b6327918d 100644 --- a/config.def.h +++ b/config.def.h @@ -4,29 +4,23 @@ @@ -63,15 +63,14 @@ index 2d7d3dab1..e98cf28b0 100644 /* clang-format on */ diff --git a/sled.c b/sled.c -index 2d7d3dab1..e98cf28b0 100644 +index 68cc281d8..b6327918d 100644 --- a/sled.c +++ b/sled.c -@@ -3198,6 +3198,8 @@ init_termbox: +@@ -3200,6 +3200,7 @@ init_termbox: goto main_done; } + tb_set_output_mode(TB_OUTPUT_256); -+ errno = 0; state.maxx = 0; state.recalculate_size = 1; diff --git a/patch/light-theme.patch b/patch/light-theme.patch @@ -1,6 +1,6 @@ -From 4f738d7ccd5fc16c87f845ab52894875217dd9b3 Mon Sep 17 00:00:00 2001 +From 08ecff51c80098107f81139b4c1bf09b69e1cbe9 Mon Sep 17 00:00:00 2001 From: Страхиња Радић <sr@strahinja.org> -Date: Thu Mar 19 13:17:09 2026 UTC +Date: Tue Mar 31 13:58:36 2026 UTC Subject: [PATCH] Set light theme MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 @@ -8,11 +8,11 @@ Content-Transfer-Encoding: 8bit --- config.def.h | 17+ 23- - sled.c | 2+ 0- - 2 files changed, 19 insertions(+), 23 deletions(-) + sled.c | 1+ 0- + 2 files changed, 18 insertions(+), 23 deletions(-) diff --git a/config.def.h b/config.def.h -index 59666a896..4f738d7cc 100644 +index 68cc281d8..08ecff51c 100644 --- a/config.def.h +++ b/config.def.h @@ -4,29 +4,23 @@ @@ -63,15 +63,14 @@ index 59666a896..4f738d7cc 100644 /* clang-format on */ diff --git a/sled.c b/sled.c -index 59666a896..4f738d7cc 100644 +index 68cc281d8..08ecff51c 100644 --- a/sled.c +++ b/sled.c -@@ -3198,6 +3198,8 @@ init_termbox: +@@ -3200,6 +3200,7 @@ init_termbox: goto main_done; } + tb_set_output_mode(TB_OUTPUT_256); -+ errno = 0; state.maxx = 0; state.recalculate_size = 1; diff --git a/patch/syntax.patch b/patch/syntax.patch @@ -1,6 +1,6 @@ -From a2fe7d7395de30598dd2068458bd5117a83fe51e Mon Sep 17 00:00:00 2001 +From e0b72ba7c83465d51e24140506426098a9bf78c7 Mon Sep 17 00:00:00 2001 From: Страхиња Радић <sr@strahinja.org> -Date: Thu Mar 19 13:40:37 2026 UTC +Date: Tue Mar 31 14:06:36 2026 UTC Subject: [PATCH] Add syntax highlighting MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 @@ -10,11 +10,11 @@ Content-Transfer-Encoding: 8bit config.def.h | 7+ 0- draw.c | 618+ 31- draw.h | 76+ 6- - sled.c | 82+ 16- - 4 files changed, 783 insertions(+), 53 deletions(-) + sled.c | 82+ 15- + 4 files changed, 783 insertions(+), 52 deletions(-) diff --git a/config.def.h b/config.def.h -index 7d7234fc9..a2fe7d739 100644 +index 68cc281d8..e0b72ba7c 100644 --- a/config.def.h +++ b/config.def.h @@ -234,6 +234,13 @@ static const struct Key command_keys[] = { @@ -32,7 +32,7 @@ index 7d7234fc9..a2fe7d739 100644 {.format = "%s%s", .callback = format_filename, diff --git a/draw.c b/draw.c -index 7d7234fc9..a2fe7d739 100644 +index 68cc281d8..e0b72ba7c 100644 --- a/draw.c +++ b/draw.c @@ -3,6 +3,7 @@ @@ -875,7 +875,7 @@ index 7d7234fc9..a2fe7d739 100644 } diff --git a/draw.h b/draw.h -index 7d7234fc9..a2fe7d739 100644 +index 68cc281d8..e0b72ba7c 100644 --- a/draw.h +++ b/draw.h @@ -63,17 +63,69 @@ struct Color { @@ -1012,7 +1012,7 @@ index 7d7234fc9..a2fe7d739 100644 + const uint16_t sbg, const int ssi, const int sei, const uint16_t slfg, + const uint16_t slbg); diff --git a/sled.c b/sled.c -index 7d7234fc9..a2fe7d739 100644 +index 68cc281d8..e0b72ba7c 100644 --- a/sled.c +++ b/sled.c @@ -50,6 +50,18 @@ extern const char* prompt_reread_dirty; @@ -1084,15 +1084,15 @@ index 7d7234fc9..a2fe7d739 100644 recalculate_line_numbers(state); return 0; -@@ -470,6 +487,7 @@ erase_prev_word(struct DrawState* state) - state->coord.col = i; - state->display_column = display_length(current->text, state->coord.col); - state->dirty = 1; +@@ -474,6 +491,7 @@ erase_prev_word(struct DrawState* state) + if (state->display_column < state->first_shown.col) + state->first_shown.col = state->display_column; + state->dirty = 1; + state->recalculate_syntax = 1; return 0; } -@@ -525,7 +543,8 @@ erase_selection(struct DrawState* state) +@@ -529,7 +547,8 @@ erase_selection(struct DrawState* state) recalculate_line_numbers(state); } free(buf); @@ -1102,7 +1102,7 @@ index 7d7234fc9..a2fe7d739 100644 } return 0; } -@@ -550,7 +569,8 @@ erase_to_end(struct DrawState* state) +@@ -554,7 +573,8 @@ erase_to_end(struct DrawState* state) buffer_line->text[state->coord.col] = 0; buffer_line->length = state->coord.col; move_end(state); @@ -1112,7 +1112,7 @@ index 7d7234fc9..a2fe7d739 100644 return 0; } -@@ -584,7 +604,8 @@ erase_to_start(struct DrawState* state) +@@ -588,7 +608,8 @@ erase_to_start(struct DrawState* state) buffer_line->text[len - state->coord.col] = 0; buffer_line->length = len - state->coord.col; move_start(state); @@ -1122,7 +1122,7 @@ index 7d7234fc9..a2fe7d739 100644 return 0; } -@@ -1146,8 +1167,8 @@ insert_char(struct DrawState* state, uint32_t ch) +@@ -1148,8 +1169,8 @@ insert_char(struct DrawState* state, uint32_t ch) } insert_skip_wrap: @@ -1133,7 +1133,7 @@ index 7d7234fc9..a2fe7d739 100644 return 0; insert_char_error: -@@ -1198,7 +1219,8 @@ insert_skip_wrap: +@@ -1200,7 +1221,8 @@ insert_skip_wrap: simple_insert_line(state); state->saved_column = -1; position_to(state, state->coord.row + 1, 0); @@ -1143,7 +1143,7 @@ index 7d7234fc9..a2fe7d739 100644 return 0; } -@@ -1733,7 +1755,8 @@ paste_from_paste(struct DrawState* state) +@@ -1735,7 +1757,8 @@ paste_from_paste(struct DrawState* state) } position_to(state, newpos.row, newpos.col); @@ -1153,7 +1153,7 @@ index 7d7234fc9..a2fe7d739 100644 paste_from_paste_cleanup: free(rest); -@@ -1999,6 +2022,7 @@ reread_file(struct DrawState* state) +@@ -2001,6 +2024,7 @@ reread_file(struct DrawState* state) } recalculate_line_numbers(state); @@ -1161,7 +1161,7 @@ index 7d7234fc9..a2fe7d739 100644 return 0; } -@@ -2396,6 +2420,7 @@ simple_join_lines(struct DrawState* state) +@@ -2398,6 +2422,7 @@ simple_join_lines(struct DrawState* state) state->rows_count--; state->dirty = 1; recalculate_line_numbers(state); @@ -1169,7 +1169,7 @@ index 7d7234fc9..a2fe7d739 100644 return; simple_join_lines_error: -@@ -2873,6 +2898,8 @@ main(int argc, char** argv) +@@ -2875,6 +2900,8 @@ main(int argc, char** argv) int saved_errno; int tbires; int optind = 1; @@ -1178,7 +1178,7 @@ index 7d7234fc9..a2fe7d739 100644 *prompt = 0; -@@ -2979,6 +3006,40 @@ main_options_loop: +@@ -2981,6 +3008,40 @@ main_options_loop: init_drawstate(&state, filename, prompt, 0, 0); @@ -1219,23 +1219,21 @@ index 7d7234fc9..a2fe7d739 100644 #ifdef __OpenBSD__ if (unveil(state.filename, "rwc") < 0) { -@@ -3197,11 +3258,11 @@ init_termbox: - errno = ERR_TB_ERROR; +@@ -3200,9 +3261,10 @@ init_termbox: goto main_done; } + +- errno = 0; +- state.maxx = 0; +- state.recalculate_size = 1; + errno = 0; + state.maxx = 0; + state.recalculate_size = 1; + state.recalculate_syntax = 1; -- errno = 0; -- state.maxx = 0; -- state.recalculate_size = 1; -- while (state.running) { - tb_set_clear_attrs(colors[C_TEXT].fg, colors[C_TEXT].bg); -@@ -3212,6 +3273,11 @@ init_termbox: +@@ -3214,6 +3276,11 @@ init_termbox: recalculate_size(&state); state.recalculate_size = 0; }