@@ -149,7 +149,9 @@ pub struct TextFormat {
149149 pub max_wrap : u16 ,
150150 pub max_indent_retain : u16 ,
151151 pub wrap_indicator : Box < str > ,
152+ pub wrap_indicator_width : u16 ,
152153 pub wrap_indicator_highlight : Option < Highlight > ,
154+ pub wrap_indicator_on_gutter : bool ,
153155 pub viewport_width : u16 ,
154156 pub soft_wrap_at_text_width : bool ,
155157}
@@ -163,6 +165,8 @@ impl Default for TextFormat {
163165 max_wrap : 3 ,
164166 max_indent_retain : 4 ,
165167 wrap_indicator : Box :: from ( " " ) ,
168+ wrap_indicator_width : 1 ,
169+ wrap_indicator_on_gutter : false ,
166170 viewport_width : 17 ,
167171 wrap_indicator_highlight : None ,
168172 soft_wrap_at_text_width : false ,
@@ -313,21 +317,24 @@ impl<'t> DocumentFormatter<'t> {
313317 self . visual_pos . row += 1 + virtual_lines;
314318 let mut i = 0 ;
315319 let mut word_width = 0 ;
316- let wrap_indicator = UnicodeSegmentation :: graphemes ( & * self . text_fmt . wrap_indicator , true )
317- . map ( |g| {
318- i += 1 ;
319- let grapheme = GraphemeWithSource :: new (
320- g. into ( ) ,
321- self . visual_pos . col + word_width,
322- self . text_fmt . tab_width ,
323- GraphemeSource :: VirtualText {
324- highlight : self . text_fmt . wrap_indicator_highlight ,
325- } ,
326- ) ;
327- word_width += grapheme. width ( ) ;
328- grapheme
329- } ) ;
330- self . word_buf . splice ( 0 ..0 , wrap_indicator) ;
320+
321+ if !self . text_fmt . wrap_indicator_on_gutter {
322+ let wrap_indicator =
323+ UnicodeSegmentation :: graphemes ( & * self . text_fmt . wrap_indicator , true ) . map ( |g| {
324+ i += 1 ;
325+ let grapheme = GraphemeWithSource :: new (
326+ g. into ( ) ,
327+ self . visual_pos . col + word_width,
328+ self . text_fmt . tab_width ,
329+ GraphemeSource :: VirtualText {
330+ highlight : self . text_fmt . wrap_indicator_highlight ,
331+ } ,
332+ ) ;
333+ word_width += grapheme. width ( ) ;
334+ grapheme
335+ } ) ;
336+ self . word_buf . splice ( 0 ..0 , wrap_indicator) ;
337+ }
331338
332339 for grapheme in & mut self . word_buf [ i..] {
333340 let visual_x = self . visual_pos . col + word_width;
0 commit comments