flexablelib-speedups 3.7.8__tar.gz → 3.7.10__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: flexablelib-speedups
3
- Version: 3.7.8
3
+ Version: 3.7.10
4
4
  Summary: Optional C acceleration of terminal frame drawing for flexablelib (cut, pad, borders, frame diffs, images).
5
5
  Home-page: https://github.com/Opus-Perpetuus/flexablelib
6
6
  Author: Benjamin Ramirez
@@ -6,7 +6,7 @@ directly: :mod:`flexablelib._frames` picks it up when it is installed and
6
6
  falls back to identical pure-Python code when it is not.
7
7
  """
8
8
 
9
- __version__ = '3.7.8'
9
+ __version__ = '3.7.10'
10
10
 
11
11
  from . import _frames # noqa: F401,E402
12
12
 
@@ -269,7 +269,15 @@ truncate_impl(PyObject *text, Py_ssize_t width, PyObject *suffix)
269
269
  sw = measure(skind, sdata, slen);
270
270
  if (width <= sw) {
271
271
  if (width <= 0) return PyUnicode_FromString("");
272
- return PyUnicode_Substring(suffix, 0, width < slen ? width : slen);
272
+ if (width == sw) return Py_NewRef(suffix); /* fits as it is */
273
+ /* as much of the marker as fits, cut by columns (a wide or
274
+ coloured marker must neither overflow nor be split) */
275
+ if (buf_init(&b, slen + 4) < 0) return NULL;
276
+ if (cut_into(&b, skind, sdata, slen, width, NULL) < 0) {
277
+ PyMem_Free(b.data);
278
+ return NULL;
279
+ }
280
+ return buf_finish(&b);
273
281
  }
274
282
  if (buf_init(&b, length + slen + 4) < 0) return NULL;
275
283
  if (cut_into(&b, kind, data, length, width - sw, suffix) < 0) {
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: flexablelib-speedups
3
- Version: 3.7.8
3
+ Version: 3.7.10
4
4
  Summary: Optional C acceleration of terminal frame drawing for flexablelib (cut, pad, borders, frame diffs, images).
5
5
  Home-page: https://github.com/Opus-Perpetuus/flexablelib
6
6
  Author: Benjamin Ramirez