-
-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
Fix #150
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,10 +21,12 @@ function M.lnumfunc(args, segment) | |
lnum = reverse(lnum):gsub("%d%d%d", "%1"..thou):reverse():gsub("^%"..thou, "") | ||
end | ||
|
||
lnum = tostring(lnum) | ||
local pad = (' '):rep(args.nuw - #lnum) | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
luukvbaal
Author
Owner
|
||
if args.relnum == 0 and not culright and args.rnu then | ||
return lnum.."%=" | ||
return lnum..pad.."%=" | ||
else | ||
return "%="..lnum | ||
return "%="..pad..lnum | ||
end | ||
end | ||
|
||
|
@luukvbaal I think this should be
local pad = (' '):rep(args.nuw - #lnum - 1)
to be compatible with the default behavior of nvim.If you check out
:h numberwidth
you'll see... Since one space is always between the number and the text, there is one less character for the number itself. ... Thus with the Vim default of 4 there is room for a line number up to 999. ...
Without the
-1
there is currently room for9999
with the default value of4
.