[rust] add nccell_cols, deprecate nccell_width

pull/2011/head
joseLuís 3 years ago
parent 08b376c6c2
commit acbd0ffeeb

@ -63,7 +63,6 @@ pub use ffi::{
nccell_extended_gcluster,
nccell_load,
nccell_release,
nccell_width,
nccells_double_box,
nccells_rounded_box,
};

@ -7,7 +7,6 @@
// ------------------------------------------
//… nccell_extended_gcluster
//… nccell_load
// nccell_width
//W nccells_double_box
//W nccells_rounded_box
//W nccell_duplicate
@ -26,6 +25,7 @@
//W# nccell_bg_palindex_p
//W# nccell_bg_rgb
//W# nccell_bg_rgb8
// + nccell_cols
//W+ nccell_double_wide_p
//W+ nccell_extract
//W# nccell_fchannel

@ -289,6 +289,22 @@ pub fn nccell_set_styles(cell: &mut NcCell, stylebits: NcStyle) {
// Chars -----------------------------------------------------------------------
/// Returns the number of columns occupied by 'c'. see ncstrwidth() for an
/// equivalent for multiple EGCs.
#[inline]
pub const fn nccell_cols(cell: &NcCell) -> u8 {
if cell.width != 0 {
cell.width
} else {
1
}
}
#[deprecated]
pub fn nccell_width(plane: &NcPlane, cell: &NcCell) -> NcIntResult {
unsafe { crate::ffi::nccell_width(plane, cell) }
}
/// Does the [`NcCell`] contain an East Asian Wide codepoint?
///
/// *Method: NcCell.[double_wide_p()][NcCell#method.double_wide_p].*

Loading…
Cancel
Save