Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
frama-c
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container Registry
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
pub
frama-c
Commits
13b0b38b
Commit
13b0b38b
authored
5 years ago
by
Loïc Correnson
Browse files
Options
Downloads
Patches
Plain Diff
[Dome/text] added flushline
parent
9c0fe5a9
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
Ivette/src/dome/src/renderer/text/buffers.js
+15
-4
15 additions, 4 deletions
Ivette/src/dome/src/renderer/text/buffers.js
with
15 additions
and
4 deletions
Ivette/src/dome/src/renderer/text/buffers.js
+
15
−
4
View file @
13b0b38b
...
...
@@ -142,16 +142,27 @@ export class Buffer extends Emitter {
}
}
/**
@summary Starts a new line in the buffer.
@description
If the current buffer content does not finish at the beginning of a fresh line,
inserts a newline character.
*/
flushline
()
{
const
doc
=
this
.
_doc
;
const
from
=
doc
.
posFromIndex
(
Infinity
);
if
(
from
.
ch
>
0
)
doc
.
replaceRange
(
'
\n
'
,
from
,
undefined
,
'
flush
'
);
}
/**
@summary Appends with newline and auto-scrolling.
@param {any} [value] - content to append in the buffer
@description
This is a short-cut to `append(...value)`, followed by
`append('\n')` and `scroll()`.
This is a short-cut to `flushline()` followed by `append(...value,'\n')` and `scroll()`.
*/
log
(...
value
)
{
this
.
append
(...
value
);
this
.
append
(
'
\n
'
);
this
.
flushline
(
);
this
.
append
(
...
value
,
'
\n
'
);
this
.
scroll
();
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment