Sublime Forum

Forum request thread

#1

Iā€™m creating this thread as a catch-all for (feature) requests regarding the forum, which is using Discourse. Previously I addressed Will directly, but I think a more permanent and public location is better.


As my first request I would like to have YAML added to the highlighted languages list, as indicated by this thread.

0 Likes

#2

Is there any plugin or something to paste code, because every-time I paste code in here, it get funnily formatted, is very frustrating, I cannot paste code. It desperate me, seriously -.-

What can I do to paste code without the forum interfering with the ā€œmarkupā€

0 Likes

#3

1st of all: Some ideas for the forum: pinned posts & category templates

2nd: Solved Button - forum improvement

@tito: try to indent using spaces, not tabs :wink:

1 Like

#4

Whats the problem with tabs, I use tabs. How do I pasted code here that has tabs?

0 Likes

#5

Browsers just act insane when it comes to tab indentation, thatā€™s all :slightly_smiling:

1 Like

#6

:slight_smile: Im not worried about how the browser display it, but at least the reader should be able to copy and paste and modify as desired. I was trying to paste the following code: https://dl.dropboxusercontent.com/u/9303546/SublimeText/commands/open_file_with_custom_find_command.py an for some reason format is weird

0 Likes

#7
import functools, sublime, sublime_plugin
class open_file_with_custom_find_command(sublime_plugin.WindowCommand):
	def run(self):
		window = sublime.active_window()
		window.run_command('hide_panel');
		window.show_input_panel('Search For 1:', '', functools.partial(self.on_done1), None, None)

	def on_done1(self, search_for1):
		search_for1 = search_for1.strip()
		if search_for1:
			window = sublime.active_window()
			window.run_command('hide_panel');
			window.show_input_panel('Search For 2:', '', functools.partial(self.on_done2, search_for1), None, None)

	def on_done2(self, search_for1, search_for2):
		window = sublime.active_window()
		view = window.active_view()
		search_for2 = search_for2.strip()
		if search_for1 and search_for2:
			regions1 = view.find_all(search_for1, sublime.IGNORECASE)
			regions2 = view.find_all(search_for2, sublime.IGNORECASE)
			if regions1 and regions2:
				for item1 in reversed(regions1):
					sel_start = view.line(item1).end()
					for item2 in reversed(regions2):
						if item2.end() < sel_start:
							substr = view.substr(sublime.Region(sel_start, item2.begin()))
							print(substr)
							if substr:
								_view = window.new_file()
								_view.run_command('insert', {'characters': substr})
								break
0 Likes

#8

There it kinda worked, let check next example

import re, sublime, sublime_plugin

class SpaceToTabsListener(sublime_plugin.EventListener):
	def on_post_text_command(self, view, command_name, args):
		if command_name == 'insert' and args['characters'] == '\n' and not view.settings().get('translate_tabs_to_spaces'):
			view.run_command('unexpand_tabs', {"set_translate_tabs":True})
			view.run_command('space_to_tabs')

class SpaceToTabsCommand(sublime_plugin.TextCommand):
	def run(self, edit):
		view = self.view
		for region in reversed(view.sel()):
			indentation = sublime.Region(view.line(region).begin(), region.end())
			content = view.substr(indentation)
			if re.search('^\t+ +', content):
				view.replace(edit, indentation, re.sub('^(\t+)( +)', '\\1\t', content))
0 Likes

#9

See previous example is broken here is original file https://dl.dropboxusercontent.com/u/9303546/SublimeText/bugs/SpacesToTabs.py

this markdown thing, I hate it. Stop breaking the web, give users preferences, your ideas are crap.

0 Likes

#10
```python
my python codes here
1 Like

#11
import re, sublime, sublime_plugin

class SpaceToTabsListener(sublime_plugin.EventListener):
	def on_post_text_command(self, view, command_name, args):
		if command_name == 'insert' and args['characters'] == '\n' and not view.settings().get('translate_tabs_to_spaces'):
			view.run_command('unexpand_tabs', {"set_translate_tabs":True})
			view.run_command('space_to_tabs')

class SpaceToTabsCommand(sublime_plugin.TextCommand):
	def run(self, edit):
		view = self.view
		for region in reversed(view.sel()):
			indentation = sublime.Region(view.line(region).begin(), region.end())
			content = view.substr(indentation)
			if re.search('^\t+ +', content):
				view.replace(edit, indentation, re.sub('^(\t+)( +)', '\\1\t', content))
0 Likes

#12

Same problem :rage:

0 Likes

#13
0 Likes

#15

When you attempt to create a new topic, Discourse automatically prompts you with related topics in order to redirect you to them. This is the best way of trying to prevent duplicates that I have seen so far. All users must have deliberately ignored this popup. (Or the search results are bad.)

@tito: Never had any problems with it, but it seems you encountered a bug.
Except for the fact that all your code using tabs is rendered with a tab-width of 8 because thatā€™s what browsers default to. pls donā€™t use tabs

Edit: This post was a reply to a now-deleted post.

0 Likes

#16

One issueā€¦ish is that old release announcements are still closed. I guess they should be closed as soon as a new release announcement is posted. Reasoning:

  • if you have an older version of sublime, the issue might be fixed in a newer version; the main approach would be: ā€žplease update to the latest version and let us know if your problem persistā€
  • if you have a real issue with sublime, then itā€™s likely to also be present on latest build, so it should be posted there.
0 Likes

#17

Please add the ā€œSolvedā€ Discourse plugin.

Also, please split off titoā€™s posts regarding tabs and whatnot into a different topic so that we can have a thread like the API suggestions thread with on-topic suggestions and users being able to like/vote on posts.

2 Likes

#18
1 Like

#19

I revive this thread to sugges another plugin: push notification.

And do update the forum to the latest version and enable tags :slightly_smiling:

2 Likes

#20

push notifications already work on this forumā€¦

0 Likes

#21

Nope, those are desktop notification, which requires to have forum opened in a tab.

Push notifications are a different beast, which requires nothing opened. Just works (also on mobile) :slightly_smiling:

0 Likes