mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-07-17 01:06:08 +03:00
Merge pull request #2215 from jcollie/fix-selection-string
fix: Surface.selectionString should return sentinel slice
This commit is contained in:
@ -932,7 +932,7 @@ pub fn hasSelection(self: *const Surface) bool {
|
||||
}
|
||||
|
||||
/// Returns the selected text. This is allocated.
|
||||
pub fn selectionString(self: *Surface, alloc: Allocator) !?[]const u8 {
|
||||
pub fn selectionString(self: *Surface, alloc: Allocator) !?[:0]const u8 {
|
||||
self.renderer_state.mutex.lock();
|
||||
defer self.renderer_state.mutex.unlock();
|
||||
const sel = self.io.terminal.screen.selection orelse return null;
|
||||
|
Reference in New Issue
Block a user