Skip to content

Commit

Permalink
Added find names in file
Browse files Browse the repository at this point in the history
  • Loading branch information
aam committed Jun 16, 2014
1 parent 8d06be2 commit 8eda385
Show file tree
Hide file tree
Showing 7 changed files with 35 additions and 3 deletions.
1 change: 1 addition & 0 deletions Default (Linux).sublime-keymap
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@
{ "keys": ["ctrl+alt+m"], "command": "cfserver_find_macros" },
{ "keys": ["ctrl+alt+g"], "command": "cfserver_find_strings" },
{ "keys": ["ctrl+alt+f"], "command": "cfserver_find_files" },
{ "keys": ["ctrl+f12"], "command": "cfserver_find_names_in_file" },
]
1 change: 1 addition & 0 deletions Default (OSX).sublime-keymap
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@
{ "keys": ["ctrl+alt+m"], "command": "cfserver_find_macros" },
{ "keys": ["ctrl+alt+g"], "command": "cfserver_find_strings" },
{ "keys": ["ctrl+alt+f"], "command": "cfserver_find_files" },
{ "keys": ["ctrl+f12"], "command": "cfserver_find_names_in_file" },
]
1 change: 1 addition & 0 deletions Default (Windows).sublime-keymap
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@
{ "keys": ["ctrl+alt+m"], "command": "cfserver_find_macros" },
{ "keys": ["ctrl+alt+g"], "command": "cfserver_find_strings" },
{ "keys": ["ctrl+alt+f"], "command": "cfserver_find_files" },
{ "keys": ["ctrl+f12"], "command": "cfserver_find_names_in_file" },
]
11 changes: 8 additions & 3 deletions Main.sublime-menu
Original file line number Diff line number Diff line change
Expand Up @@ -12,20 +12,25 @@
"command": "cfserver_find_names",
"mnemonic": "n"
},
{
"caption": "Find C/C++ names in file...",
"command": "cfserver_find_names_in_file",
"mnemonic": "a"
},
{
"caption": "Find C/C++ macros...",
"command": "cfserver_find_macros",
"mnemonic": "n"
"mnemonic": "m"
},
{
"caption": "Find C/C++ files...",
"command": "cfserver_find_files",
"mnemonic": "n"
"mnemonic": "f"
},
{
"caption": "Find C/C++ strings...",
"command": "cfserver_find_strings",
"mnemonic": "n"
"mnemonic": "s"
},
]

Expand Down
19 changes: 19 additions & 0 deletions linter.py
Original file line number Diff line number Diff line change
Expand Up @@ -712,6 +712,25 @@ def __init__(self, view):
self.set_find_command("find-names")


class CfserverFindNamesInFile(CfserverFind):

def handler(self):
return UsagesNamesHandler()

def command(self):
view = self.view

return "%s \"%s\" \"\"" % (
self.find_command,
view.file_name().replace("\\", "\\\\"))

return "%s \"%s\" \"%s\"" % (self.find_command, "", "system")

def __init__(self, view):
super().__init__(view)
self.set_find_command("find-names-in-file")


class CfserverFindMacros(CfserverGlobalFind):

def __init__(self, view):
Expand Down
1 change: 1 addition & 0 deletions messages.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{
"0.0.3": "messages/0.0.3.txt",
"0.0.4": "messages/0.0.4.txt",
}
4 changes: 4 additions & 0 deletions messages/0.0.4.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Cfserver Sublime plugin 0.0.4
-----------------------------

- String/file/macro navigation command added

0 comments on commit 8eda385

Please sign in to comment.