diff options
author | Hrishikesh Hiraskar <hrishi@enterpret.com> | 2021-10-02 13:20:26 +0530 |
---|---|---|
committer | Jesse Duffield <jessedduffield@gmail.com> | 2021-10-16 21:18:43 +1100 |
commit | b6454755caf6b90c935f986558f4f9ad085b1837 (patch) | |
tree | 65704a5fc6436390cf8dbe54428936edb0d9c6ff /pkg/gui/lbl | |
parent | 36210840962bb448208b6cc628319f994c392075 (diff) |
copy selected text to clipboard
Diffstat (limited to 'pkg/gui/lbl')
-rw-r--r-- | pkg/gui/lbl/state.go | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/pkg/gui/lbl/state.go b/pkg/gui/lbl/state.go index 8ae828923..e8014fc1a 100644 --- a/pkg/gui/lbl/state.go +++ b/pkg/gui/lbl/state.go @@ -180,6 +180,11 @@ func (s *State) RenderForLineIndices(includedLineIndices []int) string { return s.patchParser.Render(firstLineIdx, lastLineIdx, includedLineIndices) } +func (s *State) RenderSelected() string { + firstLineIdx, lastLineIdx := s.SelectedRange() + return s.patchParser.RenderLines(firstLineIdx, lastLineIdx) +} + func (s *State) SelectBottom() { s.SetLineSelectMode() s.SelectLine(len(s.patchParser.PatchLines) - 1) |