Completed
Pull Request — master (#5)
by
unknown
41s
created

QuickGotoFileCommand   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 10
Duplicated Lines 0 %

Importance

Changes 4
Bugs 0 Features 2
Metric Value
wmc 3
c 4
b 0
f 2
dl 0
loc 10
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A run() 0 9 3
1
# coding=utf-8
2
import sublime
3
import sublime_plugin
4
import re
5
6
class QuickGotoFileCommand(QuickGotoCommand):
7
    def run(self, edit):
8
        for sel in self.view.sel():
9
            if sel.empty():
10
                self.view.window().run_command("show_overlay", {"overlay": "goto", "show_files": True})
11
            else:
12
                word_sel = self.view.substr(sel)
13
                word_sel = word_sel.strip()
14
                self.view.window().run_command("show_overlay", {"overlay": "goto", "show_files": True, "text": word_sel})
15
                self.view.window().run_command("select_all")
16
        
17