* widgets: text-area: Make the starting line number a kwarg
* Add snapshot test for TextArea.line_number_start and update docs
* Update snapshots
* Update snapshots using latest Textual version
---------
Co-authored-by: Darren Burns <darrenb900@gmail.com>
* Preamble. Mention commonly searched for capabilities missing, e.g., formatting and filtering.
* Clarify zebra_stripes as using alternating styles.
* Expand Cursors section to mention None type of cursor, clarify keyboard and mouse events, and that row indices start at one. Expand example for No Cursor option.
Also minor typos to previous two commits (preamble wording and zebra stripes).
* Expand sorting section for clarity.
Minor typos in Labeled Rows and Cursors sections.
* In Keys section, mention functions taking coordinates.
Fix typo in Sorting section.
* Minor changes
---------
Co-authored-by: Darren Burns <darrenb900@gmail.com>
Although we can't quite see what would be a use case for a tabbed content where there are tabs and none of them are active (for example, it's weird to think of a browser where we have a bunch of tabs open and none of them are active...), we decided we'd let that possibility exist in code: the reactive `.active` can be set to the empty string both on `Tabs` and on `TabbedContent`.
Sorry but I spotted that the syntax highlighting was wrong in my last PR to
add tcss to the docs (#4171) where I had blindly copy pasted the code.
A quick grep found a few other places in the docs where the syntax
highlighting was wrong. This PR corrects the language to css.
* Initial undo related machinery added to TextArea
* Initial undo implementation
* Basic undo and redo
* Some more fleshing out of undo and redo
* Skeleton code for managing TextArea history
* Initial implementation of undo & redo checkpointing in TextArea
* Increase checkpoint characters
* Restoring the selection in the TextArea and then restoring it on undo
* Adding docstrings to undo_batch and redo_batch in the TextArea
* Batching edits of the same type
* Batching edits of the same type
* Keeping edits containing newlines in their own batch
* Checking for newline characters in insertion or replacement during undo checkpoint creation. Updating docstrings in history.py
* Fix mypy warning
* Performance improvement
* Add history checkpoint on cursor movement
* Fixing merge conflict in Edit class
* Fixing error in merge conflict resolution
* Remove unused test file
* Remove unused test file
* Initial testing of undo and redo
* Testing for undo redo
* Updating lockfile
* Add an extra test
* Fix: setting the `text` property programmatically should invalidate the edit history
* Improving docstrings
* Rename EditHistory.reset() to EditHistory.clear()
* Add docstring to an exception
* Add a pause after focus/blur in a test
* Forcing CI colour
* Update focus checkpoint test
* Try to force color in pytest by setting --color=yes in PYTEST_ADDOPTS in env var on Github Actions
* Add extra assertion in a test
* Toggle text_area has focus to trigger checkpoint in history
* Apply grammar/wording suggestions from code review
Co-authored-by: Rodrigo Girão Serrão <5621605+rodrigogiraoserrao@users.noreply.github.com>
* Making max checkpoints configurable in TextArea history
* Improve a docstring
* Update changelog
* Spelling fixes
* More spelling fixes
* Americanize spelling of tab_behaviour (->tab_behavior)
* Update CHANGELOG regarding `tab_behaviour`->`tab_behavior`
* Various fixes
* Various fixes and improvements
* Updating tests to account for themes always being non-None
* Update CHANGELOG.
* Add TextArea.read_only to reactive attr table in TextArea docs
* Update TextArea docs regarding new features
* Cleaning up some typing issues
* Add actions for undo and redo
* Fix a typo
* Fix wording in docs/widgets/text_area.md
Co-authored-by: Rodrigo Girão Serrão <5621605+rodrigogiraoserrao@users.noreply.github.com>
* Re-add return type hint
* PR feedback and fixing typos
* Mark breaking change in CHANGELOG
* Add undo/redo to docstring
* Add note on undo/redo bindings
---------
Co-authored-by: Rodrigo Girão Serrão <5621605+rodrigogiraoserrao@users.noreply.github.com>
* Initial undo related machinery added to TextArea
* Initial undo implementation
* Basic undo and redo
* Some more fleshing out of undo and redo
* Skeleton code for managing TextArea history
* Initial implementation of undo & redo checkpointing in TextArea
* Increase checkpoint characters
* Restoring the selection in the TextArea and then restoring it on undo
* Adding docstrings to undo_batch and redo_batch in the TextArea
* Batching edits of the same type
* Batching edits of the same type
* Keeping edits containing newlines in their own batch
* Checking for newline characters in insertion or replacement during undo checkpoint creation. Updating docstrings in history.py
* Fix mypy warning
* Performance improvement
* Add history checkpoint on cursor movement
* Fixing merge conflict in Edit class
* Fixing error in merge conflict resolution
* Remove unused test file
* Remove unused test file
* Initial testing of undo and redo
* Testing for undo redo
* Updating lockfile
* Add an extra test
* Fix: setting the `text` property programmatically should invalidate the edit history
* Improving docstrings
* Rename EditHistory.reset() to EditHistory.clear()
* Add docstring to an exception
* Add a pause after focus/blur in a test
* Forcing CI colour
* Update focus checkpoint test
* Try to force color in pytest by setting --color=yes in PYTEST_ADDOPTS in env var on Github Actions
* Add extra assertion in a test
* Toggle text_area has focus to trigger checkpoint in history
* Apply grammar/wording suggestions from code review
Co-authored-by: Rodrigo Girão Serrão <5621605+rodrigogiraoserrao@users.noreply.github.com>
* Making max checkpoints configurable in TextArea history
* Improve a docstring
* Update changelog
* Spelling fixes
* More spelling fixes
* Americanize spelling of tab_behaviour (->tab_behavior)
* Update CHANGELOG regarding `tab_behaviour`->`tab_behavior`
---------
Co-authored-by: Rodrigo Girão Serrão <5621605+rodrigogiraoserrao@users.noreply.github.com>
* Starting CSS work for TextArea
* Remove xfail marker from test
* Adding component classes to TextArea, not using them yet
* Adding docstring for TextArea new component classes
* Passing all component styles to the theme so that they may be applied.
* Applying cursor component style
* Applying text-area--cursor-line component style
* Applying text-area--cursor-gutter component style
* Applying gutter cursor style correctly
* Default cursor styling
* CSS theming of the selection style
* default matching bracket theme in text area
* Support toggling dark and light mode
* Improve the theme on light mode for the cursor
* null check
* Snapshot for new default "css" theme of TextArea
* Hide cursor when TextArea doesnt have focus
* Some new docs for TextArea
* Add border to TextArea to fit more with Input
* Add note on how to remove the focus border effect
* Updating snapshots
* Updating snapshots
* Fixing tests to account for new TextArea border
* Fix a typo
* Updating CHANGELOG
* Update docs/widgets/text_area.md
Co-authored-by: Rodrigo Girão Serrão <5621605+rodrigogiraoserrao@users.noreply.github.com>
* Add missing docstring
---------
Co-authored-by: Rodrigo Girão Serrão <5621605+rodrigogiraoserrao@users.noreply.github.com>