Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
cs24-19fa
git_rec_nano
Commits
0d931376
Commit
0d931376
authored
8 years ago
by
David Lawrence Ramsey
Committed by
Benno Schulenberg
8 years ago
Browse files
Options
Download
Email Patches
Plain Diff
undo: fix undoing/redoing insertions, since they no longer do partitioning
parent
ef43ebfe
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/text.c
+3
-12
src/text.c
with
3 additions
and
12 deletions
+3
-12
src/text.c
View file @
0d931376
...
...
@@ -791,10 +791,7 @@ void do_undo(void)
filestruct
*
oldcutbuffer
=
cutbuffer
,
*
oldcutbottom
=
cutbottom
;
cutbuffer
=
NULL
;
cutbottom
=
NULL
;
/* Instead of a line number, u->mark_begin_lineno contains the number
* of lines of the inserted segment, because the file was partitioned
* when update_undo() was called; so, calculate the end-line number. */
openfile
->
mark_begin
=
fsfromline
(
u
->
lineno
+
u
->
mark_begin_lineno
-
1
);
openfile
->
mark_begin
=
fsfromline
(
u
->
mark_begin_lineno
);
openfile
->
mark_begin_x
=
u
->
mark_begin_x
;
openfile
->
mark_set
=
TRUE
;
goto_line_posx
(
u
->
lineno
,
u
->
begin
);
...
...
@@ -855,7 +852,7 @@ void do_redo(void)
return
;
}
f
=
fsfromline
(
u
->
type
==
INSERT
?
1
:
u
->
mark_begin_lineno
);
f
=
fsfromline
(
u
->
mark_begin_lineno
);
if
(
!
f
)
return
;
...
...
@@ -1434,14 +1431,8 @@ fprintf(stderr, " >> Updating... action = %d, openfile->last_action = %d, openf
u
->
lineno
=
openfile
->
current
->
lineno
;
break
;
case
INSERT
:
/* Store the number of lines (plus one) of the insertion. */
u
->
mark_begin_lineno
=
openfile
->
current
->
lineno
;
/* When the insertion contains no newline, store the adjusted
* x position; otherwise, store the length of the last line. */
if
(
openfile
->
fileage
==
openfile
->
filebot
)
u
->
mark_begin_x
=
openfile
->
current_x
;
else
u
->
mark_begin_x
=
strlen
(
openfile
->
filebot
->
data
);
u
->
mark_begin_x
=
openfile
->
current_x
;
break
;
case
ENTER
:
u
->
strdata
=
mallocstrcpy
(
NULL
,
openfile
->
current
->
data
);
...
...
This diff is collapsed.
Click to expand it.
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