mirror of
https://github.com/rfivet/uemacs.git
synced 2024-12-18 07:16:23 -05:00
Compare commits
2 Commits
f96ace997f
...
60a56b74b0
Author | SHA1 | Date | |
---|---|---|---|
60a56b74b0 | |||
64eb0d5deb |
@ -2,7 +2,8 @@
|
|||||||
|
|
||||||
#7 set $seed
|
#7 set $seed
|
||||||
#execute-file maze.cmd
|
#execute-file maze.cmd
|
||||||
execute-file floodmaz.cmd
|
#execute-file floodmaz.cmd
|
||||||
|
execute-file sharpmaz.cmd
|
||||||
set %x 2
|
set %x 2
|
||||||
set %y $curline
|
set %y $curline
|
||||||
end-of-line
|
end-of-line
|
||||||
|
16
display.c
16
display.c
@ -136,9 +136,13 @@ static void vtalloc( int maxrow, int maxcol) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void updmargin( void) {
|
void updmargin( void) {
|
||||||
|
#define MINMARGIN 3 /* MINMARGIN - 1 enough for $ + prev before current */
|
||||||
|
#if MINCOLS < 2 * MINMARGIN + 1
|
||||||
|
# error "MINCOLS and MINMARGIN are not consistent"
|
||||||
|
#endif
|
||||||
term.t_margin = term.t_ncol / 10 ;
|
term.t_margin = term.t_ncol / 10 ;
|
||||||
if( term.t_margin < 3) /* t_margin - 1 enough for $ + prev before current */
|
if( term.t_margin < MINMARGIN)
|
||||||
term.t_margin = 3 ;
|
term.t_margin = MINMARGIN ;
|
||||||
|
|
||||||
term.t_scrsiz = term.t_ncol - 2 * term.t_margin ;
|
term.t_scrsiz = term.t_ncol - 2 * term.t_margin ;
|
||||||
}
|
}
|
||||||
@ -1327,11 +1331,11 @@ static void sizesignal( int signr) {
|
|||||||
static void newscreensize( int h, int w) {
|
static void newscreensize( int h, int w) {
|
||||||
chg_width = chg_height = 0 ;
|
chg_width = chg_height = 0 ;
|
||||||
vtfree() ;
|
vtfree() ;
|
||||||
if( h < 3)
|
if( h < MINROWS)
|
||||||
h = 3 ;
|
h = MINROWS ;
|
||||||
|
|
||||||
if( w < 10)
|
if( w < MINCOLS)
|
||||||
w = 10 ;
|
w = MINCOLS ;
|
||||||
|
|
||||||
vtalloc( h, w) ;
|
vtalloc( h, w) ;
|
||||||
if( h <= term.t_mrow)
|
if( h <= term.t_mrow)
|
||||||
|
@ -8,6 +8,9 @@
|
|||||||
#include "names.h" /* BINDABLE() */
|
#include "names.h" /* BINDABLE() */
|
||||||
#include "utf8.h" /* unicode_t */
|
#include "utf8.h" /* unicode_t */
|
||||||
|
|
||||||
|
#define MINROWS 3
|
||||||
|
#define MINCOLS 10
|
||||||
|
|
||||||
extern int mpresf ; /* Stuff in message line */
|
extern int mpresf ; /* Stuff in message line */
|
||||||
extern int scrollcount ; /* number of lines to scroll */
|
extern int scrollcount ; /* number of lines to scroll */
|
||||||
extern int discmd ; /* display command flag */
|
extern int discmd ; /* display command flag */
|
||||||
|
51
sharpmaz.cmd
Normal file
51
sharpmaz.cmd
Normal file
@ -0,0 +1,51 @@
|
|||||||
|
execute-file maze.cmd
|
||||||
|
|
||||||
|
end-of-line
|
||||||
|
set %ec &sub $curcol 1
|
||||||
|
end-of-file
|
||||||
|
set %el &sub $curline 1
|
||||||
|
set $curline %el
|
||||||
|
set %spaces $line
|
||||||
|
set $curline 1
|
||||||
|
set %old $line
|
||||||
|
set $line %spaces
|
||||||
|
set %l 2
|
||||||
|
!while &less %l %el
|
||||||
|
set $curline %l
|
||||||
|
set %c 1
|
||||||
|
!while &less %c %ec
|
||||||
|
set $curcol %c
|
||||||
|
!if ¬ &equ $curchar 32
|
||||||
|
set %v 0
|
||||||
|
set $curline &sub %l 1
|
||||||
|
set $curcol %c
|
||||||
|
!if ¬ &equ $curchar 32
|
||||||
|
set %v &add %v 1
|
||||||
|
!endif
|
||||||
|
set $curline %l
|
||||||
|
set $curcol &sub %c 1
|
||||||
|
!if ¬ &equ $curchar 32
|
||||||
|
set %v &add %v 2
|
||||||
|
!endif
|
||||||
|
set $curcol &add %c 1
|
||||||
|
!if ¬ &equ $curchar 32
|
||||||
|
set %v &add %v 4
|
||||||
|
!endif
|
||||||
|
set $curline &add %l 1
|
||||||
|
set $curcol %c
|
||||||
|
!if ¬ &equ $curchar 32
|
||||||
|
set %v &add %v 8
|
||||||
|
!endif
|
||||||
|
|
||||||
|
set $curline %l
|
||||||
|
set $curcol %c
|
||||||
|
set $curchar &asc &mid "╳╵╴┘╶└─┴╷│┐┤┌├┬┼" &add %v 1 1
|
||||||
|
!endif
|
||||||
|
set %c &add %c 1
|
||||||
|
!endwhile
|
||||||
|
set %l &add %l 1
|
||||||
|
!endwhile
|
||||||
|
set $curline 1
|
||||||
|
set $line %old
|
||||||
|
set $curline 3
|
||||||
|
set $curcol 1
|
27
window.c
27
window.c
@ -561,6 +561,11 @@ BINDABLE( restwnd) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
static void adjust( window_p wp, int screenrows) {
|
||||||
|
wp->w_ntrows = screenrows - wp->w_toprow - 2 ;
|
||||||
|
wp->w_flag |= WFHARD | WFMODE ;
|
||||||
|
}
|
||||||
|
|
||||||
/* resize the screen, re-writing the screen
|
/* resize the screen, re-writing the screen
|
||||||
*
|
*
|
||||||
* int f; default flag
|
* int f; default flag
|
||||||
@ -574,7 +579,7 @@ BBINDABLE( newsize) {
|
|||||||
n = term.t_mrow ;
|
n = term.t_mrow ;
|
||||||
|
|
||||||
/* make sure it's in range */
|
/* make sure it's in range */
|
||||||
if( n < 3 || n > term.t_mrow)
|
if( n < MINROWS || n > term.t_mrow)
|
||||||
return mloutfail( "%%Screen size out of range") ;
|
return mloutfail( "%%Screen size out of range") ;
|
||||||
|
|
||||||
if( term.t_nrow == n - 1)
|
if( term.t_nrow == n - 1)
|
||||||
@ -587,8 +592,7 @@ BBINDABLE( newsize) {
|
|||||||
;
|
;
|
||||||
|
|
||||||
/* and enlarge it as needed */
|
/* and enlarge it as needed */
|
||||||
wp->w_ntrows = n - wp->w_toprow - 2 ;
|
adjust( wp, n) ;
|
||||||
wp->w_flag |= WFHARD | WFMODE ;
|
|
||||||
} else {
|
} else {
|
||||||
/* new size is smaller */
|
/* new size is smaller */
|
||||||
/* rebuild the window structure */
|
/* rebuild the window structure */
|
||||||
@ -598,10 +602,9 @@ BBINDABLE( newsize) {
|
|||||||
wp = nextwp ;
|
wp = nextwp ;
|
||||||
nextwp = wp->w_wndp ;
|
nextwp = wp->w_wndp ;
|
||||||
|
|
||||||
if( wp->w_toprow == n - 2) {
|
/* expand previous window if current would have zero lines */
|
||||||
lastwp->w_ntrows = n - lastwp->w_toprow - 2 ;
|
if( wp->w_toprow == n - 2)
|
||||||
lastwp->w_flag |= WFHARD | WFMODE ;
|
adjust( lastwp, n) ;
|
||||||
}
|
|
||||||
|
|
||||||
/* get rid of it if it is too low */
|
/* get rid of it if it is too low */
|
||||||
if( wp->w_toprow >= n - 2) {
|
if( wp->w_toprow >= n - 2) {
|
||||||
@ -624,12 +627,8 @@ BBINDABLE( newsize) {
|
|||||||
lastwp->w_wndp = NULL ;
|
lastwp->w_wndp = NULL ;
|
||||||
} else {
|
} else {
|
||||||
/* need to change this window size? */
|
/* need to change this window size? */
|
||||||
int lastline = wp->w_toprow + wp->w_ntrows - 1 ;
|
if( (wp->w_toprow + wp->w_ntrows - 1) >= n - 2)
|
||||||
if( lastline >= n - 2) {
|
adjust( wp, n) ;
|
||||||
wp->w_ntrows = n - wp->w_toprow - 2 ;
|
|
||||||
assert( wp->w_ntrows) ;
|
|
||||||
wp->w_flag |= WFHARD | WFMODE ;
|
|
||||||
}
|
|
||||||
|
|
||||||
lastwp = wp ;
|
lastwp = wp ;
|
||||||
}
|
}
|
||||||
@ -654,7 +653,7 @@ BBINDABLE( newwidth) {
|
|||||||
n = term.t_mcol ;
|
n = term.t_mcol ;
|
||||||
|
|
||||||
/* make sure it's in range */
|
/* make sure it's in range */
|
||||||
if( n < 10 || n > term.t_mcol)
|
if( n < MINCOLS || n > term.t_mcol)
|
||||||
return mloutfail( "%%Screen width out of range") ;
|
return mloutfail( "%%Screen width out of range") ;
|
||||||
|
|
||||||
/* otherwise, just re-width it (no big deal) */
|
/* otherwise, just re-width it (no big deal) */
|
||||||
|
Loading…
Reference in New Issue
Block a user