Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 2 additions & 7 deletions Context.sublime-menu
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
[
[
{"command": "dec_to_hex"},
{"command": "dec_to_bin"},
{"command": "bin_to_dec"},
{"command": "hex_to_dec"},
{"command": "ascii_to_hex"},
{"command": "hex_to_ascii"}


]
]
19 changes: 10 additions & 9 deletions Main.sublime-menu
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
[
{
"id": "selection",
"children":
[
{"command": "ascii_to_hex"},
{"command": "hex_to_ascii"}
]
}
[
{
"id": "selection",
"children":
[
{"command": "dec_to_hex"},
{"command": "ascii_to_hex"},
{"command": "hex_to_ascii"}
]
}
]
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Sublime Text 2 ASCII<->Hex converter Plugin #
# Sublime Text 2/3 ASCII<->Hex DEC->HEX converter Plugin #

Sublime Text 2 plugin to convert ASCII->Hex and Hex->ASCII
Sublime Text 2/3 plugin to convert ASCII<->Hex and DEC->HEX (Thanks By Carghaez)

## Usage ##

Expand Down
13 changes: 13 additions & 0 deletions dec_to_hex.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import sublime
import sublime_plugin


class DecToHexCommand(sublime_plugin.TextCommand):

def run(self, edit):
v = self.view
reglist = list(v.sel())
for j in range(0, len(reglist)):
hx = v.substr(v.sel()[j])
hx = hex(int(hx, 10))
v.replace(edit, v.sel()[j], hx)