feat: reflow current line if there is no selection
This commit is contained in:
parent
a3ea183ba1
commit
ec71a7041b
1 changed files with 2 additions and 0 deletions
|
|
@ -6849,6 +6849,8 @@ pub const Editor = struct {
|
||||||
|
|
||||||
pub fn reflow(self: *Self, ctx: Context) Result {
|
pub fn reflow(self: *Self, ctx: Context) Result {
|
||||||
const b = try self.buf_for_update();
|
const b = try self.buf_for_update();
|
||||||
|
if (!self.has_secondary_cursors()) if (self.get_primary().selection == null)
|
||||||
|
try self.select_line_at_cursor(b.root, self.get_primary(), .exclude_eol);
|
||||||
const root = try self.with_cursels_mut_once_arg(b.root, reflow_cursel, b.allocator, ctx);
|
const root = try self.with_cursels_mut_once_arg(b.root, reflow_cursel, b.allocator, ctx);
|
||||||
try self.update_buf(root);
|
try self.update_buf(root);
|
||||||
self.clamp();
|
self.clamp();
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue