1 /* vi:set syntax= ts=8 sts=8 sw=8 noexpandtab: */
2 /* WARNING: this file is ROSS STYLE */
6 #include "musicchip_file.h"
15 int tcliplen
, icliplen
= 0;
19 if(c
>= '0' && c
<= '9') return c
- '0';
20 if(c
>= 'a' && c
<= 'f') return c
- 'a' + 10;
27 for(int i
= 1; i
<= 0xff; i
++){
28 for(int j
= 0; j
< tracklen
; j
++){
29 if(track
[i
].line
[j
].note
) skiptherest
= 1;
30 for(int k
= 0; k
< 2; k
++){
31 if(track
[i
].line
[j
].cmd
[k
]) skiptherest
= 1;
32 if(track
[i
].line
[j
].param
[k
]) skiptherest
= 1;
35 // skip the rest of this track?
41 // this track is free, so return the index
42 if(j
== tracklen
-1) return i
;
46 setdisplay("nextfreetrack() failed somehow..");
51 for(int i
= 1; i
<= 0xff; i
++){
52 if(instrument
[i
].line
[0].cmd
== '0')
56 setdisplay("nextfreeinstr() failed somehow..");
67 && instrument
[currinstr
].line
[instry
].cmd
!= '+'
68 && instrument
[currinstr
].line
[instry
].cmd
!= '='){
70 case 1: SETHI(instrument
[currinstr
].line
[instry
].param
, x
); break;
71 case 2: SETLO(instrument
[currinstr
].line
[instry
].param
, x
); break;
74 if(currtab
== 1 && trackx
> 1){
76 case 2: SETHI(track
[currtrack
].line
[tracky
].instr
, x
); break;
77 case 3: SETLO(track
[currtrack
].line
[tracky
].instr
, x
); break;
78 case 5: if(track
[currtrack
].line
[tracky
].cmd
[0])
79 SETHI(track
[currtrack
].line
[tracky
].param
[0], x
); break;
80 case 6: if(track
[currtrack
].line
[tracky
].cmd
[0])
81 SETLO(track
[currtrack
].line
[tracky
].param
[0], x
); break;
82 case 8: if(track
[currtrack
].line
[tracky
].cmd
[1])
83 SETHI(track
[currtrack
].line
[tracky
].param
[1], x
); break;
84 case 9: if(track
[currtrack
].line
[tracky
].cmd
[1])
85 SETLO(track
[currtrack
].line
[tracky
].param
[1], x
); break;
90 case 0: SETHI(song
[songy
].track
[songx
/ 4], x
); break;
91 case 1: SETLO(song
[songy
].track
[songx
/ 4], x
); break;
92 case 2: SETHI(song
[songy
].transp
[songx
/ 4], x
); break;
93 case 3: SETLO(song
[songy
].transp
[songx
/ 4], x
); break;
101 && (instrument
[currinstr
].line
[instry
].cmd
== '+' || instrument
[currinstr
].line
[instry
].cmd
== '=')){
102 instrument
[currinstr
].line
[instry
].param
= x
;
104 if(currtab
== 1 && !trackx
){
105 track
[currtrack
].line
[tracky
].note
= x
;
107 track
[currtrack
].line
[tracky
].instr
= currinstr
;
109 track
[currtrack
].line
[tracky
].instr
= 0;
111 if(x
) iedplonk(x
, currinstr
);
114 if(currtab
== 2 && instrx
== 0){
115 if(strchr(validcmds
, c
))
116 instrument
[currinstr
].line
[instry
].cmd
= c
;
118 if(currtab
== 1 && (trackx
== 4 || trackx
== 7)){
119 if(strchr(validcmds
, c
)){
120 if(c
== '.' || c
== '0') c
= 0;
121 track
[currtrack
].line
[tracky
].cmd
[(trackx
- 3) / 3] = c
;
128 // isnumber() determines if a string is a number
129 // returns 1 if the given arg is a number, 0 otherwise.
130 // for use with isdigit(), isxdigit(), etc...
131 int isnumber(const char* str
, int (*func
) (int)){
137 }else if( str
[i
]=='\0' ){
145 // Converts a hexadecimal string to integer
147 // 0: conversion successful
148 // 1: string is empty
149 // 2: string has more than 8 bytes
150 // 4: Conversion is in process but abnormally terminated by
151 // illegal hexadecimal character
152 // from http://devpinoy.org/blogs/cvega/archive/2006/06/19/xtoi-hex-to-integer-c-function.aspx
153 int xtoi(const char* xs
, unsigned int* result
){
154 size_t szlen
= strlen(xs
);
158 // Converting more than 32bit hexadecimal value?
159 if (szlen
>8) return 2; // exit
161 // Begin conversion here
165 // Run until no more character to convert
166 for(i
=szlen
-1; i
>=0 ;i
--){
167 if(isxdigit(*(xs
+i
))){
169 xv
= ( *(xs
+i
) - 97) + 10;
170 }else if( *(xs
+i
) >= 65){
171 xv
= (*(xs
+i
) - 65) + 10;
175 *result
+= (xv
* fact
);
178 // Conversion was abnormally terminated
179 // by non hexadecimal digit, hence
180 // returning only the converted with
181 // an error value 4 (illegal hex character)
186 // Nothing to convert
190 void _parsecmd(char cmd
[]){
193 if(strcmp(cmd
, ":w") == 0){
196 }else if(strcmp(cmd
, ":q") == 0){
198 setdisplay("no write since last change! use :q! to override");
205 }else if(strcmp(cmd
, ":q!") == 0){
210 }else if(strcmp(cmd
, ":write") == 0){
213 }else if(strcmp(cmd
, ":wq") == 0){
220 }else if(strcmp(cmd
, ":quit") == 0){
225 }else if(cmd
[1]=='e' && cmd
[2]==' '){
226 // if the file doesn't exist, clear the song
232 //yucky if statement below.....probably better way to do it
233 // maybe this is better??
234 }else if(!strncmp(cmd
+1,"save ",5)){
235 saveinstrument(cmd
+6);
236 setdisplay("d-_-b saved ins! d-_-b");
237 }else if(!strncmp(cmd
+1,"load ",5)){
238 loadinstrument(cmd
+6);
239 setdisplay("d-_-b loaded ins! d-_-b");
240 }else if( isnumber((char *)cmd
+1,isxdigit
) ){
241 unsigned int goton
= 1;
246 songy
= (goton
>songlen
)? songlen
-1 : goton
;
249 currtrack
= (goton
>0xff)? 0xff : goton
;
252 currinstr
= (goton
>0xff)? 0xff : goton
;
255 }else if(cmd
[1] == 'c' && cmd
[2] == ' '){
256 strncpy(comment
, cmd
+3, sizeof(comment
));
258 setdisplay("not a tracker command!");
263 void normalmode(int c
){
266 // don't save the action for repeat if it's a movement or a repeat, or
267 // something else that doesnt make sense to repeat
283 lastrepeatnum
= cmdrepeatnum
;
286 for(i
=0; i
<cmdrepeatnum
; i
++){
291 struct instrument
*in
= &instrument
[currinstr
];
293 if(in
->length
< 256){
294 memmove(&in
->line
[instry
+ 2], &in
->line
[instry
+ 1], sizeof(struct instrline
) * (in
->length
- instry
- 1));
297 in
->line
[instry
].cmd
= '0';
298 in
->line
[instry
].param
= 0;
300 }else if(currtab
== 0){
302 memmove(&song
[songy
+ 2], &song
[songy
+ 1], sizeof(struct songline
) * (songlen
- songy
- 1));
305 memset(&song
[songy
], 0, sizeof(struct songline
));
310 // if the last command was a replace, just insert the last thing
311 // inserted instead of calling insertmode()
312 if(lastaction
== 'r')
313 _insertc(lastinsert
);
315 normalmode(lastaction
);
316 cmdrepeatnum
= lastrepeatnum
;
326 if(songy
==getmaxy(stdscr
)-3+songoffs
)
333 if(tracky
==getmaxy(stdscr
)-3+trackoffs
)
340 if(instry
==getmaxy(stdscr
)-3+instroffs
)
350 if(songy
<=songlen
-2){
357 if(tracky
<=tracklen
-2){
358 if(tracky
==trackoffs
)
364 if(instry
<=instrument
[currinstr
].length
-2){
365 if(instry
==instroffs
)
386 // the second cases (to the right of the colon) for M and L
387 // took some serious guesswork, so I'm not sure if they're
388 // correct but they seem to work.
392 songy
= (songlen
<= getmaxy(stdscr
)-2)?
394 : ((getmaxy(stdscr
)-6)/2) + songoffs
;
397 tracky
= (tracklen
<= getmaxy(stdscr
)-2)?
399 : ((getmaxy(stdscr
)-6)/2) + trackoffs
;
402 instry
= (instrument
[currinstr
].length
<= getmaxy(stdscr
)-2)?
403 instrument
[currinstr
].length
/2
404 : ((getmaxy(stdscr
)-6)/2) + instroffs
;
411 songy
= (songlen
<= getmaxy(stdscr
)-2)?
413 : getmaxy(stdscr
)-3+songoffs
;
416 tracky
= (tracklen
<= getmaxy(stdscr
)-2)?
418 : getmaxy(stdscr
)-3+trackoffs
;
421 instry
= (instrument
[currinstr
].length
<= getmaxy(stdscr
)-2)?
422 instrument
[currinstr
].length
-1
423 : getmaxy(stdscr
)-3+instroffs
;
428 if(nextchar() == 'g'){
444 memcpy(&tclip
, &song
[songy
], sizeof(struct songline
));
445 }else if(currtab
== 1){
447 memcpy(&tclip
, &track
[currtrack
].line
[tracky
], sizeof(struct trackline
));
448 }else if(currtab
== 2){
450 memcpy(&iclip
, &instrument
[currinstr
].line
[instry
], sizeof(struct instrline
));
457 memcpy(&tclip
[0], &song
[songy
], sizeof(struct songline
));
459 memcpy(&tclip
[1], &song
[songy
], sizeof(struct songline
));
460 }else if(currtab
== 1){
462 memcpy(&tclip
[0], &track
[currtrack
].line
[tracky
], sizeof(struct trackline
));
464 memcpy(&tclip
[1], &track
[currtrack
].line
[tracky
], sizeof(struct trackline
));
465 }else if(currtab
== 2){
467 memcpy(&iclip
[0], &instrument
[currinstr
].line
[instry
], sizeof(struct instrline
));
469 memcpy(&iclip
[1], &instrument
[currinstr
].line
[instry
], sizeof(struct instrline
));
476 memcpy(&tclip
[1], &song
[songy
], sizeof(struct songline
));
478 memcpy(&tclip
[0], &song
[songy
], sizeof(struct songline
));
479 }else if(currtab
== 1){
481 memcpy(&tclip
[1], &track
[currtrack
].line
[tracky
], sizeof(struct trackline
));
483 memcpy(&tclip
[0], &track
[currtrack
].line
[tracky
], sizeof(struct trackline
));
484 }else if(currtab
== 2){
486 memcpy(&iclip
[1], &instrument
[currinstr
].line
[instry
], sizeof(struct instrline
));
488 memcpy(&iclip
[0], &instrument
[currinstr
].line
[instry
], sizeof(struct instrline
));
498 for(int i
= 0; i
< tcliplen
; i
++){
500 memmove(&song
[songy
+ 2], &song
[songy
+ 1], sizeof(struct songline
) * (songlen
- songy
- 1));
503 memset(&song
[songy
], 0, sizeof(struct songline
));
506 memcpy(&song
[songy
], &tclip
[i
], sizeof(struct songline
));
509 }else if(currtab
== 1){
510 for(int i
= 0; i
< tcliplen
; i
++){
511 memcpy(&track
[currtrack
].line
[tracky
], &tclip
[i
], sizeof(struct trackline
));
512 if(tracky
< tracklen
-step
) tracky
+= step
;
513 else tracky
= tracklen
-1;
515 }else if(currtab
== 2){
516 if(instrument
[currinstr
].length
< 256){
518 for(int i
= 0; i
< icliplen
; i
++){
519 struct instrument
*in
= &instrument
[currinstr
];
522 memmove(&in
->line
[instry
+ 1], &in
->line
[instry
+ 0], sizeof(struct instrline
) * (in
->length
- instry
));
524 in
->line
[instry
].cmd
= '0';
525 in
->line
[instry
].param
= 0;
528 memcpy(&instrument
[currinstr
].line
[instry
], &iclip
[i
], sizeof(struct instrline
));
531 //if(instry < instrument[currinstr].length-1) instry++;
535 // copy everything in the current phrase or instrument into the next free one
539 memcpy(&track
[f
], &track
[currtrack
], sizeof(struct track
));
541 }else if(currtab
== 2){
543 memcpy(&instrument
[f
], &instrument
[currinstr
], sizeof(struct instrument
));
548 // TODO: Y and P can be removed after we make visual mode
549 // copy whole phrase or instrument
552 memcpy(&tclip
, &track
[currtrack
], sizeof(struct track
));
553 }else if(currtab
== 2){
554 memcpy(&iclip
, &instrument
[currinstr
], sizeof(struct instrument
));
557 // paste whole phrase or instrument
560 memcpy(&track
[currtrack
], &tclip
, sizeof(struct track
));
561 }else if(currtab
== 2){
562 memcpy(&instrument
[currinstr
], &iclip
, sizeof(struct instrument
));
567 // TODO: clean this SHIT up
568 // TODO: add an ACT_ function for delete
574 struct instrument
*in
= &instrument
[currinstr
];
577 memmove(&in
->line
[instry
+ 0], &in
->line
[instry
+ 1], sizeof(struct instrline
) * (in
->length
- instry
- 1));
579 if(instry
>= in
->length
) instry
= in
->length
- 1;
581 }else if(currtab
== 0){
583 memmove(&song
[songy
+ 0], &song
[songy
+ 1], sizeof(struct songline
) * (songlen
- songy
- 1));
585 if(songy
>= songlen
) songy
= songlen
- 1;
591 struct instrument
*in
= &instrument
[currinstr
];
596 memmove(&in
->line
[instry
+ 0], &in
->line
[instry
+ 1], sizeof(struct instrline
) * (in
->length
- instry
- 1));
598 if(instry
>= in
->length
) instry
= in
->length
- 1;
601 }else if(currtab
== 0){
606 memmove(&song
[songy
+ 0], &song
[songy
+ 1], sizeof(struct songline
) * (songlen
- songy
- 1));
608 if(songy
>= songlen
) songy
= songlen
- 1;
615 struct instrument
*in
= &instrument
[currinstr
];
620 memmove(&in
->line
[instry
+ 0], &in
->line
[instry
+ 1], sizeof(struct instrline
) * (in
->length
- instry
- 1));
622 if(instry
>= in
->length
) instry
= in
->length
- 1;
625 }else if(currtab
== 0){
629 memmove(&song
[songy
+ 0], &song
[songy
+ 1], sizeof(struct songline
) * (songlen
- songy
- 1));
631 if(songy
>= songlen
) songy
= songlen
- 1;
652 startplaytrack(currtrack
);
653 }else if(currtab
== 0){
655 startplaysong(songy
);
677 /* Enter command mode */
684 // TODO: make an act_ function for '`'
687 int t
= song
[songy
].track
[songx
/ 4];
691 startplaytrack(currtrack
);
693 }else if((currtab
== 1) && ((trackx
== 2) || (trackx
== 3))){
694 int i
= track
[currtrack
].line
[tracky
].instr
;
697 } else if(currtab
== 1){
699 }else if(currtab
== 2){
703 /* Enter insert mode */
707 /* Enter visual mode */
711 /* Enter visual line mode */
715 /* enter jammer mode */
719 /* Add new line and enter insert mode */
722 struct instrument
*in
= &instrument
[currinstr
];
724 if(in
->length
< 256){
725 memmove(&in
->line
[instry
+ 2], &in
->line
[instry
+ 1], sizeof(struct instrline
) * (in
->length
- instry
- 1));
728 in
->line
[instry
].cmd
= '0';
729 in
->line
[instry
].param
= 0;
731 }else if(currtab
== 0){
733 memmove(&song
[songy
+ 2], &song
[songy
+ 1], sizeof(struct songline
) * (songlen
- songy
- 1));
736 memset(&song
[songy
], 0, sizeof(struct songline
));
761 if(octave
< 8) octave
++;
764 if(currtrack
> 1) currtrack
--;
767 if(currtrack
< 255) currtrack
++;
776 }else if(currtab
== 1){
808 }else if(currtab
== 2){
814 if(instrument
[currinstr
].line
[instry
].cmd
== '+' || instrument
[currinstr
].line
[instry
].cmd
== '='){
821 if(instrument
[currinstr
].line
[instry
].cmd
== '+' || instrument
[currinstr
].line
[instry
].cmd
== '='){
837 }else if(currtab
== 1){
869 }else if(currtab
== 2){
875 if(instrument
[currinstr
].line
[instry
].cmd
== '+' || instrument
[currinstr
].line
[instry
].cmd
== '='){
882 if(instrument
[currinstr
].line
[instry
].cmd
== '+' || instrument
[currinstr
].line
[instry
].cmd
== '='){
894 }else if(currtab
== 1){
901 }else if(currtab
== 1){
950 _insertc(nextchar());
961 /* vi cmdline mode */
962 void cmdlinemode(void){
964 keypad(stdscr
, TRUE
);
966 currmode
= PM_CMDLINE
;
967 strncat(cmdstr
, ":", 100);
975 currmode
= PM_NORMAL
;
983 cmdstr
[strlen(cmdstr
)-1] = '\0';
989 strncat(cmdstr
, &c
, 50);
995 keypad(stdscr
, FALSE
);
1000 void insertmode(void){
1002 currmode
= PM_INSERT
;
1005 if((c
= getch()) != ERR
) switch(c
){
1007 currmode
= PM_NORMAL
;
1027 if(octave
) octave
--;
1030 if(octave
< 8) octave
++;
1032 /* change instrument */
1036 }else if(currtab
== 1){
1043 }else if(currtab
== 1){
1082 currmode
= PM_NORMAL
;
1089 startplaytrack(currtrack
);
1090 }else if(currtab
== 0){
1092 startplaysong(songy
);
1098 int t
= song
[songy
].track
[songx
/ 4];
1099 if(t
) currtrack
= t
;
1101 }else if(currtab
== 1){
1110 }else if(currtab
== 2){
1111 //if(instry < instrument[currinstr].length-1) instry++;
1112 if(instrx
< 2) instrx
++;
1114 instry
%= instrument
[currinstr
].length
;
1124 void jammermode(void){
1126 currmode
= PM_JAMMER
;
1127 while(currmode
== PM_JAMMER
){
1128 if((c
= getch()) != ERR
) switch(c
){
1130 currmode
= PM_NORMAL
;
1139 if(octave
) octave
--;
1142 if(octave
< 8) octave
++;
1148 iedplonk(x
, currinstr
);
1159 void visualmode(void){
1162 currmode
= PM_VISUAL
;
1163 //attrset(A_REVERSE);
1165 }else if(currtab
== 1){
1166 highlight_firstx
= trackx
;
1167 highlight_lastx
= trackx
;
1168 highlight_firsty
= tracky
;
1169 highlight_lasty
= tracky
;
1170 }else if(currtab
== 2){
1172 highlight_firstx
= -1;
1173 highlight_lastx
= -1;
1174 highlight_firsty
= -1;
1175 highlight_lasty
= -1;
1178 while(currmode
== PM_VISUAL
){
1179 if((c
= getch()) != ERR
) switch(c
){
1182 currmode
= PM_NORMAL
;
1190 }else if(currtab
==1){
1191 highlight_lastx
= trackx
;
1192 }else if(currtab
==2){
1198 }else if(currtab
==1){
1199 highlight_lasty
= tracky
;
1200 }else if(currtab
==2){
1206 }else if(currtab
==1){
1207 highlight_lasty
= tracky
;
1208 }else if(currtab
==2){
1214 }else if(currtab
==1){
1215 highlight_lastx
= trackx
;
1216 }else if(currtab
==2){
1226 /* visual line mode */
1227 void visuallinemode(void){
1232 currmode
= PM_VISUALLINE
;
1234 /* Store the current line as the first and last node of a linked list */
1236 highlight_firstline
= songy
;
1237 highlight_lastline
= songy
;
1238 }else if(currtab
==1){
1239 highlight_firstline
= tracky
;
1240 highlight_lastline
= tracky
;
1241 }else if(currtab
==2){
1242 highlight_firstline
= instry
;
1243 highlight_lastline
= instry
;
1245 highlight_firstline
= -1;
1246 highlight_lastline
= -1;
1249 // initialize difference
1250 highlight_lineamount
= 1;
1252 // make it visible to gui.c
1253 //highlightlines = firstnode;
1255 while(currmode
== PM_VISUALLINE
){
1256 if((c
= getch()) != ERR
) switch(c
){
1259 currmode
= PM_NORMAL
;
1270 highlight_lastline
= songy
;
1271 }else if(currtab
==1){
1272 highlight_lastline
= tracky
;
1273 }else if(currtab
==2){
1274 highlight_lastline
= instry
;
1276 // update the highlighted length
1277 highlight_lineamount
= (highlight_firstline
>highlight_lastline
)?
1278 highlight_firstline
- highlight_lastline
+1
1279 : highlight_lastline
- highlight_firstline
+1;
1285 highlight_lastline
= songy
;
1286 }else if(currtab
==1){
1287 highlight_lastline
= tracky
;
1288 }else if(currtab
==2){
1289 highlight_lastline
= instry
;
1291 // update the highlighted length
1292 highlight_lineamount
= (highlight_firstline
>highlight_lastline
)?
1293 highlight_firstline
- highlight_lastline
+1
1294 : highlight_lastline
- highlight_firstline
+1;
1300 if(nextchar() == 'g'){
1307 // d: copy every line that is highlighted to the paste buffer and clear them, too
1309 min
= (highlight_firstline
< highlight_lastline
)?
1311 : highlight_lastline
;
1312 max
= (highlight_firstline
< highlight_lastline
)?
1314 : highlight_firstline
;
1316 for(int i
=min
; i
<=max
; i
++)
1317 act_clrinsongtab(i
);
1318 }else if(currtab
== 1){
1319 for(int i
=min
; i
<=max
; i
++)
1320 act_clrintracktab(currtrack
, i
);
1321 }else if(currtab
== 2){
1322 for(int i
=min
; i
<=max
; i
++)
1323 act_clrininstrtab(currinstr
, i
);
1325 //snprintf(buf, sizeof(buf), "%d fewer lines", highlight_lineamount);
1326 //infinitemsg = buf;
1327 currmode
= PM_NORMAL
;
1329 // y: copy every line that is highlighted to the paste buffer
1333 //memcpy(&tclip, &song[songy], sizeof(struct songline)*highlight_lineamount);
1334 tcliplen
= highlight_lineamount
;
1335 //moved up, then yanked
1336 if(highlight_firstline
> highlight_lastline
){
1337 for(int i
= 0; i
< highlight_lineamount
; i
++)
1338 memcpy(&tclip
[i
], &song
[songy
+i
], sizeof(struct songline
));
1339 //moved down, then yanked
1340 }else if(highlight_lastline
> highlight_firstline
){
1341 for(int i
= highlight_lineamount
-1, j
= 0; i
>= 0; i
--, j
++){
1342 memcpy(&tclip
[i
], &song
[songy
-j
], sizeof(struct songline
));
1345 }else if(currtab
== 1){
1346 tcliplen
= highlight_lineamount
;
1347 //moved up, then yanked
1348 if(highlight_firstline
> highlight_lastline
){
1349 for(int i
= 0; i
< highlight_lineamount
; i
++)
1350 memcpy(&tclip
[i
], &track
[currtrack
].line
[tracky
+i
], sizeof(struct trackline
));
1351 //moved down, then yanked
1352 }else if(highlight_lastline
> highlight_firstline
){
1353 for(int i
= highlight_lineamount
-1, j
= 0; i
>= 0; i
--, j
++){
1354 memcpy(&tclip
[i
], &track
[currtrack
].line
[tracky
-j
], sizeof(struct trackline
));
1357 }else if(currtab
== 2){
1359 //memcpy(&iclip, &instrument[currinstr].line[instry], sizeof(struct instrline)*highlight_lineamount);
1360 icliplen
= highlight_lineamount
;
1361 //moved up, then yanked
1362 if(highlight_firstline
> highlight_lastline
){
1363 for(int i
= 0; i
< highlight_lineamount
; i
++)
1364 memcpy(&iclip
[i
], &instrument
[currinstr
].line
[instry
+i
], sizeof(struct instrline
));
1365 //moved down, then yanked
1366 }else if(highlight_lastline
> highlight_firstline
){
1367 for(int i
= highlight_lineamount
-1, j
= 0; i
>= 0; i
--, j
++){
1368 memcpy(&iclip
[i
], &instrument
[currinstr
].line
[instry
-j
], sizeof(struct instrline
));
1373 snprintf(buf
, sizeof(buf
), "%d lines yanked", highlight_lineamount
);
1375 currmode
= PM_NORMAL
;
1380 // update the highlighted length
1381 /*highlight_lineamount = (highlight_firstline>highlight_lastline)?
1382 highlight_firstline - highlight_lastline +1
1383 : highlight_lastline - highlight_firstline +1;
1386 highlight_firstline
= -1;
1387 highlight_lastline
= -1;