Comments (8)
Besides, is there any possibility to add cut/paste to the menu?
That's not planned. FileManager just tries to be lightweight, and I feel that if you are going to such big fancy file moves, then you should use an actual file manager, not the text editor's.
Indeed, auto_close_empty_group
doesn't work for me either. I'll look into that later on
from filemanager.
Alright sweet, I'll make an other package and submit it to package control 🙂
I don't think on_hover
is the most appropriate event to listen for. FileManager uses on_close
(with a little on_pre_close
because ST is a bit quirky sometimes), so that we do as little error checking as possible. That also comes at the cost of not being able to close the pane automatically if you drag the tab out of a group with the mouse. But if you want to do that, then you should probably use View -> Groups -> Close Group
(which you probably want to add to the command palette too).
Also, it uses window.run_command('close_pane')
instead of forcefully using the single layout (so if for some odd reason you have nested groups ie. 3 columns for example, it wouldn't destroy everything).
I'll close once I will have split up FileManager and AutoCloseEmptyGroup.
from filemanager.
Alright, now we just have to wait for the PR to be merged (i'll remove the feature from FileManager as soon as that happens)
from filemanager.
It's been merged! 🎉 Thank you for you help @LynnHo
I added a warning for people who did use the setting (the reason I even hit people who might have had it set to false with this warning is because maybe they just disabled because it was buggy):
Lines 39 to 58 in 1c28c3d
from filemanager.
@math2001 Well done!
from filemanager.
Omg that was a very stupid and simple bug. I was checking the view's settings, instead of FileManager's settings. Just a one liner. I'll push the fix 🙂
from filemanager.
Actually, I just realised that it doesn't really make sense for this feature to be in FileManager. I think it should be in it's own package (something like AutoCloseEmptyGroup
maybe?)
It would be a tiny package, sure, but this feature doesn't interact in any way with the rest of FileManager, and I don't think a user would expect it either (ie. think about a user uninstalling FileManager, and suddenly seeing that their empty groups don't close automatically. They certainly could want that feature without FileManager). Considering that the default value for this setting was false
, this might even be the opportunity to split now.
What do you think @LynnHo ?
from filemanager.
@math2001 Thanks for fixing the bug! I totally agree that it should be an independent package. And actually, I wrote an AutoCloseEmptyGroup
for myself. The code is below, (I am not very familiar with sublime coding, but it works)
class AutoCloseEmptyGroupCommand(sublime_plugin.EventListener):
"""AutoCloseEmptyGroup.
Settings
--------
view_control_close_auto_close_empty_group: boolean
"""
def on_hover(self, view, point, hover_zone):
auto_close_empty_group = self.settings.get('view_control_close_auto_close_empty_group', False)
if auto_close_empty_group:
window = sublime.active_window()
n_group = window.num_groups()
non_empty_group_id = []
for i in range(n_group):
if window.sheets_in_group(i):
non_empty_group_id.append(i)
if len(non_empty_group_id) == 1 and len(non_empty_group_id) < n_group:
for s in window.sheets_in_group(non_empty_group_id[0]):
window.set_sheet_index(s, 0, len(window.sheets_in_group(0)))
window.focus_group(0) # to avoid crash
window.run_command('set_layout', {"cols": [0.0, 1.0], "rows": [0.0, 1.0], "cells": [[0, 0, 1, 1]]})
from filemanager.
Related Issues (20)
- [Feature Request] Add edit files without any layout setting HOT 4
- FileManager shouldn't create so many commands HOT 2
- Remove .sublime folder HOT 1
- Alpha ST4 - Duplicate Rename entries on menu HOT 6
- Test tab completion logic
- Document tips and tricks
- [help wanted] Remove useless things. Make this package intuitive. HOT 3
- Refresh side bar checking view settings instead of FileManager settings
- Copy relative path function outputs a string starting with "/" HOT 5
- How to accept an intermediate path completion? HOT 6
- stopped working for me HOT 8
- Duplicate chokes on non-ascii files HOT 1
- folder selection is not working
- [Bug] Sidebar missing entries when file is open HOT 1
- conflict of hotkey "alt+n" HOT 2
- Cannot move files to different directories
- can not duplicate the file to a new directory HOT 3
- Definign index number in preferences does not seem to change the default
- Remove so many features
- Getting frivolous infinite loop messages
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from filemanager.