zenozeng/yafolding.el

Number of direct nested children items?

Opened this issue · 1 comments

Emacs 26.1

Suppose I has the next json:

{
	"tables": [{
			"frame": {
				"height": 9,
				"width": 18,
				"x": 1,
				"y": 5
			},
			"id": 62,
			"name": "Herbert",
			"place": 1,
			"room": 1,
			"token": "611111b1-7c47-410d-99ff-ba2203e9cee6",
			"user_id": "2"
		},
		{
			"frame": {
				"height": 9,
				"width": 18,
				"x": 37,
				"y": 5
			},
			"id": 63,
			"name": "Shannon",
			"place": 1,
			"room": 1,
			"token": "3400f22a-09f7-47c3-9569-3da2222222b2",
			"user_id": ""
		}
	]
}

I want to know how many nested direct children contain item tables
I this case there are TWO direct children .

Is it possible in yafolding lib?

Currently no, yafolding traverses the indentations to find the end of the block to hide, but it doesn't count the children.

json specific packages: https://wikemacs.org/wiki/Json