1
1
#![ allow( dead_code, unused_variables, unused_mut) ]
2
2
3
- use helix_core:: doc_formatter:: FormattedGrapheme ;
4
3
use helix_core:: Position ;
5
4
6
5
use helix_view:: theme:: Style ;
@@ -10,14 +9,14 @@ use crate::ui::document::{LinePos, TextRenderer};
10
9
use crate :: ui:: text_decorations:: Decoration ;
11
10
12
11
pub struct EolBlame < ' a > {
13
- message : String ,
12
+ message : & ' a str ,
14
13
doc : & ' a Document ,
15
14
cursor : usize ,
16
15
style : Style ,
17
16
}
18
17
19
18
impl < ' a > EolBlame < ' a > {
20
- pub fn new ( doc : & ' a Document , theme : & Theme , cursor : usize , message : String ) -> Self {
19
+ pub fn new ( doc : & ' a Document , theme : & Theme , cursor : usize , message : & ' a str ) -> Self {
21
20
EolBlame {
22
21
style : theme. get ( "ui.virtual.blame" ) ,
23
22
message,
@@ -28,12 +27,6 @@ impl<'a> EolBlame<'a> {
28
27
}
29
28
30
29
impl Decoration for EolBlame < ' _ > {
31
- // fn decorate_line(&mut self, renderer: &mut TextRenderer, pos: LinePos) {
32
- // // renderer.draw_dec
33
- // // ration_grapheme(grapheme, style, row, col)
34
- // let col_off = 50;
35
- // }
36
-
37
30
fn render_virt_lines (
38
31
& mut self ,
39
32
renderer : & mut TextRenderer ,
@@ -45,9 +38,6 @@ impl Decoration for EolBlame<'_> {
45
38
}
46
39
let row = pos. visual_line ;
47
40
let col = virt_off. col as u16 ;
48
- // if col != self.cursor as u16 {
49
- // return Position::new(0, 0);
50
- // }
51
41
let style = self . style ;
52
42
let width = renderer. viewport . width ;
53
43
let start_col = col - renderer. offset . col as u16 ;
@@ -61,7 +51,7 @@ impl Decoration for EolBlame<'_> {
61
51
. set_string_truncated (
62
52
renderer. viewport . x + draw_col,
63
53
row,
64
- & self . message ,
54
+ self . message ,
65
55
width. saturating_sub ( draw_col) as usize ,
66
56
|_| self . style ,
67
57
true ,
@@ -75,20 +65,4 @@ impl Decoration for EolBlame<'_> {
75
65
76
66
Position :: new ( 0 , col_off as usize )
77
67
}
78
-
79
- // fn reset_pos(&mut self, _pos: usize) -> usize {
80
- // usize::MAX
81
- // }
82
-
83
- // fn skip_concealed_anchor(&mut self, conceal_end_char_idx: usize) -> usize {
84
- // self.reset_pos(conceal_end_char_idx)
85
- // }
86
-
87
- // fn decorate_grapheme(
88
- // &mut self,
89
- // _renderer: &mut TextRenderer,
90
- // _grapheme: &FormattedGrapheme,
91
- // ) -> usize {
92
- // usize::MAX
93
- // }
94
68
}
0 commit comments