Ensure correct coordinate ordering in selection file write
When writing selected text to file, use `topLeft` and `bottomRight` instead of `start` and `end` to ensure correct coordinate ordering. This fixes an issue where selection files could be empty when selecting text in reverse order. - Use `terminal.Selection.topLeft()` for start coordinate - Use `terminal.Selection.bottomRight()` for end coordinatepull/4078/head
parent
716848cb58
commit
c62f64866c
|
|
@ -4293,11 +4293,16 @@ fn writeScreenFile(
|
|||
tmp_dir.deinit();
|
||||
return;
|
||||
};
|
||||
|
||||
// Use topLeft and bottomRight to ensure correct coordinate ordering
|
||||
const tl = sel.topLeft(&self.io.terminal.screen);
|
||||
const br = sel.bottomRight(&self.io.terminal.screen);
|
||||
|
||||
try self.io.terminal.screen.dumpString(
|
||||
buf_writer.writer(),
|
||||
.{
|
||||
.tl = sel.start(),
|
||||
.br = sel.end(),
|
||||
.tl = tl,
|
||||
.br = br,
|
||||
.unwrap = true,
|
||||
},
|
||||
);
|
||||
|
|
|
|||
Loading…
Reference in New Issue