Sublime Forum

Hex Viewer (a hex viewer and editor)

#21

[quote=“Callidus”]Would it be possible to have the hex editor open AND be positioned to where the cursor or selection currently is? E.g. Say I put the cursor at the end of a line, then open the Hex Viewer, it should open to that same spot at the end of the line (so that I can view 0d 0a).

Currently it always opens with the cursor at the start of the file.[/quote]

I don’t know…maybe. The view that ST2 gives of the text is a modified representation of the actual file. The hex view is a raw representation of the file. It may not be easy to analyze the ST2 buffer and find the correct offset into the binary buffer of the file.

0 Likes

#22

I’m not sure if I’m doing the wrong thing. I have tried installing Hex Viewer both manually and using package control. I have restarted ST2. The toggle hex option does appear, but it doesn’t appear to do anything. In case it helps: I’m using ST 2.0.2, OS X 10.7.5 and Python version 2.7.1.

Any help much appreciated.

Thanks.

0 Likes

#23

I will try upgrading my ST2 (I am currently using ST3 on OSX 10.8). Do you see any errors in the console? How big a file are you trying to view as hex? Details, details, I need the details :smile:.

0 Likes

#24

Well, this is strange. I went back to check the console to see if an error appeared but this time the toggling worked. Thank you for your quick reply anyway.

0 Likes

#25

No worries. Glad you got it working.

0 Likes

#26

Hey, how the heck do you actually edit anything? I have hex view loaded on this file using the command palette command, “Hex Viewer: Toggle Hex View” and I’m pressing keys with the part I want to edit selected and nothing is happening. Could you please write something about the basic usage of this arcane addon?

0 Likes

#27

Read here: github.com/facelessuser/HexView … edit-panel.

0 Likes

#28

Oh, I should have also mentioned that “Hex Viewer: Show Hex Edit Panel” does absolutely nothing. I hadn’t read that part of what you linked me, but I had tried “Hex Viewer: Show Hex Edit Panel”. It didn’t bring up anything. There was no reaction from the program, despite trying multiple times; not even an error. I then assumed that I was already viewing the “hex edit panel”. I scoured the screen for such a thing, and concluded that the uneditable area I was already viewing was the supposed “Hex Edit Panel”, and that it wasn’t working for some other reason. I was wrong there, but there was another bug, I suppose. How do I actually make the “Hex Edit Panel” appear if using “Hex Viewer: Show Hex Edit Panel” from the command palette does nothing?

0 Likes

#29
  1. I assure you it does work.

  2. This is not the place to get help, please use the Repo’s issue tracker github.com/facelessuser/HexViewer/issues; I don’t get notifications through the forum, and there is no way to track the issue here.

  3. When you create an issue on the Github repo, give me info I can use to actually help you.

  • OS you are using
  • Sublime Text build number
  • When you start sublime, if you scroll through the log, do you see console errors from HexViewer? Maybe something is isn’t loaded proper. Sometimes Package Control will do goofy things like install an ST2 version of a plugin on an ST3 machine or vice versa.
  • Did you restart after installing the package? Some times this is important as not all modules may have gotten loaded proper during installation.
  • Are you sure you have the latest version from Package Control. Uninstalling and reinstalling will usually ensure you have the latest (restart after installation to make sure things are loaded proper).
  • How do you understand what you are trying to do works? And what are the steps you are doing to get it work? That way I can follow your thought process and see how you might be off. I need to be able to reproduce your problem or I can’t help.

The documentation explains how this all works:

[quote] Invoking this command will take the currently selected bytes on a line and display them in an input panel. They can then be modified and submitted to replace the original bytes. Strings can also be used by using the “s:” prefix followed by the equivalent ASCII characters that are to replace the selected bytes.
[/quote]

So, first make sure you have some bytes selected (only bytes); whether it is their ascii form or hex form, it does not matter, as selecting one also selects the other. Invoke the edit command and the an input panel will pop up at the bottom of the view showing the hex representation in the input box. You can change the bytes, but the amount of bytes in the panel must match the original byte number when pressing enter. You are editing the bytes in place; you cannot insert more or delete, only change. If you want to, you can instead modify the characters in the ASCII domain (no unicode). Simply prefix your input with “s:” and type ASCII chars instead; again the ASCII chars must equal the original byte count.

If you want further help, create an issue on github.

0 Likes

#30

Keep in mind if you are using ST2, support ST2 variants of my plugins are no longer actively supported. I would upgrade to ST3. I just don’t have time to support two different versions of all my plugins.

0 Likes