Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
poezio
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
204
Issues
204
List
Boards
Labels
Service Desk
Milestones
Merge Requests
9
Merge Requests
9
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
poezio
poezio
Commits
1ccfd095
Commit
1ccfd095
authored
Nov 08, 2011
by
louiz’
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
poopt now handles correctly the size of the chars by jumping
the color attributes properly and ignoring their length.
parent
9c5cab09
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
3 deletions
+18
-3
src/pooptmodule.c
src/pooptmodule.c
+18
-3
No files found.
src/pooptmodule.c
View file @
1ccfd095
...
...
@@ -44,6 +44,8 @@ static PyObject *poopt_cut_text(PyObject *self, PyObject *args)
int
last_space
=
-
1
;
int
start_pos
=
0
;
int
w
=
width
;
/* this is a width that increases to make the length of char
of colors attribute be ignored */
PyObject
*
retlist
=
PyList_New
(
0
);
while
(
buffer
[
bpos
])
...
...
@@ -57,7 +59,7 @@ static PyObject *poopt_cut_text(PyObject *self, PyObject *args)
start_pos
=
spos
+
1
;
last_space
=
-
1
;
}
else
if
((
spos
-
start_pos
)
>=
w
idth
)
else
if
((
spos
-
start_pos
)
>=
w
)
{
if
(
last_space
==
-
1
)
{
...
...
@@ -72,11 +74,24 @@ static PyObject *poopt_cut_text(PyObject *self, PyObject *args)
start_pos
=
last_space
+
1
;
last_space
=
-
1
;
}
w
=
width
;
}
if
(
buffer
[
bpos
]
==
25
)
/* \x19 */
{
spos
++
;
bpos
+=
2
;
while
(
buffer
[
bpos
]
&&
buffer
[
bpos
]
!=
'u'
&&
buffer
[
bpos
]
!=
'b'
&&
buffer
[
bpos
]
!=
'o'
&&
buffer
[
bpos
]
!=
'}'
)
{
bpos
++
;
spos
++
;
w
++
;
}
bpos
++
;
spos
++
;
w
++
;
spos
--
;
}
else
if
(
buffer
[
bpos
]
<=
127
)
/* ASCII char on one byte */
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment