@@ -330,6 +330,46 @@ impl Command for ScrollDown {
330
330
}
331
331
}
332
332
333
+ /// A command that sets the scrolling region.
334
+ ///
335
+ /// # Notes
336
+ ///
337
+ /// Commands must be executed/queued for execution otherwise they do nothing.
338
+ #[ derive( Debug , Clone , Copy , PartialEq , Eq ) ]
339
+ pub struct SetScrollingRegion ( pub u16 , pub u16 ) ;
340
+
341
+ impl Command for SetScrollingRegion {
342
+ fn write_ansi ( & self , f : & mut impl fmt:: Write ) -> fmt:: Result {
343
+ write ! ( f, csi!( "{};{}r" ) , self . 0 , self . 1 ) ?;
344
+ Ok ( ( ) )
345
+ }
346
+
347
+ #[ cfg( windows) ]
348
+ fn execute_winapi ( & self ) -> io:: Result < ( ) > {
349
+ unimplemented ! ( "not implemented for winapi" ) ;
350
+ }
351
+ }
352
+
353
+ /// A command that resets the scrolling region.
354
+ ///
355
+ /// # Notes
356
+ ///
357
+ /// Commands must be executed/queued for execution otherwise they do nothing.
358
+ #[ derive( Debug , Clone , Copy , PartialEq , Eq ) ]
359
+ pub struct ResetScrollingRegion ;
360
+
361
+ impl Command for ResetScrollingRegion {
362
+ fn write_ansi ( & self , f : & mut impl fmt:: Write ) -> fmt:: Result {
363
+ write ! ( f, csi!( "r" ) ) ?;
364
+ Ok ( ( ) )
365
+ }
366
+
367
+ #[ cfg( windows) ]
368
+ fn execute_winapi ( & self ) -> io:: Result < ( ) > {
369
+ unimplemented ! ( "not implemented for winapi" ) ;
370
+ }
371
+ }
372
+
333
373
/// A command that clears the terminal screen buffer.
334
374
///
335
375
/// See the [`ClearType`](enum.ClearType.html) enum.
0 commit comments