summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* implement: eb_init and eb_freefeat/piecedilluti0n2025-06-221-20/+107
| | | | * append-only add_buf
* sub: start implementing editor_piece.cdilluti0n2025-06-212-1/+77
| | | | * adjust makefile so that `editor' is not on the obj_list
* minor: remove unused scroll_row field on ebdilluti0n2025-06-211-2/+0
|
* refactor: modify field 'w' and 'h' to width and height respectivelydilluti0n2025-06-011-14/+14
|
* feat: enable fraction format of each geometry metadatas on viewdilluti0n2025-06-013-15/+64
|
* fix: mark unused dirty flag as TODOdilluti0n2025-06-012-4/+3
|
* refactor: view_eb_draw to draw text only for its boarderdilluti0n2025-06-011-13/+16
| | | | - rename and refactor draw_text_slice to draw_textn for more freely used
* fix: main.c to update redr context when window is resizeddilluti0n2025-06-011-2/+7
|
* minor: redefinition on redr.hdilluti0n2025-06-011-3/+1
|
* refactor: introduce view.c; ui drawing abstraction layerdilluti0n2025-06-015-79/+390
| | | | | | | | | | | | | | | This patch extracts the drawing logic from redr_raylib.c and moves it into a new abstraction layer in view.c, introducing a tree-based view system for UI rendering. - view.c defines a hierarchical 'view' structure with polymorphic draw methods. - root and ed_buf views are implemented as a proof of concept. - redr.c (via redr.h) now exposes only backend rendering primitives (text, clear, measure). - main.c is updated to instantiate and draw the view tree. This separation clarifies the responsibilities between layout (view) and rendering (redr) and prepares the system for future UI extensions such as nested panels, split views, and overlays.
* minor: remove unused field eb.scroll_rowdilluti0n2025-06-011-2/+0
|
* build: introduce .deps dir for put dirty *.d files into itdilluti0n2025-05-281-9/+15
| | | | | | | | Also introduce obj_rule, wrapper for obj build script used on %.o and %.test.o targets. [minor] use ?= instead of := for CC and CFLAGS.
* refactor: consolidate ENAMETOOLONG handling in eb_binddilluti0n2025-05-281-7/+5
| | | | | | | | - Skip unnecessary cwd resolution when realpath returns ENAMETOOLONG. - Drop duplicate error-handling branches and route all failures through bind_fail. - Keep behavior unchanged while shaving a few lines and clarifying the control flow.
* minor: update .gitignoredilluti0n2025-05-281-1/+2
|
* minor: update TODO.orgdilluti0n2025-05-281-0/+1
|
* build: add MAKEFILE_LIST to rebuild objs when makefile is changeddilluti0n2025-05-281-2/+2
|
* build: apply ASan flags to all linked objects in test targetdilluti0n2025-05-281-1/+7
| | | | | This patch produces *.test.o, which is dedicated for unittest binary which is compiled with -fsanitize=address flag.
* build: add automatic dependency tracking and streamline rulesdilluti0n2025-05-282-39/+26
| | | | | | | | | - Derive `SRCS`, `OBJS`, and `DEPS` automatically via `wildcard`/pattern rules - Switch to `:=` for simple variable expansion; drop redundant TEST_* variables - Use a single pattern rule (`%.o: %.c`) instead of hand-written per-file recipes - Mark `all`, `clean`, and `test` as explicit `.PHONY` targets - Extend `clean` to remove generated `.d` files - Update **.gitignore** to ignore `*.d` alongside `vgcore.*`
* refactor: abstract input/rendering modules from main routinedilluti0n2025-05-288-153/+221
| | | | | | This fetch moves raylib-specific logics to redr_raylib.c and input_raylib.c from main routine. Each apis are defined in redr.h and input.h respectively.
* minor: use log_printf instead of printf when logging saved filedilluti0n2025-05-271-1/+1
|
* refactor: eb_bind to bind absolute path to eb->file_namedilluti0n2025-05-271-9/+49
| | | | | [minor] fix perror("func: ") to perror("func")
* refactor: remove cursor initialization from eb_load_filedilluti0n2025-05-271-2/+3
| | | | | | | | | Cursor initialization is now assumed to be handled by eb_init, eliminating redundant resets in eb_load_file and improving separation of concerns. [minor] add comment to struct ed_buf
* fix: correct CRLF handling guard to avoid ineffective len > 0 checkdilluti0n2025-05-261-1/+1
| | | | len is size_t variable
* fix: double-free of line object in eb_backspace and eb_delete_linedilluti0n2025-05-145-8/+26
| | | | | | | | On eb_backspace, when the upper line was non-null, line_cat followed by line_free, and eb_delete_line only cleared the line_vec. However, commit 2441e78 introduced an additional line_free in eb_delete_line to fix a memory leak, which led to a double-free for that line. This patch resolves that problem.
* refactor: replace #ifdef DEBUG printf to log_printfdilluti0n2025-05-145-20/+23
| | | | - fix log_printf to not automatically insert newline
* refactor: unify log level and stream setup via log_initdilluti0n2025-05-144-15/+20
| | | | | | | | - Replaced log_set_level() with log_init() to allow stream configuration. - log_fprintf() now uses an internal stream, defaulting to stdout. [minor] update log tags in TODO.org correctly
* refactor: integrate raylib logs to RED log levelsdilluti0n2025-05-134-24/+58
| | | | | - refactor enums in LOG_* to RED_LOG_* since its conflicting raylib namespaces
* minor: implement shell script to make random and big test filedilluti0n2025-05-101-0/+1
|
* feat: introduce log.c; log handling moduledilluti0n2025-05-103-1/+41
|
* minor: add vgcore.* to .gitignoredilluti0n2025-05-101-1/+2
|
* refactor: introduce mem.h; wrappers for allocatorsdilluti0n2025-05-106-22/+44
| | | | This patch removes the dependency on raylib when allocating memory.
* fix: Memory Leak in eb_delete_linedilluti0n2025-05-107-34/+132
| | | | | | The function eb_delete_line did not properly free the contents of the entry when deleting an element from eb->line_vec. This patch fixes that issue.
* refactor: deprecate line->cursor; simplify vertical cursor movementdilluti0n2025-05-025-23/+7
| | | | | | | | | This patch removes the per-line cursor cache (`line->cursor`), reducing implementation complexity. Vertical cursor movement (up/down) now uniformly places the cursor at the beginning of the line, instead of trying to restore the previous horizontal position. UX considerations such as column preservation will be revisited after core stabilization.
* perf: use fwrite instead of fputc loop in eb_save_filedilluti0n2025-05-011-2/+1
| | | | | | | | Previously, each character of a line was written using fputc in a loop, resulting in millions of function calls for large lines and poor write performance. Replaced with a single fwrite call per line, significantly reducing overhead and improving save performance dramatically.
* fix: possable buffer overflow when sl.len >= BUFSIZE on draw routinedilluti0n2025-05-011-2/+4
|
* minor: use #pragma once instead of #ifndef ... on vector.hdilluti0n2025-05-011-4/+1
|
* update TODO.orgdilluti0n2025-05-011-1/+1
|
* test: mark TODOs for editor_suite::cursor_move and *::middle_of_linedilluti0n2025-05-011-0/+10
|
* fix: cr_assert_slice_eq not checking excess bytes with actual stringdilluti0n2025-05-011-4/+19
|
* test: for editor.c implement editor_suite::not_middle_of_linedilluti0n2025-05-013-2/+86
|
* perf: Use eb_get_line_slice on eb_save_file instead line_get_stringdilluti0n2025-05-011-3/+5
| | | | This patch removes obsolated line_get_string on eb_save_file.
* fix: NULL check sl.ptr on main routine.dilluti0n2025-04-291-2/+2
| | | | | eb_get_line_string always return valid string, however eb_get_line_slice has a chance to return slice with NULL ptr.
* fix: line_split allocating newline but not initializing correctlydilluti0n2025-04-291-0/+4
| | | | | The bug caused UB on splited newline. (especially when is_lazy = 1 unluckly)
* fix: SEGSEGV on line_get_last; NULL check for li should be first.dilluti0n2025-04-291-1/+3
|
* refactor: main draw routine to use eb_get_line_slice instead string.dilluti0n2025-04-293-10/+25
| | | | | Implement helper draw_text_slice which just allocate C-string on the stack and pass it to the DrawText.
* feat: add slice-based accessors for line and editor bufferdilluti0n2025-04-295-10/+50
| | | | | | | | | | | | | | | | | This adds `line_get_slice` and `eb_get_line_slice`, enabling slice-style (pointer + length) access to line contents without requiring materialization into a null-terminated string. - `line_get_slice` returns either the original mmap'd buffer (if the - line is lazy) or the materialized vector contents (if edited). - `eb_get_line_slice` wraps `line_get_slice` to provide safe access at - the editor buffer level. Update `line.h` and `editor.h` headers to - declare the new functions. Minor documentation improvements to - clarify "init", "modify", and "get" function categories. This prepares the codebase for transitioning away from C-string dependency where possible, improving efficiency and avoiding unnecessary memory copies.
* fix: SIGBUS when eb_save_filedilluti0n2025-04-291-4/+20
| | | | | | | | | When eb_save_file is called, it opens the file with fopen(eb->file_name, "w"). Since opening with "w" mode truncates the file size to 0, accessing the memory region previously mmap-ed to that file results in a SIGBUS error. To prevent this, the content is now first written to a temporary file at /tmp/%s.tmpXXXXXX, and then renamed to eb->file_name.
* fix: format string is not a string literal in eb_save_filedilluti0n2025-04-291-1/+1
| | | | Just kill warnings.
* refactor: decouple line.h from main.cdilluti0n2025-04-293-11/+14
| | | | | | | | By making eb_get_line a static function within editor.c and introducing API wrappers that internally delegate to eb_get_line and line_get_string, thereby avoiding direct exposure of the line structure. Considering a future transition from C-style null-terminated strings to explicit length-based string management.
* perf: update draw loop to access actrually visable line only.dilluti0n2025-04-291-4/+9
| | | | | This is important for current line_get_stirng implementation, which allocates real vector when it is called with lazy loaded `li`.