treewalker.nvim icon indicating copy to clipboard operation
treewalker.nvim copied to clipboard

Treewalker seems to to not be able walk upwards inside nested blocks in .go files

Open I-Own-You opened this issue 3 months ago • 2 comments

https://github.com/user-attachments/assets/ecb57beb-f81f-4423-b6c4-15f0b5981361

Code to reproduce:

package main

import (
	"bufio"
	"fmt"
	"os"
	"strings"
)

func ScannerExample() {

	// scanner is a handy way to work with files, mainly for its tokenization way,
	// its used for read by lines or read by words but has other options too.
	// its not as efficient as buffio.reader/writer but nicer way for simple and easy things.
	scanner := bufio.NewScanner(os.Stdin)

	// return false if end of the input or error
	for scanner.Scan() {

		ucl := strings.ToUpper(scanner.Text())

		fmt.Println(ucl)
	}

	if err := scanner.Err(); err != nil {
		fmt.Fprintln(os.Stderr, "error:", err)
		os.Exit(1)
	}
}

I-Own-You avatar Aug 22 '26 17:08 I-Own-You

I can't reproduce this on the commit you made it on, but after the recent commit closing #66, the selection criteria changed slightly, so maybe see if you can revalidate this on latest

aaronik avatar Aug 24 '26 18:08 aaronik

Okay, this is fixed, but the switch/case is broken in another way, i will continue here: #66

I-Own-You avatar Aug 24 '26 20:08 I-Own-You