Immediate-Mode-UI / Immediate-Mode-UI/Nuklear
[BUG] `NK_EDIT_AUTO_SELECT` ignored when combined with `NK_EDIT_GOTO_END_ON_ACTIVATE`
- Dominant language
- C
- Stars
- 11.4k
- Forks
- 686
- Avg merge
- 4d 1h
- Merged PRs (30d)
- 3
Description
Hello! I've probably found a new problem. When using text edit widgets (e.g. `nk_edit_buffer` or `nk_edit_string_zero_terminated`) with both flags
`NK_EDIT_GOTO_END_ON_ACTIVATE | NK_EDIT_AUTO_SELECT`, the expected behavior does not occur.
**Expected behavior**
When activated, the cursor should move to the end and all text should be selected.
For example, for `nk_edit_buffer`, we expect the internal state of `nk_text_edit` to be:
```C
select_start = 0;
select_end = cursor = (text length);
```
**Actual behavior**
The cursor correctly moves to the end, but the text is not selected.
Observed `nk_text_edit` values:
```C
select_start = select_end = 0;
cursor = (text length);
```
It looks like `NK_EDIT_AUTO_SELECT` is ignored when `NK_EDIT_GOTO_END_ON_ACTIVATE` is also present.
Contributor guide
Research direction
Start with the nk_edit_buffer and nk_edit_string_zero_terminated entry points and trace how NK_EDIT_GOTO_END_ON_ACTIVATE and NK_EDIT_AUTO_SELECT are handled when the widget activates. Reproduce the reported state with both flags and verify that activation leaves select_start at 0 and select_end and cursor at the text length.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- c
- Domain
- desktop-dev
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 48/100