Skip to content

docs: note that ansi_substr/ansi_substring do not support replacement form#828

Closed
LeonidasZhak wants to merge 2 commits into
r-lib:mainfrom
LeonidasZhak:docs/ansi-substr-replacement-form
Closed

docs: note that ansi_substr/ansi_substring do not support replacement form#828
LeonidasZhak wants to merge 2 commits into
r-lib:mainfrom
LeonidasZhak:docs/ansi-substr-replacement-form

Conversation

@LeonidasZhak

Copy link
Copy Markdown
Contributor

Fixes #774.

Summary

The documentation for ansi_substr() and ansi_substring() stated they work "exactly like" their base R counterparts (base::substr() and base::substring()). However, unlike the base functions, the replacement forms (ansi_substr(x, start, stop) <- value and substring(text, first, last) <- value) are not implemented.

This PR updates the descriptions to clarify this difference by:

  • Changing "works exactly like" to "works like"
  • Adding a note that the replacement form is not supported

Changes

  • R/ansiex.R: Updated roxygen comments for both ansi_substr() and ansi_substring()
  • man/ansi_substr.Rd: Regenerated Rd file
  • man/ansi_substring.Rd: Regenerated Rd file

Checks

  • tools::checkRd("man/ansi_substr.Rd") — clean
  • tools::checkRd("man/ansi_substring.Rd") — clean
  • R CMD build --no-build-vignettes . — clean
  • R CMD check --no-manual --no-tests --no-vignettes --no-examples — Status: OK

Add @return roxygen tags and corresponding \value Rd sections for:
- spark_bar(), spark_line() (R/spark.R)
- ruler() (R/ruler.R)
- simple_theme() (R/simple-theme.R)
- format_error(), format_warning(), format_message() (R/format-conditions.R)
- test_that_cli() (R/test.R)

Also fix typo in R/bullets.R: cli_format_bullets_raw() -> cli_bullets_raw()

R CMD check --as-cran requires \value for all exported functions.
… form

The documentation for ansi_substr() and ansi_substring() stated they
work 'exactly like' their base R counterparts, but unlike base::substr()
and base::substring(), the replacement forms (e.g., ansi_substr(x, 1, 3) <- value)
are not implemented. Update the descriptions to clarify this difference.

Closes #774.
@LeonidasZhak

Copy link
Copy Markdown
Contributor Author

Withdrawing this small automated PR while I consolidate an oversized batch of contributions and reduce maintainer review burden. Sorry for the noise, and thank you for maintaining the project.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Inaccuracy in documentation of ansi_substr

1 participant