aboutsummaryrefslogtreecommitdiff
path: root/makefile
Commit message (Collapse)AuthorAgeFilesLines
* 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.
* 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-281-38/+24
| | | | | | | | | - 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-281-1/+7
| | | | | | 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.
* refactor: integrate raylib logs to RED log levelsdilluti0n2025-05-131-1/+4
| | | | | - refactor enums in LOG_* to RED_LOG_* since its conflicting raylib namespaces
* fix: Memory Leak in eb_delete_linedilluti0n2025-05-101-3/+4
| | | | | | 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-021-1/+1
| | | | | | | | | 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.
* test: for editor.c implement editor_suite::not_middle_of_linedilluti0n2025-05-011-1/+1
|
* refactor: main draw routine to use eb_get_line_slice instead string.dilluti0n2025-04-291-3/+3
| | | | | Implement helper draw_text_slice which just allocate C-string on the stack and pass it to the DrawText.
* change: executable name rayedit to reddilluti0n2025-04-281-1/+1
| | | | for faster debuging :)
* refactor: move tests to seperate filesdilluti0n2025-04-281-1/+1
| | | | | | test.c to *_line.c and *_vector.c also implement unit test vector_suite::resize too.
* refactor: move ed_* modules from main.c to editor.cdilluti0n2025-04-281-2/+5
|
* add: DEBUG variable on makefiledilluti0n2025-04-281-1/+5
| | | | add assertion on line_insert
* implement: line_catdilluti0n2025-04-271-1/+2
| | | | | | [minor] remove 'raylin.h' on makefile fix vector.h to able to compile... (just a minor issues)
* refactor: move debugs to config.h and handle build gracefullydilluti0n2025-04-271-2/+4
| | | | | | | makefile now handle each object and sources seperately to handle header change gracefully. and from now on, #DEBUG should declared inside of config.h
* implement: eb_newlinedilluti0n2025-04-271-2/+2
| | | | | | | | | | | | | I move around most of because it did not update eb->cur_col correctly. implement line_split which use vec_split for it [minor] implement eb_get_line and eb_line_num refactor main routine to use them add DEBUG symbol to makefile and remove lines.o for OBJS move declaration struct line to line.c from line.h for enhanced OOP
* fix: vector memory allocation and insert logic; cleanup eb handlingdilluti0n2025-04-211-1/+1
| | | | | | | | - Fixed incorrect `MemAlloc(sizeof(type *))` usage to properly allocate `sizeof(type)` for vector structs. - Corrected `memmove` call in vector insert to account for type size and copy full range. - Added `line_set_cursor()` to set line's cursor position before inserting new lines. - Replaced `line_arr` with `line_vec` in editor buffer for clearer naming. - Improved `DrawText` fallback behavior for NULL lines.
* refactor: line handling and implement basic editor buffer abstractiondilluti0n2025-04-211-1/+1
| | | | | | | | | | | | - Rename vector type VEC -> Vec_char for clarity - Update line.c to use renamed Vec_char API - Add `line_insert` function for character insertion at arbitrary positions - Define Vec_slinep as vector of line pointers in main.c - Introduce `struct ed_buf` as an abstraction for a text buffer - Implement `eb_insert`, `eb_free` and stub `eb_newline`, `eb_backspace` - Update main loop to use `ed_buf` instead of standalone line/lines - Fix vector insertion logic to support gaps and non-contiguous positions - Change optimization level in makefile to -O0 for easier debugging
* refactor: handle all unit tests in one sourcesdilluti0n2025-04-181-3/+4
| | | | Since project is not very large, this approach might increase simplicity.
* test: add initial Criterion unit-test scaffolding for `line` moduledilluti0n2025-04-181-1/+14
| | | | | | | | | | | | | * Introduce `test/test_line.c` with a basic append test validating `line_append()` updates `last` correctly. * Extend makefile - add `unittest` target that links against Criterion and existing objects - add `make test` phony for one-shot execution - ensure `clean` removes the test binary. * Update .gitignore to exclude the generated `unittest` executable. This sets up a reproducible test harness so we can grow TDD coverage as the editor evolves.
* tabify, gitignore, add -Wextra to CFLAGSdilluti0n2025-04-181-1/+1
|
* refactor: Split lines management into its own moduledilluti0n2025-04-181-1/+1
| | | | Refactor the codebase to isolate line-collection logic from the main.c driver
* Introduce vector template and migrate line moduledilluti0n2025-04-181-1/+1
| | | | | | | | | | | | * vector.h: Add DEFINE_VECTOR macro for a header-only generic vector template - Implements common operations: init, push, pop, set, get, len, grow * line.[ch]: - Replace fixed char-only vec with VEC (DEFINE_VECTOR(char)) instance - Refactor memory allocation and method calls to use VEC_* macros * makefile: - Remove vec.o from OBJS (vec module is no longer used) * vec.[ch] is now obsolete; new vector types (e.g., line *) can be defined easily using a single DEFINE_VECTOR invocation
* refactor: Extract line handling logic into separate line moduledilluti0n2025-04-181-1/+1
| | | | | | | | - Moved line-related functions (init, append, clear, delete, free) out of main.c - Created new files: line.c and line.h to encapsulate `struct line` and its operations - Updated main.c to use the new line module - Simplified main.c by removing inline struct and function definitions - Adjusted makefile to compile line.o
* Implement vector moduledilluti0n2025-04-181-2/+2
|
* Implement simple real time interactive text renderingdilluti0n2025-04-181-0/+20
Dependancy: raylib-5.5_linux_amd64[1] [1] https://github.com/raysan5/raylib/releases/tag/5.5