| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
| |
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.
|
| |
|
|
| |
- 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
|
| | |
|
| |
|
|
|
|
| |
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.
|
| | |
|
| |
|
|
|
| |
eb_get_line_string always return valid string, however
eb_get_line_slice has a chance to return slice with NULL ptr.
|
| |
|
|
|
| |
Implement helper draw_text_slice which just allocate C-string on the
stack and pass it to the DrawText.
|
| |
|
|
|
|
|
|
| |
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`.
|
| | |
|
| | |
|
| | |
|
| |
|
|
|
| |
eb_bind binds file path to the ed_buf, eb_load_file loads to the
buffer if exists and eb_save_file save the buffer to that path.
|
| |
|
|
|
| |
[minor]
add argc and argv to main routine.
|
| | |
|
| |
|
|
|
|
|
|
|
| |
implement eb_get_last and is_cur_col_last to get consistant
abstraction for unallocated line or appending line.
fix set_cur_forward to more straightforward way.
[minor]
refactor ensure_line to use single variable li.
|
| | |
|
| | |
|
| |
|
|
|
|
|
|
|
|
| |
This was rely on NULL-initialization of physically allocated
vector. When I remove that feature, it immediatly segfalt since
logically v->data[index] is not allocated so its not initialized by
NULL yet.
[minor]
add assert on vec_get to avoid this kind of stupid mistake.
|
| |
|
|
|
| |
[minor]
add log cursor on draw loop.
|
| |
|
|
|
| |
fix: eb_set_cur_back to handle unallocated line correctly when called
on head of the line.
|
| |
|
|
|
|
|
|
|
|
| |
It was "inserting" the new line to the current eb->cur_row
index. Which should just set or push (when inserting to the end of the
buffer) to the eb->vec[eb->cur_row].
[minor]
add assertion on vec_set.
add debug lines on draw loop.
|
| |
|
|
|
|
|
| |
It was actually allocating line buf when insert empty line...
[minor]
refactor eb_init to indicates each field initialization well.
|
| |
|
|
|
|
|
|
|
|
|
| |
Before deleting curr, it does not freeing it!
[minor]
optimize vec_delete; if sizeof v is 0, do not call memmove.
refactor line_init to clearly indicates both value are initialized to
0.
optimize line_cat; if src is empty (['\0']), do not call
Vec_char_delete or something.
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
This is important because eb_backspace remove lines by the index
of vector. Although there is pro for lazy allocation for actual line
buffer, no-allocating line vector itself increase ambiguty too much.
Also this commit removes the feature that eb_get_line returns NULL
when its index is not correct, because this is ambiguouse with actual
line pointer is NULL on line vector and causes unfindable bug.
[minor]
add assert on line_split
|
| |
|
|
|
| |
[minor]
implement eb_get_cur_col and *_row
|
| |
|
|
|
|
|
|
|
| |
quite a nested function. to implement lazy allocation for line
buffer. is there a proper way to do it???
[minor]
fix warning msg on eb_insert which was incomplecation type on printf
add <stdio.h> on config.h DEBUG section
|
| |
|
|
| |
line_cat should be implemented; markd it TODO
|
| |
|
|
| |
It was deleting entire upper line when backspaced on first column.
|
| |
|
|
|
|
|
| |
makefile now handle each object and sources seperately to handle
header change gracefully.
and from now on, #DEBUG should declared inside of config.h
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
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 eb_backspace to actually backspace char, not delete it
[minor]
fix line_insert to handle li->last correctly
|
| |
|
|
|
| |
Mark eb_newline as TODO because it is not able to insert newline on
middle or end of the line.
|
| | |
|
| | |
|
| | |
|
| |
|
|
|
|
|
|
| |
- 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.
|
| |
|
|
|
|
|
|
|
|
|
|
| |
- 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
|
| |
|
|
| |
ed_buf (editor buf) define the context of the editor.
|
| | |
|
| |
|
|
| |
Refactor the codebase to isolate line-collection logic from the main.c driver
|
| |
|
|
|
|
|
|
|
|
|
|
| |
* main.c:
- Introduce VEC_LINE (vector of struct line *) using DEFINE_VECTOR macro
- Create `struct lines` to hold current line buffer and all past lines
- Implement `lines_init`, `lines_append_last`, `lines_get_last_line`, `lines_free`
- Modify main loop:
- On KEY_ENTER, current line is stored and a new line is allocated
- On BACKSPACE, deletion is done in current line
- All stored lines and the current line are drawn line-by-line with vertical spacing
- Replace previous single-line logic (`lineh`) with full multi-line editor buffer
|
| | |
|
| |
|
|
|
|
|
|
| |
- 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
|
| |
|
|
| |
Should be improved
|
| | |
|
|
|
Dependancy: raylib-5.5_linux_amd64[1]
[1] https://github.com/raysan5/raylib/releases/tag/5.5
|