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

Treewalker is not able to move upwards if cursor is on a closed html tag inside .tsx (and probably .jsx as well) files

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

https://github.com/user-attachments/assets/28e4f527-3746-4d0f-b605-a72622d4a387

code to reproduce:

export function ArticlePage() {
  return (
    <div className="article-page">
      <ArticleView />
      <ArticleComments />
    </div>
  );
}

function ArticleView() {
  const { articlePromise } = useLoaderData<ArticlePageLoaderData>();

  return (
    <Suspense fallback={<Spinner />}>
      <Await resolve={articlePromise} errorElement={<ArticleContentError />}>
        {(articleData) => <ArticleContent article={articleData.article} />}
      </Await>
    </Suspense>
  );
}

type ArticleContentProps = {
  article: SingleArticleResponse['article'];
};

function ArticleContent({ article }: ArticleContentProps) {
  const { title, body, tagList } = article;

  return (
    <>
      <div className="banner">
        <div className="container">
          <h1>{title}</h1>
          <ArticleActionsBlock article={article} />
        </div>
      </div>

      <div className="container page">
        <div className="row article-content">
          <div className="col-md-12">
            <p>{body}</p>
            {tagList.length > 0 && (
              <ul className="tag-list">
                {tagList.map((tag) => (
                  <li key={tag} className="tag-default tag-pill tag-outline">
                    {tag}
                  </li>
                ))}
              </ul>
            )}
          </div>
        </div>

        <hr />

        <div className="article-actions">
          <ArticleActionsBlock article={article} />
        </div>
      </div>
    </>
  );
}

I-Own-You avatar Aug 23 '26 16:08 I-Own-You

Can you please post your config to all of these issues?

aaronik avatar Aug 24 '26 17:08 aaronik

Your example here is not meant to work - it treats the closing tag as the opening tag, and there's nothing above this to move to. If you added another tag above this, I suspect it'd jump to it

aaronik avatar Aug 24 '26 19:08 aaronik

okay, apparently while i opened this issues at night i literally confused % builtin from nvim itself with the treesitter parser, yes it should not go up, this is hilarious, thanks!

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

Hah all good. Thanks again for all the issues! They really help to make the plugin more solid 🤘

aaronik avatar Aug 24 '26 21:08 aaronik