mirror of
https://github.com/lightpanda-io/browser.git
synced 2026-02-04 06:23:45 +00:00
fix selection start updating to new len
This commit is contained in:
@@ -290,8 +290,8 @@ pub fn innerInsert(self: *Input, str: []const u8, page: *Page) !void {
|
|||||||
// if the input is fully selected, replace the content.
|
// if the input is fully selected, replace the content.
|
||||||
const new_value = try arena.dupe(u8, str);
|
const new_value = try arena.dupe(u8, str);
|
||||||
try self.setValue(new_value, page);
|
try self.setValue(new_value, page);
|
||||||
self._selection_start = 1;
|
self._selection_start = @intCast(new_value.len);
|
||||||
self._selection_end = 1;
|
self._selection_end = @intCast(new_value.len);
|
||||||
self._selection_direction = .none;
|
self._selection_direction = .none;
|
||||||
},
|
},
|
||||||
.partial => |range| {
|
.partial => |range| {
|
||||||
|
|||||||
@@ -138,8 +138,8 @@ pub fn innerInsert(self: *TextArea, str: []const u8, page: *Page) !void {
|
|||||||
// if the text area is fully selected, replace the content.
|
// if the text area is fully selected, replace the content.
|
||||||
const new_value = try arena.dupe(u8, str);
|
const new_value = try arena.dupe(u8, str);
|
||||||
try self.setValue(new_value, page);
|
try self.setValue(new_value, page);
|
||||||
self._selection_start = 1;
|
self._selection_start = @intCast(new_value.len);
|
||||||
self._selection_end = 1;
|
self._selection_end = @intCast(new_value.len);
|
||||||
self._selection_direction = .none;
|
self._selection_direction = .none;
|
||||||
},
|
},
|
||||||
.partial => |range| {
|
.partial => |range| {
|
||||||
|
|||||||
Reference in New Issue
Block a user