Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Text Area wrapping #3933

Merged
merged 172 commits into from
Jan 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
172 commits
Select commit Hold shift + click to select a range
2def1c4
Add soft_wrap reactive to TextArea
darrenburns Nov 15, 2023
d2b3e7a
Remove redundant lines
darrenburns Nov 15, 2023
0a61a41
Add notes, update lockfile for new Rich, skeleton of WrappedDocumentView
darrenburns Nov 16, 2023
8cef051
Initial wrapping
darrenburns Nov 20, 2023
5641933
Begin implementing wrapping
darrenburns Nov 20, 2023
add3abd
Add tests for wrapped document
darrenburns Nov 20, 2023
a3a2600
Fixing some naming issues
darrenburns Nov 20, 2023
95417a4
Fix refresh_range wrapping test
darrenburns Nov 20, 2023
2dda263
Test wrapping in longer text
darrenburns Nov 20, 2023
2c9f764
Maintaining wrapping offsets
darrenburns Nov 20, 2023
aab538f
Remove irrelevant code
darrenburns Nov 20, 2023
18fc687
Remove more irrelevant code
darrenburns Nov 20, 2023
325ec78
Remove a comment
darrenburns Nov 20, 2023
70447ef
Merge branch 'text-area-wrapping' of github.com:Textualize/textual in…
darrenburns Nov 21, 2023
6d2c500
Implementing WrappedDocument required utility methods
darrenburns Nov 21, 2023
a770b39
Testing offset to line_index
darrenburns Nov 21, 2023
63ad2c2
Test WrappedDocument offset error cases
darrenburns Nov 21, 2023
b3b3900
Testing getting offsets
darrenburns Nov 21, 2023
8d6784b
Testing invalid line numbers being passed to WrappedDocument.get_offsets
darrenburns Nov 21, 2023
abd4667
Small optimisations
darrenburns Nov 21, 2023
dbe056b
Fix docstring
darrenburns Nov 21, 2023
6444ad0
Update src/textual/document/_wrapped_document.py
darrenburns Nov 21, 2023
988e7ab
Extract logic for converting cell widths to column indices
darrenburns Nov 22, 2023
e2ff0c4
Fix click target issue when tabs not fully expanded
darrenburns Nov 22, 2023
b85e963
Merge branch 'extract-cell-width-measurement' into text-area-wrapping
darrenburns Nov 22, 2023
d7a2c19
Merge branch 'main' of github.com:Textualize/textual into extract-cel…
darrenburns Nov 22, 2023
6c5a98a
Update CHANGELOG
darrenburns Nov 22, 2023
e196e01
Change line_offset_to_index to offset_to_location (it now works in tw…
darrenburns Nov 22, 2023
5cca091
Merge branch 'text-area-wrapping' of github.com:Textualize/textual in…
darrenburns Nov 22, 2023
5f57396
Fix wrapping offset calculation
darrenburns Nov 23, 2023
56c79cf
Wrapping coordinate conversion clamping
darrenburns Nov 23, 2023
ecaae8e
Merge branch 'extract-cell-width-measurement' of github.com:Textualiz…
darrenburns Nov 23, 2023
b0a7e51
Start on DocumentNavigator
darrenburns Nov 23, 2023
84d5113
Ensure consistent interface when wrapping enabled/disabled
darrenburns Nov 23, 2023
57adb2d
Update docstring
darrenburns Nov 23, 2023
2d47d7c
Merge branch 'extract-cell-width-measurement' into text-area-wrapping
darrenburns Nov 23, 2023
76cd4e8
Code reuse in WrappedDocument
darrenburns Nov 23, 2023
028d95e
Simplification of wrapping coordinate conversion
darrenburns Nov 23, 2023
434a64a
Tidying some wrapping stuff, docstrings
darrenburns Nov 23, 2023
5ef1734
Merge branch 'main' of github.com:Textualize/textual into text-area-w…
darrenburns Nov 23, 2023
80036f9
Merge branch 'main' of github.com:Textualize/textual into text-area-w…
darrenburns Nov 23, 2023
f6f1fbc
Merge branch 'text-area-wrapping' of github.com:Textualize/textual in…
darrenburns Nov 23, 2023
ee27c73
Check locations at start of wrapped/document line
darrenburns Nov 27, 2023
2aad184
Checking cursor position in wrapped context utilities
darrenburns Nov 27, 2023
f4da5d8
Left and right navigation
darrenburns Nov 27, 2023
f033df0
Begin implementing up
darrenburns Nov 28, 2023
9a180ea
Implement `up` in document navigator
darrenburns Nov 29, 2023
daefc7e
Implement clamping
darrenburns Nov 29, 2023
6779a9b
More tests for navigating through wrapped content
darrenburns Nov 29, 2023
5a1ced5
Improve test data
darrenburns Nov 29, 2023
7d9cb5d
Document navigator down
darrenburns Nov 30, 2023
7b1467b
Implement moving down
darrenburns Nov 30, 2023
185079c
Testing moving down
darrenburns Nov 30, 2023
0e72b35
Remove redundant function
darrenburns Dec 11, 2023
3c487e2
Merge branch 'text-area-wrapping-aware-cursor-navigation' of github.c…
darrenburns Dec 11, 2023
024d1b6
Adding wrapped text area movement module docs, correcting off by one
darrenburns Dec 11, 2023
3214443
Remove unused clamp
darrenburns Dec 11, 2023
ca834da
Cursor jumping to end of wrapped line
darrenburns Dec 11, 2023
8a6a97c
Moving to the home location in a wrapped document
darrenburns Dec 11, 2023
099dac3
Add a TODO comment
darrenburns Dec 12, 2023
d43ed2f
Merge branch 'main' of github.com:Textualize/textual into text-area-w…
darrenburns Dec 12, 2023
8d08692
Add wrap reactive to TextArea
darrenburns Dec 12, 2023
13de415
Remove now-redundant wrap() calls
darrenburns Dec 12, 2023
354b7ce
Build up the offset map in wrapped document to allow quick lookups of…
darrenburns Dec 12, 2023
fab9e02
Computing line -> offset when wrapping occurs
darrenburns Dec 13, 2023
9ca11d2
Integrating wrapping with no width
darrenburns Dec 13, 2023
f7877ce
Approaching range wrapping again
darrenburns Dec 15, 2023
30ad4c3
Improving wrapped document internal data structures.
darrenburns Dec 18, 2023
efb04cc
Building offset mapping correctly on edit
darrenburns Dec 18, 2023
1b3e8d0
Fixing some logic, but still crashes in some situations
darrenburns Dec 20, 2023
335d231
Fixing the calculation which recomputes offset to line mapping
darrenburns Dec 21, 2023
7a822c8
Leaving comments for future Darren
darrenburns Dec 21, 2023
af38ec5
Normalise wrap update range
darrenburns Dec 28, 2023
7e464c8
Fixes for mypy
darrenburns Dec 28, 2023
56b4df7
Fix clamping
darrenburns Dec 28, 2023
e04300a
Fixing some tests - snapshots fail since rendering still needs work
darrenburns Dec 28, 2023
b69d3c3
Merge branch 'main' of github.com:Textualize/textual into text-area-w…
darrenburns Dec 28, 2023
103ea86
Add navigator attribute to TextArea
darrenburns Dec 28, 2023
424cf61
Use navigator for moving cursor right
darrenburns Dec 28, 2023
8be8b78
Integrating navigator for basic movement
darrenburns Dec 28, 2023
ca9ddd5
Avoid doing offset/line shift loops when there is no shifting to be done
darrenburns Dec 28, 2023
f15ca05
Making space for cursor only at line end
darrenburns Jan 3, 2024
9eba82a
Fix some width and wrapping issues, and corresponding style issues
darrenburns Jan 3, 2024
61f7482
Fix non-wrapping rendering
darrenburns Jan 3, 2024
d50fa8d
Fix wrapping off by one
darrenburns Jan 3, 2024
2e4bb2a
Merge branch 'text-area-wrapping-widget-changes' of github.com:Textua…
darrenburns Jan 3, 2024
dffb488
Simplifying text rendering
darrenburns Jan 3, 2024
016ae3b
Unsimplifying text rendering
darrenburns Jan 3, 2024
fbeabd5
Fix an off by one
darrenburns Jan 3, 2024
0c0d979
Supporting Home and End in the wrapped document
darrenburns Jan 3, 2024
f39220c
Make click targeting work. However, we are still at the stage where s…
darrenburns Jan 4, 2024
6282735
Add location to offset conversion
darrenburns Jan 4, 2024
2e0e4e3
Click targeting, scrolling
darrenburns Jan 4, 2024
823c348
Clamping offsets
darrenburns Jan 4, 2024
de69905
Page up and page down
darrenburns Jan 4, 2024
4f6e2bd
Fix off by one in gutter width calculation
darrenburns Jan 4, 2024
6c54e32
Simplify
darrenburns Jan 4, 2024
8f6b152
Rewrapping when gutter width changes
darrenburns Jan 4, 2024
c600850
Fixing wrap width to account for scrollbars
darrenburns Jan 5, 2024
1902949
Ensuring cursor remains visible after toggling wrapping
darrenburns Jan 5, 2024
2db3083
Fix up on first doc line, down on last doc line
darrenburns Jan 5, 2024
b6d50f8
Fix IME positioning in wrapped documents
darrenburns Jan 5, 2024
f7a48a5
Add maintain_offsset
darrenburns Jan 6, 2024
de7c189
Snapping back to last horizontal offset where required
darrenburns Jan 8, 2024
c9c70ef
Fixing IME positioning when scrolled in wrapped doc
darrenburns Jan 8, 2024
1643406
Fix cursor not blinking in wrapped document
darrenburns Jan 8, 2024
b219733
Merge branch 'main' of github.com:Textualize/textual into text-area-w…
darrenburns Jan 8, 2024
24d419f
Parameterise "smart home key"
darrenburns Jan 8, 2024
b8fbb1e
Fixing delete to start of line
darrenburns Jan 8, 2024
ac9b88e
Fix deleting to end of line
darrenburns Jan 8, 2024
146c152
Configurable indent behaviour
darrenburns Jan 9, 2024
d0b01b1
Maintain offset when deleting a line
darrenburns Jan 9, 2024
b49781a
Maintain offset when deleting a line
darrenburns Jan 9, 2024
9fe7f63
Maintain cursor width
darrenburns Jan 9, 2024
264af63
Correctly setting line widths
darrenburns Jan 9, 2024
e000298
Fixing rendering when wrapping disabled
darrenburns Jan 9, 2024
6f41dc2
Remove some debugging
darrenburns Jan 10, 2024
9fb774c
Fix issue when crop start was == cell length of a Strip
darrenburns Jan 10, 2024
17448d1
Update changelog
darrenburns Jan 10, 2024
e1c59b0
Merge branch 'strip-crop-bug' into text-area-wrapping-widget-changes
darrenburns Jan 10, 2024
5843e91
Begin accounting for tab widths in wrap offset computation
darrenburns Jan 11, 2024
9912b76
Formatting
darrenburns Jan 11, 2024
7852a1e
Notes
darrenburns Jan 11, 2024
e626f8d
Remove duplicate method
darrenburns Jan 15, 2024
0da49c9
Fixing insert value on tab key press, tests for get_tab_widths
darrenburns Jan 16, 2024
ee9d1a8
Add tests for chunks
darrenburns Jan 16, 2024
43f8697
Fix chunking on whitespace only input
darrenburns Jan 16, 2024
57fbd23
Simplify chunk regex
darrenburns Jan 16, 2024
ac7c629
Testing cases where folding is required during wrapping
darrenburns Jan 16, 2024
4dcfadd
Adding more edge case tests
darrenburns Jan 16, 2024
7412ec7
Fix an off-by-one in wrapping
darrenburns Jan 17, 2024
418bc0e
Fix visual offset calculation when word folds during text area wrappi…
darrenburns Jan 17, 2024
af705f8
Fixing off-by-one
darrenburns Jan 17, 2024
0013e8c
Merge branch 'main' of github.com:Textualize/textual into text-area-w…
darrenburns Jan 17, 2024
6e5f199
Fix chunk re
darrenburns Jan 18, 2024
84f3934
Fix wrapped document tests
darrenburns Jan 18, 2024
0d87caa
Updating some more tests
darrenburns Jan 18, 2024
37db462
Fix issue with new delete line implementation
darrenburns Jan 18, 2024
910c62c
Fixing smart home
darrenburns Jan 18, 2024
d4c82e2
Updating chunk and divide_line tests using to reflect code changes
darrenburns Jan 18, 2024
7bfbaa1
We dont need always update on selection reactive
darrenburns Jan 18, 2024
b6a0ab5
Formatting
darrenburns Jan 18, 2024
7c967dc
Delete to line start should not use "smart home" behaviour
darrenburns Jan 18, 2024
29a9333
Only send TextArea SelectionChanged message when the selection actual…
darrenburns Jan 18, 2024
9be58ea
Merge branch 'main' into text-area-wrapping-widget-changes
darrenburns Jan 18, 2024
43ecfb6
Dependency update
darrenburns Jan 18, 2024
f8635c1
Rename wrap to soft_wrap
darrenburns Jan 18, 2024
42388fd
Merge branch 'text-area-wrapping-widget-changes' of github.com:Textua…
darrenburns Jan 18, 2024
32ea6ec
Update Rich
darrenburns Jan 18, 2024
4b80cf3
Fix Makefile whitespace
darrenburns Jan 18, 2024
9914cd0
WIP - precomputing tab sections
darrenburns Jan 18, 2024
12a0423
Applying correct tab widths after wrap/fold
darrenburns Jan 22, 2024
e77d8a0
Fix watcher name
darrenburns Jan 22, 2024
069bedb
Create snapshot test for wrapping and folding
darrenburns Jan 23, 2024
f496c11
Ensure we only wrap once on load
darrenburns Jan 23, 2024
ba6b0c7
Add syntax mark to test
darrenburns Jan 23, 2024
b122e94
Create code_editor constructor
darrenburns Jan 23, 2024
059e6b8
Updating tests to account for new defaults
darrenburns Jan 23, 2024
fdd64c9
Renaming
darrenburns Jan 23, 2024
5a35f3f
Merge branch 'main' of github.com:Textualize/textual into text-area-w…
darrenburns Jan 23, 2024
a678847
Updating CHANGELOG, docs
darrenburns Jan 23, 2024
65aee34
Docstrings and small renamings
darrenburns Jan 23, 2024
5af24a2
Making some things public, ensuring types exported
darrenburns Jan 23, 2024
bf2b9d5
Fix a mypy complaint
darrenburns Jan 23, 2024
abcec57
Fixing a few more mypy complaints
darrenburns Jan 23, 2024
07f64f3
Rename function to expand_text_tabs_from_widths and add docstring
darrenburns Jan 23, 2024
7f9a47c
Merge branch 'text-area-wrapping-widget-changes' of github.com:Textua…
darrenburns Jan 24, 2024
39e7a42
TextArea documentation updates
darrenburns Jan 24, 2024
9486dd6
Merge branch 'main' into text-area-wrapping-widget-changes
darrenburns Jan 24, 2024
a10eaf3
Update defaults in docs
darrenburns Jan 24, 2024
fce5cf1
Merge branch 'text-area-wrapping-widget-changes' of github.com:Textua…
darrenburns Jan 24, 2024
d68e683
Addressing pull request feedback
darrenburns Jan 25, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 11 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ and this project adheres to [Semantic Versioning](http://semver.org/).

### Changed

- Breaking change: Significant changes to `TextArea.__init__` default values/behaviour https://github.com/Textualize/textual/pull/3933
- `soft_wrap=True` - soft wrapping is now enabled by default.
- `show_line_numbers=False` - line numbers are now disabled by default.
- `tab_behaviour="focus"` - pressing the tab key now switches focus instead of indenting by default.
- Breaking change: `DOMNode.has_pseudo_class` now accepts a single name only https://github.com/Textualize/textual/pull/3970
- Made `textual.cache` (formerly `textual._cache`) public https://github.com/Textualize/textual/pull/3976
- `Tab.label` can now be used to change the label of a tab https://github.com/Textualize/textual/pull/3979
Expand All @@ -18,6 +22,11 @@ and this project adheres to [Semantic Versioning](http://semver.org/).

- Added `DOMNode.has_pseudo_classes` https://github.com/Textualize/textual/pull/3970
- Added `Widget.allow_focus` and `Widget.allow_focus_children` https://github.com/Textualize/textual/pull/3989
- Added `TextArea.soft_wrap` reactive attribute added https://github.com/Textualize/textual/pull/3933
- Added `TextArea.tab_behaviour` reactive attribute added https://github.com/Textualize/textual/pull/3933
- Added `TextArea.code_editor` classmethod/alternative constructor https://github.com/Textualize/textual/pull/3933
- Added `TextArea.wrapped_document` attribute which can convert between wrapped visual coordinates and locations https://github.com/Textualize/textual/pull/3933
- Added `show_line_numbers` to `TextArea.__init__` https://github.com/Textualize/textual/pull/3933
- Added `Query.blur` and `Query.focus` https://github.com/Textualize/textual/pull/4012
- Added `MessagePump.message_queue_size` https://github.com/Textualize/textual/pull/4012
- Added `TabbedContent.active_pane` https://github.com/Textualize/textual/pull/4012
Expand All @@ -30,10 +39,10 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
- `SelectionList` option IDs are usable as soon as the widget is instantiated https://github.com/Textualize/textual/issues/3903
- Fix issue with `Strip.crop` when crop window start aligned with strip end https://github.com/Textualize/textual/pull/3998
- Fixed Strip.crop_extend https://github.com/Textualize/textual/pull/4011
- Fixed a crash if the `TextArea` language was set but tree-sitter language binaries were not installed https://github.com/Textualize/textual/issues/4045
- Ensuring `TextArea.SelectionChanged` message only sends when the updated selection is different https://github.com/Textualize/textual/pull/3933
- Fixed declaration after nested rule set causing a parse error https://github.com/Textualize/textual/pull/4012
- ID and class validation was too lenient https://github.com/Textualize/textual/issues/3954
- Fixed a crash if the `TextArea` language was set but tree-sitter lanuage binaries were not installed https://github.com/Textualize/textual/issues/4045


## [0.47.1] - 2023-01-05

Expand Down
66 changes: 47 additions & 19 deletions docs/widgets/text_area.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,26 @@

# TextArea

!!! tip "Added in version 0.38.0"
!!! tip

Added in version 0.38.0. Soft wrapping added in version 0.48.0.

A widget for editing text which may span multiple lines.
Supports syntax highlighting for a selection of languages.
Supports text selection, soft wrapping, optional syntax highlighting with tree-sitter
and a variety of keybindings.

- [x] Focusable
- [ ] Container


## Guide

### Code editing vs plain text editing

By default, the `TextArea` widget is a standard multi-line input box with soft-wrapping enabled.

If you're interested in editing code, you may wish to use the [`TextArea.code_editor`] convenience constructor.
This is a method which, by default, returns a new `TextArea` with soft-wrapping disabled, line numbers enabled, and the tab key behavior configured to insert `\t`.

### Syntax highlighting dependencies

To enable syntax highlighting, you'll need to install the `syntax` extra dependencies:
Expand All @@ -29,7 +38,8 @@ To enable syntax highlighting, you'll need to install the `syntax` extra depende
```

This will install `tree-sitter` and `tree-sitter-languages`.
These packages are distributed as binary wheels, so it may limit your applications ability to run in environments where these wheels are not supported.
These packages are distributed as binary wheels, so it may limit your applications ability to run in environments where these wheels are not available.
After installing, you can set the [`language`][textual.widgets._text_area.TextArea.language] reactive attribute on the `TextArea` to enable highlighting.

### Loading text

Expand All @@ -46,8 +56,7 @@ In this example we load some initial text into the `TextArea`, and set the langu
--8<-- "docs/examples/widgets/text_area_example.py"
```

To load content into the `TextArea` after it has already been created,
use the [`load_text`][textual.widgets._text_area.TextArea.load_text] method.
To update the content programmatically, set the [`text`][textual.widgets._text_area.TextArea.text] property to a string value.

To update the parser used for syntax highlighting, set the [`language`][textual.widgets._text_area.TextArea.language] reactive attribute:

Expand Down Expand Up @@ -82,7 +91,7 @@ Some other convenient methods are available, such as [`insert`][textual.widgets.
#### Moving the cursor

The cursor location is available via the [`cursor_location`][textual.widgets._text_area.TextArea.cursor_location] property, which represents
the location of the cursor as a tuple `(row_index, column_index)`. These indices are zero-based.
the location of the cursor as a tuple `(row_index, column_index)`. These indices are zero-based and represent the position of the cursor in the content.
Writing a new value to `cursor_location` will immediately update the location of the cursor.

```python
Expand Down Expand Up @@ -262,6 +271,12 @@ This immediately updates the appearance of the `TextArea`:
```{.textual path="docs/examples/widgets/text_area_custom_theme.py" columns="42" lines="8"}
```

### Tab behaviour

Pressing the ++tab++ key will shift focus to the next widget in your application by default.
This matches how other widgets work in Textual.
To have ++tab++ insert a `\t` character, set the `tab_behaviour` attribute to the string value `"indent"`.

### Indentation

The character(s) inserted when you press tab is controlled by setting the `indent_type` attribute to either `tabs` or `spaces`.
Expand Down Expand Up @@ -315,7 +330,7 @@ Let's extend `TextArea` to add a feature which automatically closes parentheses
This intercepts the key handler when `"("` is pressed, and inserts `"()"` instead.
It then moves the cursor so that it lands between the open and closing parentheses.

Typing `def hello(` into the `TextArea` results in the bracket automatically being closed:
Typing "`def hello(`" into the `TextArea` now results in the bracket automatically being closed:

```{.textual path="docs/examples/widgets/text_area_extended.py" columns="36" lines="4" press="d,e,f,space,h,e,l,l,o,left_parenthesis"}
```
Expand Down Expand Up @@ -430,17 +445,28 @@ If you notice some highlights are missing after registering a language, the issu
The names assigned in tree-sitter highlight queries are often reused across multiple languages.
For example, `@string` is used in many languages to highlight strings.


#### Navigation and wrapping information

If you're building functionality on top of `TextArea`, it may be useful to inspect the `navigator` and `wrapped_document` attributes.

- `navigator` is a [`DocumentNavigator`][textual.widgets.text_area.DocumentNavigator] instance which can give us general information about the cursor's location within a document, as well as where the cursor will move to when certain actions are performed.
- `wrapped_document` is a [`WrappedDocument`][textual.widgets.text_area.WrappedDocument] instance which can be used to convert document locations to visual locations, taking wrapping into account. It also offers a variety of other convenience methods and properties.

A detailed view of these classes is out of scope, but do note that a lot of the functionality of `TextArea` exists within them, so inspecting them could be worthwhile.

## Reactive attributes

| Name | Type | Default | Description |
|------------------------|--------------------------|--------------------|--------------------------------------------------|
| `language` | `str | None` | `None` | The language to use for syntax highlighting. |
| `theme` | `str | None` | `TextAreaTheme.default()` | The theme to use for syntax highlighting. |
| `selection` | `Selection` | `Selection()` | The current selection. |
| `show_line_numbers` | `bool` | `True` | Show or hide line numbers. |
| `indent_width` | `int` | `4` | The number of spaces to indent and width of tabs. |
| `match_cursor_bracket` | `bool` | `True` | Enable/disable highlighting matching brackets under cursor. |
| `cursor_blink` | `bool` | `True` | Enable/disable blinking of the cursor when the widget has focus. |
| Name | Type | Default | Description |
|------------------------|--------------------------|---------------|------------------------------------------------------------------|
| `language` | `str | None` | `None` | The language to use for syntax highlighting. |
| `theme` | `str | None` | `TextAreaTheme.default()` | The theme to use for syntax highlighting. |
| `selection` | `Selection` | `Selection()` | The current selection. |
| `show_line_numbers` | `bool` | `False` | Show or hide line numbers. |
| `indent_width` | `int` | `4` | The number of spaces to indent and width of tabs. |
| `match_cursor_bracket` | `bool` | `True` | Enable/disable highlighting matching brackets under cursor. |
| `cursor_blink` | `bool` | `True` | Enable/disable blinking of the cursor when the widget has focus. |
| `soft_wrap` | `bool` | `True` | Enable/disable soft wrapping. |

## Messages

Expand All @@ -465,8 +491,10 @@ Styling should be done exclusively via [`TextAreaTheme`][textual.widgets.text_ar

## See also

- [`Input`][textual.widgets.Input] - for single-line text input.
- [`TextAreaTheme`][textual.widgets.text_area.TextAreaTheme] - for theming the `TextArea`.
- [`Input`][textual.widgets.Input] - single-line text input widget
- [`TextAreaTheme`][textual.widgets.text_area.TextAreaTheme] - theming the `TextArea`
- [`DocumentNavigator`][textual.widgets.text_area.DocumentNavigator] - guides cursor movement
- [`WrappedDocument`][textual.widgets.text_area.WrappedDocument] - manages wrapping the document
- The tree-sitter documentation [website](https://tree-sitter.github.io/tree-sitter/).
- The tree-sitter Python bindings [repository](https://github.com/tree-sitter/py-tree-sitter).
- `py-tree-sitter-languages` [repository](https://github.com/grantjenks/py-tree-sitter-languages) (provides binary wheels for a large variety of tree-sitter languages).
Expand Down
Loading
Loading