Giter Club home page Giter Club logo

filehistory's People

Contributors

fichtefoll avatar jbjornson avatar lastsecondsave avatar rahul-ramadas avatar stdword avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

filehistory's Issues

Quick open files via "Right" key

ST has this in file open overlay (Ctrl P). When you click right button, it opens the selected file without closing the overlay.

If it is possible, it would be good on this plugin, too.

Couldn't preview or open certain files

Got a lot of these for the first two files in my list whenever I selected them:

Traceback (most recent call last):
  File "C:\Users\Fichte\AppData\Roaming\Sublime Text 3\Packages\File History\file_history.py", line 733, in show_preview
    if self.get_view_from_another_group(selected_entry):
  File "C:\Users\Fichte\AppData\Roaming\Sublime Text 3\Packages\File History\file_history.py", line 721, in get_view_from_another_group
    calling_group = FileHistory().calling_view_index[0]
IndexError: list index out of range

history entries (paths changed, but the unchanged paths exist):

      {
        "filename": "E:\\...1.md", 
        "group": 0, 
        "timestamp": 1413416087, 
        "index": 3
      }, 
      {
        "filename": "E:\\...2.md", 
        "group": 1, 
        "timestamp": 1413416085, 
        "index": 0
      }, 

I then opened them manually, closed them again and now it works. Prolly not reproducable but wanted to write this down

Specify permanent files

It'd be a nice enhancement if, just as some things can be excluded, I could list files I always want in the history. Thanks for the great plugin!

Licence

@jbjornson

I'm thinking of removing the "obtained from gist" message since it does not really provide any useful information and instead want to add a licence, because having no licence is actually not "open source". Preferring MIT.

`Enter` just takes me back to the last buffer

If I currently have file A.js open, and then open the FileHistory list I will see files A.js, B.js, C.js, etc. Now let's say I press down two times. I will see in the quick preview C.js (as expected). However, if I now press return it will take me back to A.js. Alternatively, if I press esc I will remain in C.js. So, currently I always try to press esc but it's rather unintuitive and I often accidentally press return

to summarize...

doesn't work:
recent_active_files -> down -> down -> return

works:
recent_active_files -> down -> down -> esc

Settings and keybindings open a blank document

@FichteFoll Maybe something changed in ST Dev 3142, but FileHistory's Settings - Default and Keybindings - Default open a blank document unless curly brackets are applied on the variables in Main.sublime-menu file. But this happens only with the default paths. Any path leading to the User folder, opens correctly without curly brackets surrounding the variables.

I've seen this happen with other packages, as well.
It might be a bug in ST, let me know what you think and if I should file an issue in ST's core repo.

[
    {
        "caption": "Preferences",
        "mnemonic": "n",
        "id": "preferences",
        "children":
        [
            {
                "caption": "Package Settings",
                "mnemonic": "P",
                "id": "package-settings",
                "children":
                [
                    {
                        "caption": "File History",
                        "children":
                        [
                            {
                                "caption": "Settings - Default",
                                "command": "open_file",
                                "args": {
                                    "file": "${packages}/File History/FileHistory.sublime-settings"
                                }
                            },
                            {
                                "caption": "Settings - User",
                                "command": "open_file",
                                "args": {
                                    "file": "${packages}/User/FileHistory.sublime-settings"
                                }
                            },
                            { "caption": "-"},
                            {
                                "caption": "Key Bindings – Default",
                                "command": "open_file",
                                "args": {
                                    "file": "${packages}/File History/Default (${platform}).sublime-keymap"
                                }
                            },
                            {
                                "caption": "Key Bindings – User",
                                "command": "open_file",
                                "args": {
                                    "file": "${packages}/User/Default (${platform}).sublime-keymap"
                                }
                            }
                        ]
                    }
                ]
            }
        ]
    }
]

Show relative timestamps

The timestamp feature looks great so far (didn't test, only reviewed code), but I'd probably love this to be relative too. It's just way quicker to understand (less information) and you won't care about the exact time anyway.

Ability to remove dead files from the Session.sublime_session file

If I use the cleanup_file_history command it doesn't remove the dead files found in:

...\Sublime Text\Data\Local\Session.sublime_session

Would it be possible to remove the dead files from this file or would there be problems seeing as sublime text may need to be closed?

Absolute timestamp error

Setting "timestamp_relative": false and calling the FileHistory panel, returns the following console error on ST Dev 3208:

Traceback (most recent call last):
  File "/Users/soulitude/Applications/Sublime Text.app/Contents/MacOS/sublime_plugin.py", line 1050, in run_
    return self.run(**args)
  File "/Users/soulitude/Library/Application Support/Sublime Text 3/Installed Packages/File History.sublime-package/file_history.py", line 745, in run
AttributeError: 'OpenRecentlyClosedFileCommand' object has no attribute 'TIMESTAMP_FORMAT'

Error when installing 1.5

Package Control.package_control.file_not_found_error.FileNotFoundError: The file "c:\users\moonlight\appdata\local\temp\tmpt1jeq8\working\messages/1.5.0.md" could not be found

Look like 1.5.0.txt must be renamed to 1.5.0.md

Disabling preview disallows use of quick panel shortcuts

It seems like disabling preview of files also disables the ability to use the quick panel shortcuts, like open file and delete entry.

I think you are making the assumption that no preview <=> ST2 (no on_highlight). That is not necessarily the case, as I may be on ST3, but disabled the preview (for which there is a setting in the plugin). In that case, it would be nice if I could still use the shortcuts.

Plugin isn't working anymore

Can't say exactly when it stopped working, but I'm unable to execute any command the plugin offers.

Im currently using Sublime Text 3 (Build 3065) on Windows 64bit Enterprise.

Regardless of the command, the error is the same:

Traceback (most recent call last):
  File "D:\Programme\Sublime Text 3\sublime_plugin.py", line 524, in run_
    return self.run(**args)
  File "file_history in D:\Programme\Sublime Text 3\Data\Installed Packages\File History.sublime-package", line 504, in run
  File "file_history in D:\Programme\Sublime Text 3\Data\Installed Packages\File History.sublime-package", line 25, in instance
  File "file_history in D:\Programme\Sublime Text 3\Data\Installed Packages\File History.sublime-package", line 33, in __init__
  File "file_history in D:\Programme\Sublime Text 3\Data\Installed Packages\File History.sublime-package", line 153, in __load_history
  File "./json/__init__.py", line 274, in load
  File "./json/__init__.py", line 319, in loads
  File "./json/decoder.py", line 352, in decode
  File "./json/decoder.py", line 368, in raw_decode
ValueError: Expecting object: line 1 column 32949 (char 32948)

Any suggestion?

Don't keep redundant symlinked paths

I often have redundant entries for the real and symlinked paths to a file. I recently added one of the paths to path_exclude_patterns but then sometimes miss entries. This could easily be resolved by way of only storing paths normalized by pathlib.Path.absolute().

Load the file history asynchronously and keep the quick panel open

My files history is big so when I ask for the history Sublime Text free like for 20 seconds.
I like the history big, then I prefer to wait, but while waiting:

  1. Keep Sublime Text UI frozen is not nice.
  2. When I came back to the Sublime Text window, Sublime Text is unfrozen, but no quick panel open (perhaps KEEP_OPEN_ON_FOCUS_LOST is not set?).

image

Does nothing in ST3

I have ST3 build 3047. I installed File History using Package Control. But when I run view.run_command("open_recently_closed_file"), nothing happens - no dialog box appears, and no errors appear in the console.

ESC key closes current buffer

When I use the current project popup menu and press the esc key instead of selecting a file it closes my current buffer.

Adapt to settings changes

I already marked it in the source, but this is really an issue. The settings should be fetched dynamically when needed instead of only on load.

Also, I highly doubt we should pollute the user settings with all our default settings.

Get rid of `FileHistory.instance()`

This snippet appears really often in the code and it's very lengthy and annoying. There are a few ways to get rid of this and I thing overriding __call__ is the easiest. But still, need to test this first.

Not working on mac sublime text 2 any longer

Traceback (most recent call last):
File "./sublime_plugin.py", line 337, in run_
File "./file_history.py", line 367, in run
File "./file_history.py", line 25, in instance
File "./file_history.py", line 33, in init
File "./file_history.py", line 56, in __load_settings
AttributeError: 'module' object has no attribute 'find_resources'

Deprecate hashing of a project's folders

With ST3 a new window.project_file_name() method was implemented which returns the project's filepath. This seems to be exactly what we need so a migration from the hash of the project's folders onto the project file path should be implemented soon. It's just that this method is not supported in ST2 so we need to support both, hashes and the project filepath. This finally removes the issue of a reset history if the project's folders have been modified.

Furthermore, a window.set_project_data() was added. While I think it could've been useful to us this it does not resample its main purpose which is not saving data but settings. And for showing a 'global' popup with all recently closed/accessed files we'd need the centralized file anyway so this method won't be of any use. It could serve as a "hash saving place" to resolve the problem with chaning folders mentioned above but with the other new method this is a non-issue.

Just leaving this here for discussion, eventually.

File history ignore/exclude path

A useful feature would be to define path patterns which filehistory will ignore (e.g., no need for two entries for the same file using different symlink paths)!!!

doesn't work with sublime 3.1.1, build 3176

I get the following error after trying to run File History: Open recently closed file ... via the command command palette:

Traceback (most recent call last):
  File "/Applications/Sublime Text.app/Contents/MacOS/sublime_plugin.py", line 1034, in run_
    return self.run(**args)
  File "/Users/tobi/Library/Application Support/Sublime Text 3/Installed Packages/File History.sublime-package/file_history.py", line 761, in run
  File "/Users/tobi/Library/Application Support/Sublime Text 3/Installed Packages/File History.sublime-package/file_history.py", line 799, in open_file
  File "/Users/tobi/Library/Application Support/Sublime Text 3/Installed Packages/File History.sublime-package/file_history.py", line 702, in get_history_by_index
IndexError: list index out of range

Enhancements for "multi open palette"

The key binding should check whether the caret is at the end of the input (following text: ^$).

Furthermore, we should mention this feature in the status bar while the panel is active.

Package Control tagging...

Hi FichteFoll,

Can you please have a quick look and make sure that everything is set up correctly so this change will be picked up by Package Control?

Thanks,
Josh

File History panel not opening

It shows an error:

Traceback (most recent call last):
  File "file_history in /home/khs/.config/sublime-text-3/Installed Packages/File History.sublime-package", line 553, in timestamp_from_string
  File "./_strptime.py", line 500, in _strptime_datetime
  File "./_strptime.py", line 337, in _strptime
ValueError: time data '2014-09-19 @ 18:42:13' does not match format '%Y-%m-%d %H:%M:%S'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/opt/sublime_text/sublime_plugin.py", line 526, in run_
    return self.run()
  File "file_history in /home/khs/.config/sublime-text-3/Installed Packages/File History.sublime-package", line 617, in run
  File "file_history in /home/khs/.config/sublime-text-3/Installed Packages/File History.sublime-package", line 560, in approximate_age
  File "file_history in /home/khs/.config/sublime-text-3/Installed Packages/File History.sublime-package", line 556, in timestamp_from_string

AttributeError: 'OpenRecentlyClosedFileCommand' object has no attribute 'debug'

problem with st3

startup, version: 3014 osx x64 channel: dev

Traceback (most recent call last):
  File "/Applications/Sublime Text.app/Contents/MacOS/sublime_plugin.py", line 506, in run_
    return self.run(**args)
  File "/Library/Application Support/Sublime Text 3/Installed Packages/File History.sublime-package/file_history.py", line 236, in run
  File "/Library/Application Support/Sublime Text 3/Installed Packages/File History.sublime-package/file_history.py", line 105, in get_history
  File "/Library/Application Support/Sublime Text 3/Installed Packages/File History.sublime-package/file_history.py", line 65, in get_current_project_hash
TypeError: Unicode-objects must be encoded before hashing

Add settings file

Since we now have yet another new (potential) setting we should definitely consider adding a settings file. Thus, moving this from the README.

  • A settings file (and using the information from there)
  • Option to cleanup when starting Sublime

I will see if I can take on this in the next weeks (holidays), but even though the task is not huge I have a lot of packages with a higher priority on my list. You are free to take this, @jbjornson.

Revise cleanup a bit

Things we can cleanup as well:

  • old-style project identifiers like "9de74ff27edf630ae04f18f4002bcc10"
  • project identifiers to project files that don't exist anymore (but preserve in global, assuming the files still exist)
  • Files in projects that don't exist

I just ran the command but these entries still existed in my file.

Also, we should consider bumping unprettified JSON instead of the 4-space indented we do now. I doubt you'd edit the file manually (never did that in my years of continuous use) and if you would, you could always run it through a prettifier plugin or website.

cleanup_file_history doesn't work.

cleanup_file_history doesn't clear the inputs in the FileHistory.json file ,ST 3 -OSX 10.9

i dont know if this would help or not but i use this settings
{ "keys": ["control+shift+o"], "command": "open_recently_closed_file", "args": {"show_quick_panel": true , "current_project_only": false} },

Pressing `right` to open a history entry does not work if previews are disabled

At some point, pressing the right key with the file history list open used to open the currently highlighted history entry without closing the history list. Now, this does not seem to work if show_file_preview is set to False; it only works if it is set to True.

I get the following error in the console:

Traceback (most recent call last):
  File "E:\Sublime\sublime_plugin.py", line 775, in run_
    return self.run(**args)
  File "file_history in E:\Sublime\Data\Installed Packages\File History.sublime-package", line 773, in run
  File "file_history in E:\Sublime\Data\Installed Packages\File History.sublime-package", line 492, in quick_open_preview
AttributeError: 'NoneType' object has no attribute 'file_name'

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.