jskinner / DefaultPackages

Old bug tracker for Sublime Text's "Default Packages", e.g. bad syntax highlighting
http://web.archive.org/web/20150524043750/https://www.sublimetext.com/forum/viewtopic.php?f=2&t=12095
26 stars 2 forks source link

Add copy filename command and menu #144

Closed shivapoudel closed 8 years ago

shivapoudel commented 9 years ago

Just like copy_path there should exists a command for copy_filename too.

import sublime, sublime_plugin
import os.path

class CopyFilenameCommand(sublime_plugin.TextCommand):
    def run(self, edit):
        if len(self.view.file_name()) > 0:
            sublime.set_clipboard(os.path.basename(self.view.file_name()))
            sublime.status_message("Copied file name")

    def is_enabled(self):
        return self.view.file_name() != None and len(self.view.file_name()) > 0
shivapoudel commented 9 years ago

@FichteFoll In which version this will be available. Please reference to support till core default sublime package doesn't support this command copy_filename: https://github.com/wbond/package_control_channel/pull/4680

I mean to say if the core support this on upcoming version then we have to support that package only for certain version. I will love to see this on core as the menu will be available after Copy File Path which rarely happens in above package :tada:

FichteFoll commented 9 years ago

I do not control what gets implemented in Sublime Text core (or shipped packages) because I am not affiliated with Sublime HQ. I do all this on a voluntary basis.

FichteFoll commented 8 years ago

This issue was moved to SublimeTextIssues/Core#1187