Commit dd71283
Select and copy text in the viewer (#859)
* Select and copy text in the viewer
Every pane was owner drawn with no selection anywhere in the model, so the one
thing a reader wants to do with a failing snapshot - take the text somewhere
else - could not be done at all.
Drag across either pane to select, ctrl+c to copy, ctrl+a to select one side.
Every entry's context menu also offers Copy selection, and a Copy item per pane
that has anything in it. A drag arrives from a head as both of its ends at once,
reported on every frame the button is held rather than as press, move and
release events: the managed side already holds the selection by then, so a
release has nothing to add, and a whole press-drag-release landing inside one
frame still arrives whole. Rows are rows of the whole side rather than of the
visible slice, because a head knows the scroll top it drew the press with and is
the only thing that can resolve a drag spanning a wheel notch.
A selection names the entry it was dragged in, so one left behind by an accept,
a discard or a variant cycle stops existing rather than needing a clear on every
transition - one of which would eventually be missed.
AsciiRenderer draws a fixed width character grid and has no way to invert part of
a line without changing its width, so what the model universally states about a
selection goes in the status line, where every renderer draws it and the text
snapshots show it, and the highlight is the enrichment the three pixel heads
paint on top. The same bargain ImagePane already makes.
Copying is IViewerWindow.SetClipboard rather than a ViewerActions member, because
a clipboard belongs to a toolkit the way a window does: WinForms, AppKit and GLFW
each own one, and the alternative was shelling out to clip, pbcopy and whichever
of xclip or wl-copy happened to be installed. It is answered before the owner
link, since the text is already in this process and an owner's answer would be a
round trip to fetch what this one is holding.
Keys.A was matched ignoring modifiers in all three heads, so ctrl+a would have
accepted the snapshot rather than selecting it.
DEVIEW_VERSION goes to 8: DeviewRow carries the selected run and DeviewInput the
drag, with deview_set_clipboard beside them. DeviewRow is a widened array
element, so this is the same kind of bump 6 was and the binaries have to be
rebuilt with it. The missing note for 7 is backfilled while here.
PixelTests.Selection has no Linux or macOS baseline yet; those come out of the
pixel job's received artifacts once the rebuilt binaries land.
* Rebuild native renderer binaries (#858)
Co-authored-by: SimonCropp <122666+SimonCropp@users.noreply.github.com>
* Accept the native pixel baselines
The two Selection captures are new, and the Linux context menu grew the two copy
items the ASCII snapshot and the WinForms one already show. All three came out of
the pixel jobs' received artifacts, which is where a baseline for a renderer this
machine cannot run has to come from.
---------
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: SimonCropp <122666+SimonCropp@users.noreply.github.com>1 parent 753a9e2 commit dd71283
57 files changed
Lines changed: 1919 additions & 64 deletions
File tree
- docs
- mdsource
- native
- include
- src
- swift/Sources/Deview
- src
- DiffEngineViewer.Linux/runtimes
- linux-arm64/native
- linux-x64/native
- DiffEngineViewer.Mac/runtimes
- osx-arm64/native
- osx-x64/native
- DiffEngineViewer.Tests
- DiffEngineViewer.Windows.Tests
- DiffEngineViewer.Windows
- DiffEngineViewer
- Model
- Native
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
165 | 165 | | |
166 | 166 | | |
167 | 167 | | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
168 | 181 | | |
169 | 182 | | |
170 | 183 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
76 | 76 | | |
77 | 77 | | |
78 | 78 | | |
| 79 | + | |
| 80 | + | |
79 | 81 | | |
80 | 82 | | |
81 | 83 | | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
82 | 93 | | |
83 | 94 | | |
84 | 95 | | |
| |||
103 | 114 | | |
104 | 115 | | |
105 | 116 | | |
| 117 | + | |
106 | 118 | | |
107 | 119 | | |
108 | 120 | | |
109 | 121 | | |
110 | 122 | | |
111 | | - | |
| 123 | + | |
112 | 124 | | |
113 | 125 | | |
114 | 126 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
83 | 83 | | |
84 | 84 | | |
85 | 85 | | |
| 86 | + | |
| 87 | + | |
86 | 88 | | |
87 | 89 | | |
88 | 90 | | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
89 | 100 | | |
90 | 101 | | |
91 | 102 | | |
| |||
110 | 121 | | |
111 | 122 | | |
112 | 123 | | |
| 124 | + | |
113 | 125 | | |
114 | 126 | | |
115 | 127 | | |
116 | 128 | | |
117 | 129 | | |
118 | | - | |
| 130 | + | |
119 | 131 | | |
120 | 132 | | |
121 | 133 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
51 | 51 | | |
52 | 52 | | |
53 | 53 | | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
54 | 66 | | |
55 | 67 | | |
56 | 68 | | |
| |||
168 | 180 | | |
169 | 181 | | |
170 | 182 | | |
171 | | - | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
172 | 188 | | |
173 | 189 | | |
174 | 190 | | |
| |||
203 | 219 | | |
204 | 220 | | |
205 | 221 | | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
206 | 242 | | |
207 | 243 | | |
208 | 244 | | |
| |||
221 | 257 | | |
222 | 258 | | |
223 | 259 | | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
224 | 267 | | |
225 | | - | |
| 268 | + | |
226 | 269 | | |
227 | 270 | | |
228 | 271 | | |
| |||
266 | 309 | | |
267 | 310 | | |
268 | 311 | | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
269 | 318 | | |
270 | 319 | | |
271 | 320 | | |
| |||
0 commit comments