зеркало из
https://github.com/glebtv/tui-textarea.git
synced 2026-08-28 11:36:17 +03:00
fix typos
Этот коммит содержится в:
2
.typos.toml
Обычный файл
2
.typos.toml
Обычный файл
@@ -0,0 +1,2 @@
|
||||
[default.extend-words]
|
||||
ratatui = "ratatui"
|
||||
@@ -373,7 +373,7 @@ impl CursorMove {
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
// Seaparate tests for tui-rs support
|
||||
// Separate tests for tui-rs support
|
||||
#[test]
|
||||
fn in_viewport() {
|
||||
use crate::ratatui::buffer::Buffer;
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
use crate::widget::Viewport;
|
||||
#[cfg(feature = "serde")]
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
/// Specify how to scroll the textarea.
|
||||
///
|
||||
/// This type is marked as `#[non_exhaustive]` since more variations may be supported in the future. Note that the cursor will
|
||||
@@ -188,7 +189,7 @@ impl From<(i16, i16)> for Scrolling {
|
||||
mod tests {
|
||||
use super::*;
|
||||
|
||||
// Seaparate tests for tui-rs support
|
||||
// Separate tests for tui-rs support
|
||||
#[test]
|
||||
fn delta() {
|
||||
use crate::ratatui::buffer::Buffer;
|
||||
|
||||
@@ -1648,7 +1648,7 @@ impl<'a> TextArea<'a> {
|
||||
/// ```
|
||||
#[deprecated(
|
||||
since = "0.5.3",
|
||||
note = "calling this method is no longer neccessary on rendering a textarea. pass &TextArea reference to `Frame::render_widget` method call directly"
|
||||
note = "calling this method is no longer necessary on rendering a textarea. pass &TextArea reference to `Frame::render_widget` method call directly"
|
||||
)]
|
||||
pub fn widget(&'a self) -> impl Widget + 'a {
|
||||
self
|
||||
@@ -2362,7 +2362,7 @@ impl<'a> TextArea<'a> {
|
||||
mod tests {
|
||||
use super::*;
|
||||
|
||||
// Seaparate tests for tui-rs support
|
||||
// Separate tests for tui-rs support
|
||||
#[test]
|
||||
fn scroll() {
|
||||
use crate::ratatui::buffer::Buffer;
|
||||
|
||||
@@ -115,9 +115,9 @@ impl<'a> TextArea<'a> {
|
||||
|
||||
fn scroll_top_col(&self, prev_top: u16, width: u16) -> u16 {
|
||||
let mut cursor = self.cursor().1 as u16;
|
||||
// Adjust the cursor position due to the width of line number.
|
||||
if self.line_number_style().is_some() {
|
||||
// Adjust the cursor position due to the width of line number. `+ 2` for margins
|
||||
let lnum = num_digits(self.lines().len()) as u16 + 2;
|
||||
let lnum = num_digits(self.lines().len()) as u16 + 2; // `+ 2` for margins
|
||||
if cursor <= lnum {
|
||||
cursor *= 2; // Smoothly slide the line number into the screen on scrolling left
|
||||
} else {
|
||||
@@ -155,7 +155,7 @@ impl Widget for &TextArea<'_> {
|
||||
if let Some(b) = self.block() {
|
||||
text_area = b.inner(area);
|
||||
// ratatui does not need `clone()` call because `Block` implements `WidgetRef` and `&T` implements `Widget`
|
||||
// where `T: Widget`. So `b.render` internally calls `b.render_ref` and it doesn't move out `self`.
|
||||
// where `T: WidgetRef`. So `b.render` internally calls `b.render_ref` and it doesn't move out `self`.
|
||||
#[cfg(feature = "tuirs")]
|
||||
let b = b.clone();
|
||||
b.render(area, buf)
|
||||
|
||||
@@ -286,7 +286,7 @@ fn word_end() {
|
||||
for (lines, positions) in [
|
||||
(
|
||||
&[
|
||||
"aaa !!! bbb", // Consective punctuations are a word
|
||||
"aaa !!! bbb", // Consecutive punctuations are a word
|
||||
][..],
|
||||
&[(0, 2), (0, 6), (0, 10)][..],
|
||||
),
|
||||
|
||||
Ссылка в новой задаче
Block a user