Skip to content

Making package ST3 only #22

Closed
Closed

Description

@jrappen

@aziz I was looking at sublimehq/packagecontrol.io#90 recently and reviewing the code of this repository it seems to me like most of the code here is workarounds for ST2.

Moving forward I would suggest:

  • make the package ST3 only
    • we should be able to get rid of the package's settings file and run all functionality off the application's User/Preferences.sublime-settings and User/Distraction Free.sublime-settings files only
      • add a python file during the transition phase to auto-migrate settings according to expected behaviour
    • add a dependencies.json to show users the README and CHANGELOG with ST3's mini-html via mdpopups

Your decision ...

Activity

  1. jrappen commented on Feb 13, 2017

    @jrappen
    CollaboratorAuthor

    Minimal setup on ST3

    distraction_free_window.py
    #!/usr/bin/env python
    # coding: utf-8
    
    import sublime
    import sublime_plugin
    
    
    class DistractionFreeWindowCommand(sublime_plugin.WindowCommand):
    
        def run(self):
            w = self.window
            if w is None:
                status_msg('Distraction Free Window: Error: Window is None')
                return
    
            if w.active_view().settings().get('is_widget', False):
                status_msg('Distraction Free Window: Error: Active view is a widget.')
                return
    
            if w.is_sidebar_visible():
                # Preferences > Settings - Distraction Free
                distraction_free = sublime.load_settings('Distraction Free.sublime-settings')
                for v in w.views():
                    v.settings().set('draw_centered', distraction_free.get('draw_centered', True))
                    v.settings().set('draw_indent_guides', distraction_free.get('draw_indent_guides', True))
                    v.settings().set('draw_white_space', distraction_free.get('draw_white_space', 'selection'))
                    v.settings().set('fold_buttons', distraction_free.get('fold_buttons', True))
                    v.settings().set('gutter', distraction_free.get('gutter', False))
                    v.settings().set('line_numbers', distraction_free.get('line_numbers', False))
                    v.settings().set('rulers', distraction_free.get('rulers', []))
                    v.settings().set('scroll_past_end', distraction_free.get('scroll_past_end', True))
                    v.settings().set('word_wrap', distraction_free.get('word_wrap', True))
                    v.settings().set('wrap_width', distraction_free.get('wrap_width', 80))
                if sublime.platform() is not 'osx':
                    w.set_menu_visible(False)
                w.set_sidebar_visible(False)
                w.set_tabs_visible(False)
                w.set_minimap_visible(False)
                # w.set_status_bar_visible(False)
            else:
                # Preferences > Settings
                preferences = sublime.load_settings('Preferences.sublime-settings')
                for v in w.views():
                    v.settings().set('draw_centered', preferences.get('draw_centered', False))
                    v.settings().set('draw_indent_guides', preferences.get('draw_indent_guides', True))
                    v.settings().set('draw_white_space', preferences.get('draw_white_space', 'selection'))
                    v.settings().set('fold_buttons', preferences.get('fold_buttons', True))
                    v.settings().set('gutter', preferences.get('gutter', True))
                    v.settings().set('line_numbers', preferences.get('line_numbers', True))
                    v.settings().set('rulers', preferences.get('rulers', []))
                    v.settings().set('scroll_past_end', preferences.get('scroll_past_end', True))
                    v.settings().set('word_wrap', preferences.get('word_wrap', 'auto'))
                    v.settings().set('wrap_width', preferences.get('wrap_width', 0))
                if sublime.platform() is not 'osx':
                    w.set_menu_visible(True)
                w.set_sidebar_visible(True)
                w.set_tabs_visible(True)
                w.set_minimap_visible(True)
                # w.set_status_bar_visible(True)
    Default.sublime-keymap
    [
        { "keys": ["super+f11"], "command": "distraction_free_window" }
    ]
  2. jrappen commented on Oct 19, 2017

    @jrappen
    CollaboratorAuthor

    @aziz Currently Sublime Text 3 users make up 97.4% of the Package Control activity. Should I open a PR with the changes suggested above?

  3. jrappen commented on Oct 19, 2017

    @jrappen
    CollaboratorAuthor

    Also, I'd like your take on using 3 sets of preferences vs using 2 sets of preferences.

    Would you prefer:

    • Preferences
    • Distraction Free
    • Distraction Free Window

    Or rather?

    • Preferences
    • Distraction Free (for both Distraction Free and Distraction Free Window)
  4. aziz commented on Oct 19, 2017

    @aziz
    Owner

    @aziz Currently Sublime Text 3 users make up 97.4% of the Package Control activity. Should I open a PR with the changes suggested above?

    I think we can move the current version as is into a branch and then release a new one just for version 3.

  5. aziz commented on Oct 19, 2017

    @aziz
    Owner

    Also, I'd like your take on using 3 sets of preferences vs using 2 sets of preferences.

    I'm not sold on this one. what's the benefit of it for the user? it'll just make things more complicated.
    given that we can use comments and new lines to separate the setting into sections, I think I prefer less setting files

  6. jrappen commented on Oct 19, 2017

    @jrappen
    CollaboratorAuthor
  7. jrappen commented on Oct 19, 2017

    @jrappen
    CollaboratorAuthor
  8. aziz commented on Oct 19, 2017

    @aziz
    Owner

    Sorry I got it totally wrong. I'm neutral. given the fact that the Distraction Free settings that we added is something internal that users should not change. it's only for distinguishing between DFW and the real DF mode in sublime. but if you feel it makes it easier, feel free to get rid of a separate setting and put everything under the DF settings. make sure it's future proof and we'll not have any potential conflict with future native DF settings.

  9. jrappen commented on Oct 19, 2017

    @jrappen
    CollaboratorAuthor

    Just asking because my understanding from the introduction in the README is that you built the package to have a non-fullscreen Distraction Free mode....implying that the non-fullscreen part is the only difference. Logically the next step for me would be the removal of the third set of settings.

    I'm just documenting my thoughts here though, I'm neutral as well.

  10. jrappen commented on Oct 23, 2017

    @jrappen
    CollaboratorAuthor

    @aziz Released v0.6.7 with a request for comment. I suggest waiting a week or so, then splitting branches and releases.

  11. jrappen commented on May 14, 2018

    @jrappen
    CollaboratorAuthor

    @aziz I split branches locally, removed redundant code where applicable, prepared with prefixed tags. Will push tonight after work and send a pull request to the package control channel with an updated config.

  12. added a commit that references this issue on Jun 12, 2018
    fff4803
  13. jrappen commented on Jun 12, 2018

    @jrappen
    CollaboratorAuthor

    Split into branches:

    to apply tags with the following prefixes:

    • st3-
    • st2-

    going forward.


    Fixed in sublimehq/package_control_channel#7153

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions