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
Open sidebar
emacs
emacs
Commits
1d1d7ba0
Commit
1d1d7ba0
authored
Sep 21, 1992
by
Joseph Arceneaux
Browse files
comment changes
parent
d7c9f762
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
30 additions
and
7 deletions
+30
-7
src/intervals.c
src/intervals.c
+30
-7
No files found.
src/intervals.c
View file @
1d1d7ba0
...
...
@@ -631,7 +631,7 @@ adjust_intervals_for_insertion (tree, position, length)
is actually between the two intervals, make the new text belong to
the interval which is "sticky".
If both intervals are "stick", then make them belong to the left-most
If both intervals are "stick
y
", then make them belong to the left-most
interval. Another possibility would be to create a new interval for
this text, and make it have the merged properties of both ends. */
...
...
@@ -839,12 +839,14 @@ delete_interval (i)
}
}
/* Recurse down to the interval containing FROM. Then delete as much
as possible (up to AMOUNT) from that interval, adjusting parental
intervals on the way up. If an interval is zeroed out, then
it is deleted.
/* Find the interval in TREE corresponding to the character position FROM
and delete as much as possible of AMOUNT from that interval, starting
after the relative position of FROM within it. Return the amount
actually deleted, and if the interval was zeroed-out, delete that
interval node from the tree.
Returns the amount deleted. */
Do this by recursing down TREE to the interval in question, and
deleting the appropriate amount of text. */
static
int
interval_deletion_adjustment
(
tree
,
from
,
amount
)
...
...
@@ -924,9 +926,15 @@ interval_deletion_adjustment (tree, from, amount)
}
}
/* Never reach here */
abort
();
}
/* Effect the adjustments neccessary to the interval tree of BUFFER
to correspond to the deletion of LENGTH characters from that buffer
text. The deletion is effected at position START (relative to the
buffer). */
static
void
adjust_intervals_for_deletion
(
buffer
,
start
,
length
)
struct
buffer
*
buffer
;
...
...
@@ -966,7 +974,10 @@ adjust_intervals_for_deletion (buffer, start, length)
}
}
/* Note that all intervals in OBJECT after START have slid by LENGTH. */
/* Make the adjustments neccessary to the interval tree of BUFFER to
represent an addition or deletion of LENGTH characters starting
at position START. Addition or deletion is indicated by the sign
of LENGTH. */
INLINE
void
offset_intervals
(
buffer
,
start
,
length
)
...
...
@@ -982,6 +993,11 @@ offset_intervals (buffer, start, length)
adjust_intervals_for_deletion
(
buffer
,
start
,
-
length
);
}
/* Make an exact copy of interval tree SOURCE which descends from
PARENT. This is done by recursing through SOURCE, copying
the current interval and its properties, and then adjusting
the pointers of the copy. */
static
INTERVAL
reproduce_tree
(
source
,
parent
)
INTERVAL
source
,
parent
;
...
...
@@ -999,6 +1015,13 @@ reproduce_tree (source, parent)
return
t
;
}
/* Make a new interval of length LENGTH starting at START in the
group of intervals INTERVALS, which is actually an interval tree.
Returns the new interval.
Generate an error if the new positions would overlap an existing
interval. */
static
INTERVAL
make_new_interval
(
intervals
,
start
,
length
)
INTERVAL
intervals
;
...
...
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