x-path-walker icon indicating copy to clipboard operation
x-path-walker copied to clipboard

helm-x-path-walker modifies buffer

Open timjstewart opened this issue 9 years ago • 2 comments

  1. Open JSON File
  2. Note that the buffer has not been modified (e.g. no asterisk appears by the buffer name).
  3. M-x helm-x-path-walker
  4. enter a string that matches one or more nodes in the JSON file.
  5. Hit C-j (Jump to path)
  6. Note that an asterisk appears near the buffer name.

timjstewart avatar Aug 23 '16 15:08 timjstewart

I have been looking for a tool like this (currently using jq from the command line). Thanks for creating this!

timjstewart avatar Aug 23 '16 15:08 timjstewart

Thanks for giving it try.

This is currently a known drawback. "Untidy" JSONs is not supported. The JSON has to be the formated as if piped into "python -m json" (or formatted as per python json module). However if the buffer is already modified it should ask you to save before running helm-x-path-walker. Currently this package does not test if the formatting is as expected as I think it is a rare case. I'll take another look at the JSON code to see if any improvement can be made (or find another python module). For [XH]TML, the underlying module (lxml) also provide the line number on the elements so it will accept messy files without problem.

Lompik avatar Aug 23 '16 16:08 Lompik