| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
| |
* append-only add_buf
|
| |
|
|
| |
* adjust makefile so that `editor' is not on the obj_list
|
| | |
|
| | |
|
| | |
|
| | |
|
| |
|
|
| |
- rename and refactor draw_text_slice to draw_textn for more freely used
|
| | |
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| | |
|
| |
|
|
|
|
|
|
| |
Also introduce obj_rule, wrapper for obj build script used on %.o and
%.test.o targets.
[minor]
use ?= instead of := for CC and CFLAGS.
|
| |
|
|
|
|
|
|
| |
- 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.
|
| | |
|
| | |
|
| | |
|
| |
|
|
|
| |
This patch produces *.test.o, which is dedicated for unittest binary
which is compiled with -fsanitize=address flag.
|
| |
|
|
|
|
|
|
|
| |
- 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.*`
|
| |
|
|
|
|
| |
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]
fix perror("func: ") to perror("func")
|
| |
|
|
|
|
|
|
|
| |
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
|
| |
|
|
| |
len is size_t variable
|
| |
|
|
|
|
|
|
| |
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.
|
| |
|
|
| |
- fix log_printf to not automatically insert newline
|
| |
|
|
|
|
|
|
| |
- 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 enums in LOG_* to RED_LOG_* since its conflicting raylib
namespaces
|
| | |
|
| | |
|
| | |
|
| |
|
|
| |
This patch removes the dependency on raylib when allocating memory.
|
| |
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
|
| |
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.
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| |
|
|
| |
This patch removes obsolated line_get_string on eb_save_file.
|
| |
|
|
|
| |
eb_get_line_string always return valid string, however
eb_get_line_slice has a chance to return slice with NULL ptr.
|
| |
|
|
|
| |
The bug caused UB on splited newline. (especially when is_lazy = 1
unluckly)
|
| | |
|
| |
|
|
|
| |
Implement helper draw_text_slice which just allocate C-string on the
stack and pass it to the DrawText.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
| |
Just kill warnings.
|
| |
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
| |
This is important for current line_get_stirng implementation, which
allocates real vector when it is called with lazy loaded `li`.
|