Patch shell cursor (#59)

* 调整代码减少bug

* 修复换行光标bug

Co-authored-by: longjin <longjin@RinGoTek.cn>
This commit is contained in:
DaJiYuQia
2022-10-18 20:38:34 +08:00
committed by GitHub
parent 173c988d5d
commit a9c5b3e45c
3 changed files with 37 additions and 15 deletions

View File

@ -398,7 +398,6 @@ uint64_t do_open(const char *filename, int flags)
// 寻找文件
struct vfs_dir_entry_t *dentry = vfs_path_walk(path, 0);
if (dentry == NULL && flags & O_CREAT)
{
// 先找到倒数第二级目录

View File

@ -181,7 +181,8 @@ static int __textui_putchar_window(struct textui_window_t *window, uint16_t char
++vline->index;
textui_refresh_characters(window, window->vline_operating, vline->index - 1, 1);
// 换行
if (vline->index >= window->chars_per_line)
// 加入光标后,因为会识别光标,所以需超过该行最大字符数才能创建新行
if (vline->index > window->chars_per_line)
{
__textui_new_line(window, window->vline_operating);
}
@ -295,7 +296,7 @@ int textui_putchar(uint16_t character, uint32_t FRcolor, uint32_t BKcolor)
/**
* @brief 初始化text ui框架
*
* @return int
* @return int
*/
int textui_init()
{