you can now toggle line numbers from displaying, fixes #28

This commit is contained in:
Felix Angell 2018-04-16 19:17:45 +01:00
parent b9ed186212
commit 8b3ec8dda9
5 changed files with 5 additions and 1 deletions

View File

@ -114,6 +114,7 @@ type EditorConfig struct {
Highlight_Line bool
Font_Face string
Font_Size int
Show_Line_Numbers bool
}
func NewDefaultConfig() *TomlConfig {

View File

@ -7,6 +7,7 @@ tabs_are_spaces = true
match_braces = false
maintain_indentation = true
highlight_line = true
show_line_numbers = true
[render]
aliased = true

View File

@ -9,6 +9,7 @@ maintain_indentation = true
highlight_line = true
font_face = "Courier New Bold"
font_size = 20
show_line_numbers = true
[render]
aliased = true

View File

@ -7,6 +7,7 @@ tabs_are_spaces = true
match_braces = false
maintain_indentation = true
highlight_line = true
show_line_numbers = true
[render]
aliased = true

View File

@ -890,7 +890,7 @@ func (b *Buffer) renderAt(ctx *strife.Renderer, rx int, ry int) {
last_w, last_h = ctx.String(string(char), ex+(rx+((x_col-1)*last_w)), (ry + (y_col * last_h)))
}
{
if b.cfg.Editor.Show_Line_Numbers {
gutterPadPx := 10
numLinesWidth := len(string(numLines)) + 1
gutterWidth := last_w*numLinesWidth + (gutterPadPx * 2)