Skip to content

Commit

Permalink
2.34.0
Browse files Browse the repository at this point in the history
  • Loading branch information
heyglen committed Jan 23, 2020
1 parent e66ade4 commit 0209ab1
Show file tree
Hide file tree
Showing 11 changed files with 63 additions and 4 deletions.
1 change: 1 addition & 0 deletions Network Tech.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
from .lib.detect_syntax import AutoSyntaxDetection # noqa
from .lib.search.network import FindSubnetCommand, NetworkInfoListener # noqa
from .lib.format_ import FormatMacCommand, DashFormatMacCommand, ColonFormatMacCommand, DotFormatMacCommand # noqa
from .lib.settings import ToggleNetworkInfoOnHoverCommand # noqa


logger = logging.getLogger('network_tech')
Expand Down
5 changes: 5 additions & 0 deletions Network Tech.sublime-commands
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
[
{
"caption": "Network Tech: Toggle Network Info Popup on Hover",
"command": "toggle_network_info_on_hover",
"args": {}
},
{
"caption": "Network Tech: Format MAC Address",
"command": "format_mac",
Expand Down
1 change: 1 addition & 0 deletions Network Tech.sublime-settings
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{
"network_info_on_hover": false,
"log_level": "debug"
}
1 change: 0 additions & 1 deletion cisco-ios-xr.sublime-syntax
Original file line number Diff line number Diff line change
Expand Up @@ -2255,7 +2255,6 @@ contexts:
- include: router_bgp_neighbor_address_family_ipv6_multicast
- include: router_bgp_neighbor_address_family_ipv6_flowspec
- include: router_bgp_neighbor_address_family_ipv6_mvpn
- include: router_bgp_neighbor_address_family_vpnv6

router_bgp_neighbor_group_address_family:
- include: router_bgp_neighbor_group_address_family_ipv4_unicast
Expand Down
2 changes: 2 additions & 0 deletions lib/format_/network.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@


6 changes: 6 additions & 0 deletions lib/search/network/listener.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,12 @@

class NetworkInfoListener(sublime_plugin.ViewEventListener):
def on_hover(self, point, hover_zone):
settings = sublime.load_settings('Network Tech.sublime-settings')
network_info_on_hover = settings.get('network_info_on_hover', True)

if not network_info_on_hover:
return

if not self.view.scope_name(point).startswith(SCOPE_PREFIX):
return
if hover_zone == sublime.HOVER_TEXT:
Expand Down
4 changes: 4 additions & 0 deletions lib/settings/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Copyright 2017 Glen Harmon


from .listener import ToggleNetworkInfoOnHoverCommand
32 changes: 32 additions & 0 deletions lib/settings/listener.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# Copyright 2017 Glen Harmon

import logging

import sublime
import sublime_plugin

logger = logging.getLogger('network_tech.settings.listener')


STATUS_KEY = 'Network Tech'
SETTINGS_FILE_NAME = 'Network Tech.sublime-settings'
NETWORK_INFO_ON_HOVER_SETTING_NAME = 'network_info_on_hover'

class ToggleNetworkInfoOnHoverCommand(sublime_plugin.TextCommand):

def run(self, edit):
settings = sublime.load_settings(SETTINGS_FILE_NAME)
network_info_on_hover = settings.get(NETWORK_INFO_ON_HOVER_SETTING_NAME, True)
settings.set(NETWORK_INFO_ON_HOVER_SETTING_NAME, not network_info_on_hover)
sublime.save_settings(SETTINGS_FILE_NAME)

setting_status = 'ON' if not network_info_on_hover else 'OFF'
set_status = 'Network Info Popup: {}'.format(setting_status)

def clear_status():
current_status = self.view.get_status(STATUS_KEY)
if set_status == current_status:
self.view.erase_status(STATUS_KEY)

self.view.set_status(STATUS_KEY, set_status)
sublime.set_timeout_async(clear_status, 4000)
5 changes: 3 additions & 2 deletions messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
"2.29.0": "messages/2.29.0.md",
"2.30.0": "messages/2.30.0.md",
"2.31.0": "messages/2.31.0.md",
"2.32.0": "messages/2.32.0.md"
"2.33.0": "messages/2.33.0.md"
"2.32.0": "messages/2.32.0.md",
"2.33.0": "messages/2.33.0.md",
"2.34.0": "messages/2.34.0.md"
}
9 changes: 9 additions & 0 deletions messages/2.34.0.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# [2.34.0] - 2020.01.23

## Added

* Command: "Network Tech: Toggle Network Info Popup on Hover"

The popup window with network information that appears when you mouse over a network can be turned on and off with this command.

Tools → Command Pallet → Network Tech: Toggle Network Info Popup on Hover
1 change: 0 additions & 1 deletion tests/syntax_test_cisco_ios.cisco-ios
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ username [ACCOUNT] privilege 15 secret [ACCOUNT_PASSWORD]
# device router02



ip classless
copy tftp://1.2.3.4/path startup-config ! Inline comment

Expand Down

0 comments on commit 0209ab1

Please sign in to comment.