]> git.lizzy.rs Git - micro.git/commitdiff
Close file
authorZachary Yedidia <zyedidia@gmail.com>
Thu, 19 Dec 2019 15:12:12 +0000 (10:12 -0500)
committerZachary Yedidia <zyedidia@gmail.com>
Wed, 25 Dec 2019 22:05:11 +0000 (17:05 -0500)
internal/action/bufpane.go
internal/util/util.go
pkg/terminfo/terminfo.go

index cf5ac23eb95e4b91a7c80b5f3f0d0c9eaca4be1d..7b8e9d00d75f999c9cc5bd5ffb88e729de121622 100644 (file)
@@ -215,7 +215,6 @@ func (h *BufPane) Name() string {
 }
 
 // HandleEvent executes the tcell event properly
-// TODO: multiple actions bound to one key
 func (h *BufPane) HandleEvent(event tcell.Event) {
        switch e := event.(type) {
        case *tcell.EventRaw:
index d10c9851f9bfedb3cf602b61134db1998d52970f..92af3bce969b5228af2e7a60369bfcb03637dcec 100644 (file)
@@ -353,7 +353,6 @@ func IntOpt(opt interface{}) int {
 // coordinate (this is necessary because tabs are 1 char but
 // 4 visual spaces)
 func GetCharPosInLine(b []byte, visualPos int, tabsize int) int {
-
        // Scan rune by rune until we exceed the visual width that we are
        // looking for. Then we can return the character position we have found
        i := 0     // char pos
index b7fc0fa97e6481652e463384985f3ec9682856ca..4bf3beed4b75afae6d4cf25997fa7b07b071c12d 100644 (file)
@@ -717,10 +717,11 @@ func AddTerminfo(t *Terminfo) {
 
 func loadFromFile(fname string, term string) (*Terminfo, error) {
        var e error
-       var f io.Reader
+       var f io.ReadCloser
        if f, e = os.Open(fname); e != nil {
                return nil, e
        }
+       defer f.Close()
        if strings.HasSuffix(fname, ".gz") {
                if f, e = gzip.NewReader(f); e != nil {
                        return nil, e