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
205
Issues
205
List
Boards
Labels
Service Desk
Milestones
Merge Requests
10
Merge Requests
10
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
poezio
poezio
Commits
dc791057
Commit
dc791057
authored
Dec 21, 2010
by
louiz@4325f9fc-e183-4c21-96ce-0ab188b42d13
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
improve performances a little more. And avoid a very rare crash, too
parent
ac3e0f70
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
21 deletions
+15
-21
src/windows.py
src/windows.py
+15
-21
No files found.
src/windows.py
View file @
dc791057
...
...
@@ -405,10 +405,11 @@ class TextWin(Win):
# on resize, we rebuild all the messages
def
scroll_up
(
self
,
dist
=
14
):
# The pos can grow a lot over the top of the number of
# available lines, it will be fixed on the next refresh of the
# screen anyway
self
.
pos
+=
dist
if
self
.
pos
+
self
.
height
>
len
(
self
.
built_lines
):
self
.
pos
=
len
(
self
.
built_lines
)
-
self
.
height
if
self
.
pos
<
0
:
self
.
pos
=
0
def
scroll_down
(
self
,
dist
=
14
):
self
.
pos
-=
dist
...
...
@@ -502,31 +503,24 @@ class TextWin(Win):
"""
if
self
.
height
<=
0
:
return
if
self
.
pos
!=
0
:
lines
=
self
.
built_lines
[
-
self
.
height
-
self
.
pos
:
-
self
.
pos
]
else
:
lines
=
self
.
built_lines
[
-
self
.
height
:]
self
.
_win
.
move
(
0
,
0
)
with
g_lock
:
self
.
_win
.
erase
()
# lines = self.build_lines_from_messages(room.messages)
lines
=
self
.
built_lines
if
self
.
pos
+
self
.
height
>
len
(
lines
):
self
.
pos
=
len
(
lines
)
-
self
.
height
if
self
.
pos
<
0
:
self
.
pos
=
0
if
self
.
pos
!=
0
:
lines
=
lines
[
-
self
.
height
-
self
.
pos
:
-
self
.
pos
]
else
:
lines
=
lines
[
-
self
.
height
:]
y
=
0
for
line
in
lines
:
self
.
_win
.
move
(
y
,
0
)
if
line
==
None
:
for
y
,
line
in
enumerate
(
lines
):
if
line
is
None
:
self
.
write_line_separator
()
y
+=
1
continue
if
line
.
time
is
not
None
:
if
line
.
time
:
self
.
write_time
(
line
.
time
)
if
line
.
nickname
is
not
None
:
if
line
.
nickname
:
self
.
write_nickname
(
line
.
nickname
,
line
.
nickname_color
)
self
.
write_text
(
y
,
line
.
text_offset
,
line
.
text
,
line
.
text_color
,
line
.
colorized
)
y
+=
1
if
y
!=
self
.
height
-
1
:
self
.
addstr
(
'
\n
'
)
self
.
_refresh
()
def
write_line_separator
(
self
):
...
...
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