fix tilde expansion and numbering (#373)

* Fixed issue #346 and changed the format of numbers when both relativenumber and number are set.

* Fixed issue #349 (incorrect replacement of '~' with user's home direcotry).

* Changed where appropriate so that tilde replacements happens correctly.

* Added a function to replace tilde with user's home directory, only when it should.

* Renamed ReplaceTilde to replaceTilde so that it won't get exported and removed some ';' at the end of some lines.
This commit is contained in:
gotroyb127 authored and GitHub committed 2020-06-07 20:53:25 +03:00
1 parent c49140ab36
commit 41e0bb32cd
5 files changed
+25 -10

No files matched your search

+2 -2
View File
@@ -855,7 +855,7 @@ func (nav *nav) sync() error {
}
func (nav *nav) cd(wd string) error {
wd = strings.Replace(wd, "~", gUser.HomeDir, -1)
wd = replaceTilde(wd)
wd = filepath.Clean(wd)
if !filepath.IsAbs(wd) {
@@ -872,7 +872,7 @@ func (nav *nav) cd(wd string) error {
}
func (nav *nav) sel(path string) error {
path = strings.Replace(path, "~", gUser.HomeDir, -1)
path = replaceTilde(path)
path = filepath.Clean(path)
lstat, err := os.Stat(path)