Skip to content

Commit

Permalink
Remove unused Textbuf::Print
Browse files Browse the repository at this point in the history
  • Loading branch information
JGRennison committed Oct 6, 2024
1 parent 735f97b commit 9596325
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 24 deletions.
23 changes: 0 additions & 23 deletions src/textbuf.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -457,29 +457,6 @@ void Textbuf::Assign(const std::string_view text)
this->UpdateSize();
}

/**
* Print a formatted string into the textbuffer.
*/
void Textbuf::Print(const char *format, ...)
{
const char *last_of = &this->buf[this->max_bytes - 1];
va_list va;
va_start(va, format);
vseprintf(this->buf, last_of, format, va);
va_end(va);

StrMakeValidInPlace(this->buf, last_of, SVS_NONE);

/* Make sure the name isn't too long for the text buffer in the number of
* characters (not bytes). max_chars also counts the '\0' characters. */
while (Utf8StringLength(this->buf) + 1 > this->max_chars) {
*Utf8PrevChar(this->buf + strlen(this->buf)) = '\0';
}

this->UpdateSize();
}


/**
* Update Textbuf type with its actual physical character and screenlength
* Get the count of characters in the string as well as the width in pixels.
Expand Down
1 change: 0 additions & 1 deletion src/textbuf_type.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ struct Textbuf {

void Assign(StringID string);
void Assign(const std::string_view text);
void CDECL Print(const char *format, ...) WARN_FORMAT(2, 3);

void DeleteAll();
bool InsertClipboard();
Expand Down

0 comments on commit 9596325

Please sign in to comment.