Commit Graph

4474 Commits

Author SHA1 Message Date
Dave Pearson
112c789e3c Add a test for going right a word from the end 2023-01-29 11:47:16 +00:00
Dave Pearson
d5a99425c0 Add a test for going right a word from the start 2023-01-29 11:37:12 +00:00
Dave Pearson
fad87c90f3 Add a test for going left a word from the end 2023-01-29 11:29:07 +00:00
Dave Pearson
938a3b4ed5 Add a test for going left a word from home
This should result in a NOP.
2023-01-29 11:20:44 +00:00
Dave Pearson
7ddf4bbecc Add some initial Input key/action unit tests
This is just getting a feel for how I'll go about testing these. The main
focus here won't be on the bindings themselves -- they're not really
interesting and I feel could change over time anyway as people's tastes
settle down. What I want to test here are the actions that get bound.

This is just an initial small set of what's going to be a much bigger
collection of Input action tests.
2023-01-27 18:42:38 +00:00
Dave Pearson
f4b29d8b99 Move the current Input tests into a subdirectory
I'm going to be adding more tests for Input, and I don't want to be doing
one large monolithic file of them, so this makes a space where
Input-targeting tests can live together and be easy to spot.
2023-01-27 18:41:13 +00:00
Dave Pearson
7de4924cf2 If going rightward one word an no more word go to end 2023-01-26 21:52:40 +00:00
Dave Pearson
3399fb868f Add support for deleting an Input word rightward 2023-01-26 21:48:58 +00:00
Dave Pearson
0675b40ae8 Add support for deleting an Input word leftward 2023-01-26 21:35:36 +00:00
Dave Pearson
2fa0956227 Improve the documentation for the movement and editing actions 2023-01-26 21:11:33 +00:00
Dave Pearson
372d83572c Start to improve the naming of binding-oriented actions
Don't focus on home/end and things like that, and also try and keep all of
the related names related.
2023-01-26 21:06:46 +00:00
Dave Pearson
44d4bc6191 Be more forgiving about what a word is 2023-01-26 20:57:06 +00:00
Dave Pearson
1600d98639 Tidy up previous word 2023-01-26 20:21:35 +00:00
Dave Pearson
d815cced38 Simplify an expression 2023-01-26 20:17:14 +00:00
Dave Pearson
fade5db2a9 Add support for jumping to the previous word
See #1310.
2023-01-26 15:37:26 +00:00
Dave Pearson
a2807f217d Add support for jumping to the next word 2023-01-26 15:16:54 +00:00
Dave Pearson
00c4981a91 Reorder the Input bindings
This makes no difference to anything; but I think grouping the bindings into
similar groups will make it easier for folk to read and find things.

See #1310.
2023-01-26 14:16:51 +00:00
Dave Pearson
5e1420df97 Favour named keys over Ctrl-combos
This makes no difference to anything; but I think it makes for code that's
easier on the eye so someone scanning down the list of bindings will see the
more descriptive key first.

See #1310.
2023-01-26 14:15:22 +00:00
Dave Pearson
53c168c24c Add delete-to-start to Input
And in doing so bind it to Ctrl+U (readline-common). Right now I'm not aware
of a common combo for this on Windows, but we can add a binding for this if
one becomes apparent.

See #1310.
2023-01-26 14:11:46 +00:00
Dave Pearson
487b2e2493 Add delete-to-end to Input
And in doing so bind it to Ctrl+K (macOS/Emacs/readline-common). Right now
I'm not aware of a common combo for this on Windows, but we can add a
binding for this if one becomes apparent.

See #1310.
2023-01-26 13:59:07 +00:00
Dave Pearson
5d67c76a70 Add delete key as a delete binding to Input
That is, delete deletes the character to the right -- the opposite of
backspace if you will.

See #1310.
2023-01-26 12:17:37 +00:00
Dave Pearson
672bc1b9b3 Add macOS/Emacs-style home/end bindings to Input
Ctrl+A and Ctrl+E

See #1310.
2023-01-26 11:43:34 +00:00
Dave Pearson
ab49dce39b Merge pull request #1665 from davep/workaround-windows-paste
Workaround for a Windows paste issue
2023-01-25 14:52:59 +00:00
Dave Pearson
44d48e244e Fix typo in replace
AKA: don't mix octal and hex Dave!
2023-01-25 14:43:41 +00:00
Dave Pearson
8145c08007 Update the CHANGELOG 2023-01-25 14:30:56 +00:00
Dave Pearson
32bb79362c Strip NULs from bracketed paste text as a Windows workaround
See #1661 for lots of context. Long story short, in Windows Terminal it
looks like any character that would requite the press of a modifier key
causes a NUL to appear in the pasted text for that character. This feels
like it could be a bug in Windows Terminal and we will investigate and
report at some point.

Meanwhile though this provides a workaround that has the paste experience
work the same as I'm seeing on macOS (and I would imagine in most terminals
on GNU/Linux too).
2023-01-25 14:24:37 +00:00
Will McGugan
7bdc8f9c7a Merge pull request #1664 from Textualize/lonely-p
don't request sync on macOS app
2023-01-25 14:28:11 +01:00
Will McGugan
6edfc82513 Merge pull request #1653 from Textualize/self-remove
Rhymes with "Bed rock"
2023-01-25 14:18:33 +01:00
Will McGugan
a292086a62 comment and docstring 2023-01-25 13:39:24 +01:00
Will McGugan
15af0cd2c6 wrong env var 2023-01-25 13:28:37 +01:00
Will McGugan
9caf0cf536 don't request sync on macOS app 2023-01-25 13:26:10 +01:00
Will McGugan
aba2633f44 Update tests/test_widget.py
Co-authored-by: darrenburns <darrenburns@users.noreply.github.com>
2023-01-25 12:00:51 +01:00
Will McGugan
a61e61f17b Merge pull request #1637 from davep/widget-importing
Support easier widget "support classes" importing
2023-01-25 11:53:32 +01:00
Will McGugan
5e0996d3aa Merge pull request #1627 from Textualize/fix-1616
Changing overflow programmatically updates layout
2023-01-25 11:52:36 +01:00
Will McGugan
b9b53b8677 Merge branch 'main' into fix-1616 2023-01-25 11:52:29 +01:00
Dave Pearson
82e2739196 Merge pull request #1660 from davep/stop-input-double-paste
Fix double-paste into `Input`
2023-01-24 20:55:45 +00:00
Dave Pearson
d101e3d4e7 Fix double-paste into Input
See #1657.
2023-01-24 20:16:50 +00:00
Dave Pearson
4bb7326f7d Merge pull request #1656 from davep/app-mount-all-doc-update
Explain the significance of the before/after types (redux)
2023-01-24 17:32:16 +00:00
Dave Pearson
92c03b0e11 Explain the significance of the before/after types (redux)
Follows on from https://github.com/Textualize/textual/pull/1641 where I did
the update for mounting via Widget but forgot about App.
2023-01-24 15:15:46 +00:00
Will McGugan
d10f0cbc79 docstrings 2023-01-24 16:04:33 +01:00
Will McGugan
1cba4006b9 docstring 2023-01-24 16:02:48 +01:00
Will McGugan
3673b0ff48 keep reference to remove task 2023-01-24 16:01:37 +01:00
Will McGugan
d9dd1dcbe8 simplify 2023-01-24 15:53:53 +01:00
Will McGugan
f97392ac8b added test 2023-01-24 15:24:55 +01:00
Will McGugan
b0d46287e1 Fix hang when removing current widget 2023-01-24 14:44:16 +01:00
Dave Pearson
2662e6b292 Merge pull request #1652 from davep/remove-children-updated-doc-reference
Remove mention of `ChildrenUpdated` from the `ListView` docs
2023-01-24 09:54:32 +00:00
Dave Pearson
faac89fd8d Remove mention of ChildrenUpdated from the ListView docs
As pointed out in #1649, a `ChildrenUpdated` message is documented but it
doesn't exist in the code. It looks like it got added during development,
then removed after it was realised it wasn't needed, but presumably it got
left in the docs:

  https://github.com/Textualize/textual/pull/1143#discussion_r1030409026
2023-01-24 07:47:18 +00:00
Rodrigo Girão Serrão
dde90a8069 Merge pull request #1646 from Textualize/test-pause
Add pause to flaky test.
2023-01-23 18:36:08 +00:00
Rodrigo Girão Serrão
5c73387bca Pause before rendering input widget. 2023-01-23 18:13:27 +00:00
Rodrigo Girão Serrão
c1bac9cd8f Update changelog. 2023-01-23 18:03:55 +00:00