Commit graph

38 commits

Author SHA1 Message Date
Daniel Eklöf
3ca6f9fe0b
selection: replace \r\n with \n in pasted text 2019-10-16 21:14:45 +02:00
Daniel Eklöf
16f15d1a36
selection: primary: don't require compositor to implement it 2019-09-25 19:26:55 +02:00
Daniel Eklöf
58d0657a97
selection: allow selections while searching scrollback 2019-08-27 20:57:58 +02:00
Daniel Eklöf
75830ba016
selection: regression: last cell wasn't included in copied text 2019-08-10 20:22:02 +02:00
Daniel Eklöf
15afd26716
osc: implement copy/paste to/from primary 2019-08-09 21:27:51 +02:00
Daniel Eklöf
70b6d9d7d2
input: don't paste from primary if client is mouse tracking 2019-08-09 21:26:34 +02:00
Daniel Eklöf
28a8b18c5e
selection: allow selection when mouse tracking is enabled *if* shift is pressed 2019-08-08 17:58:24 +02:00
Daniel Eklöf
481a1cd678
selection/input: triple click selects an entire row 2019-08-06 19:32:06 +02:00
Daniel Eklöf
c06f141189
term: cancel selection when scrolling wraps
If we scroll enough, we'll eventually end up wrapping around the
entire scrollback buffer. At this point, a selection is no longer
valid, so cancel it.

Note: this was very obvious when scrolling in the alt screen, since
its scrollback buffer is what you see on the screen (i.e. it has no
scrollback).
2019-08-05 20:16:17 +02:00
Daniel Eklöf
1e08d93528
selection: ensure start < end in finalize
When the selection is finalized, swap start/end if necessary, to make
sure start <= end.
2019-08-05 20:15:18 +02:00
Daniel Eklöf
c62ce72778
selection: mark-word using spaces only as word separator
When the user double-clicks with ctrl pressed, we now select the word
under the cursor using spaces only as word separator.
2019-08-05 19:02:27 +02:00
Daniel Eklöf
3ae210d4c5
selection: only disable selection when mouse drag/motion is on
This allows us to select text in e.g. man/less while still being able
to use LESS=--MOUSE (i.e. enable scrolling with mouse).
2019-08-04 19:15:50 +02:00
Daniel Eklöf
8deead14e8
selection: insert newlines only when last column is empty 2019-08-04 13:07:54 +02:00
Daniel Eklöf
4d7993b36f
cell: pack more efficiently and store glyph as a wchar
The 'attributes' struct is now 8 bytes and naturally packed (used to
be 9 bytes, artificially packed).

'cell' struct is now 12 bytes, naturally packed (used to be 13 bytes,
artificially packed).

Furthermore, the glyph is stored as a wchar instead of a char*. This
makes it easier (faster) to do glyph lookup when rendering.
2019-08-02 18:19:07 +02:00
Daniel Eklöf
b82dc02505
selection: add a couple of word-breaking characters
When "auto-selecting" a word, we used to only break on space
characters. Now we break on a number of other characters as
well.
2019-07-30 21:57:48 +02:00
Daniel Eklöf
ebf0a11fa0
render: add render_refresh() 2019-07-24 20:11:41 +02:00
Daniel Eklöf
793c37923e
selection: add text_from_clipboard()
This function reads data from the clipboard, and calls a user-provided
callback for each chunk of clipboard data.
2019-07-19 14:20:00 +02:00
Daniel Eklöf
167036ccbe
selection: add text_to_clipboard()
This function takes a string and makes it available to the clipboard.
2019-07-19 11:12:14 +02:00
Daniel Eklöf
8bd969262b
selection: implement double-click-to-select-word 2019-07-17 21:30:57 +02:00
Daniel Eklöf
f669cce5b9
selection: bug: apply grid's view offset when starting a selection 2019-07-17 12:59:12 +02:00
Daniel Eklöf
7379198f4a
Use vt_to_slave() instead of calling write(term->ptmx, ...) everywhere 2019-07-15 15:42:21 +02:00
Daniel Eklöf
6cd23654cc
selection: disable source listeners, since we don't currently use them 2019-07-11 17:38:03 +02:00
Daniel Eklöf
66e067082b
selection: implement copy *to* primary 2019-07-11 17:38:03 +02:00
Daniel Eklöf
703aeecb95
selection: add support for pasting *from* primary 2019-07-11 17:38:03 +02:00
Daniel Eklöf
e56066feef
selection: add selection_from_primary() API (stub for now) 2019-07-11 17:38:03 +02:00
Daniel Eklöf
5e1715be18
selection: cleanup 2019-07-11 17:38:03 +02:00
Daniel Eklöf
6edc3845bd
selection: calculate required length for clipboard text 2019-07-11 17:38:03 +02:00
Daniel Eklöf
c1c6646b98
selection: read until EOF when reading from clipboard 2019-07-11 17:38:03 +02:00
Daniel Eklöf
e8b6705ab8
selection: it's an error to call offset_accept() on non-drag-and-drop 2019-07-11 17:38:03 +02:00
Daniel Eklöf
3f02a7354e
selection: handle partial writes and EINTR when writing to clipboard 2019-07-11 17:38:03 +02:00
Daniel Eklöf
482c8f76a9
selection: add support for pasting from clipboard 2019-07-11 17:38:02 +02:00
Daniel Eklöf
b50ec1a850
selection: initial copy-to-clipboard functionality 2019-07-11 17:38:02 +02:00
Daniel Eklöf
1f808781f4
selection: selection_finalize() ignores invalid selections 2019-07-11 17:38:02 +02:00
Daniel Eklöf
e7e199d6b5
selection: spell 'finalize' correctly 2019-07-11 17:38:02 +02:00
Daniel Eklöf
d0e0b6da7c
selection: invalidate *all* affected lines when updating selection 2019-07-11 17:38:02 +02:00
Daniel Eklöf
18070cf286
selection: disable debug logging 2019-07-11 17:38:02 +02:00
Daniel Eklöf
d944274f14
selection: disable selection when client has enabled mouse tracking 2019-07-11 17:38:01 +02:00
Daniel Eklöf
bcf763d417
selection: add a selection API 2019-07-11 17:38:01 +02:00