Skip to content

Commit

Permalink
Remove more zcreatemrks.
Browse files Browse the repository at this point in the history
  • Loading branch information
smaclennan committed Dec 3, 2015
1 parent 70de902 commit a02ee20
Showing 1 changed file with 15 additions and 7 deletions.
22 changes: 15 additions & 7 deletions delete.c
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,11 @@ void Zdelete_to_eol(void)
bdelete(Bbuff, 1);
else {
bool atstart = bpeek(Bbuff) == NL;
struct mark *tmark = zcreatemrk();
struct mark *tmark = bcremark(Bbuff);
if (!tmark) {
tbell();
return;
}
toendline(Bbuff);
if (atstart)
bmove1(Bbuff); /* delete the NL */
Expand Down Expand Up @@ -209,9 +213,11 @@ void Zyank(void)

void Zdelete_word(void)
{
struct mark *tmark;

tmark = zcreatemrk();
struct mark *tmark = bcremark(Bbuff);
if (!tmark) {
tbell();
return;
}
moveto(bisword, FORWARD);
movepast(bisword, FORWARD);
killtomrk(tmark);
Expand All @@ -220,9 +226,11 @@ void Zdelete_word(void)

void Zdelete_previous_word(void)
{
struct mark *tmark;

tmark = zcreatemrk();
struct mark *tmark = bcremark(Bbuff);
if (!tmark) {
tbell();
return;
}
Zprevious_word();
killtomrk(tmark);
unmark(tmark);
Expand Down

0 comments on commit a02ee20

Please sign in to comment.