Commit Graph

1556 Commits

Author SHA1 Message Date
Nathan Sobo
031da13316 Remove unused methods from native OnigRegExp
`OnigScanner` takes over these duties
2012-10-25 12:23:37 -06:00
Nathan Sobo
b1e8e2391f Merge branch 'paste-indentation' 2012-10-25 10:50:05 -06:00
Nathan Sobo
e53410b5fd Add indentBasis metadata to pasteboard when copying text
This allows indent to be normalized properly even if the leading whitespace isn't copied from the first line.
2012-10-25 10:44:54 -06:00
Corey Johnson & Nathan Sobo
6f353fda62 Add indentBasis option to insertText
We will use this to normalize indentation on paste even when we didn't copy all the leading whitespace on the first line.
2012-10-24 18:29:09 -06:00
Nathan Sobo
fd4b6c85ce Add a global pasteboard object which supports metadata
This metadata will be used to record the indentation level of the first line when copying multiple lines of text to the pasteboard. The pasteboard takes the md5 of the pasted content when writing, then when reading it associates the last written metadata only when the signature matches the previously written value.
2012-10-24 17:42:58 -06:00
Corey Johnson
e02b8f8eec Add support for brackets with the same begin/end character 2012-10-24 14:24:19 -07:00
Corey Johnson
ebbb39f50e Improve brackets auto closing.
When an open bracket is inserted, an anchorRange is created. When a closing bracket is inserted, and its position matches the end of one of the anchorRanges, the closing bracket is not inserted and the cursor moves right.
2012-10-24 14:24:19 -07:00
Nathan Sobo
ee09c20214 Merge branch 'master' into paste-indentation 2012-10-24 12:37:50 -06:00
Nathan Sobo
ca2527f4b8 Meta-w closes spec windows again.
This adds a 'core:close' event to meta-w in the default bindings, and modifies window to listen for it.
2012-10-24 12:35:31 -06:00
Nathan Sobo
b71fa308a3 Always run window.startup when window.coffee is required
When we actually want to attach the root view in window-bootstrap.coffee, we call `window.attachRootView(path)` instead of calling `window.startup(path)`. Having `startup` called automatically means we can be sure any code we add there runs in every environment (including benchmark and specs). This is where we do things like setup the global keymap, parse text mate bundles and themes, and establish the window close handler. Any globals other than the root view that we want to be available in all environments should be established here. Right now that's just the keymap, but soon I want to add a global pasteboard.
2012-10-24 12:34:45 -06:00
Kevin Sawicki
48bdc75359 Send remaining stdout/stderr output to callbacks
Previously this data was only sent to the done
handlers and so commands such as SelectAllMatchesInProject
were not displaying all the results when the result size
was large.
2012-10-23 21:27:17 -07:00
Nathan Sobo
937caf8400 Un-F 2012-10-23 17:17:28 -06:00
Nathan Sobo
4d9b777350 Fix LanguageMode.proto.suggestedIndentationForBufferRow exception for row 0 2012-10-23 16:50:00 -06:00
Nathan Sobo
d1999b91ff Base first line delta on the cursor column, not the existing line's indent 2012-10-23 16:30:38 -06:00
Nathan Sobo
839d57d819 Use existing line's indentation level if inserting normalized lines within it
If we're pasting multiple lines starting inside an already existing line, we never want to auto indent. We should just take its existing indentation level. Also, we strip the leading whitespace off the first line we're inserting, assuming it's already being represented by the indentation of the line we're onto which we're appending it.
2012-10-23 16:17:26 -06:00
Nathan Sobo
3b18c6a42d With autoIndent disabled, don't use suggested first line indent when normalizing
Also, when some lines are *less* indented than the first line, it might not be possible to outdent them as far as they originally were relative to the first line, so we do as much as possible.
2012-10-23 14:27:26 -06:00
Corey Johnson
8f4ec3c45e Fix command panel specs 2012-10-23 13:21:35 -07:00
Corey Johnson
ae7264ad12 Fix autocomplete specs 2012-10-23 13:21:35 -07:00
Corey Johnson
e20832aa50 Tree View uses core:close core:confirm core:cancel and adds tool-pane:unfocus 2012-10-23 13:21:34 -07:00
Corey Johnson
8e417631e3 Markdown Preview uses core:cancel and markdown-preview:toggle 2012-10-23 13:21:34 -07:00
Corey Johnson
421731c6a0 Command Panel uses core:close, core:cancel and core:confirm 2012-10-23 13:21:34 -07:00
Corey Johnson
d0e1ee255c Autocomplete extension uses core:confirm and core:cancel 2012-10-23 13:21:33 -07:00
Nathan Sobo
7bd4e8801f If inserting on a line that is longer than the suggested indent, preserve indent 2012-10-23 14:13:51 -06:00
Nathan Sobo
0e5c76b474 Start adding the normalizeIndent option to EditSession.proto.insertText
This will be used by the paste command to ensure that indentation is normalized.
2012-10-23 14:07:00 -06:00
Nathan Sobo
7be3c55765 Only auto-indent when typing, not when pasting or programmatically inserting
This paves the way for using a different strategy to normalize indentation when pasting, without it getting tangled in auto-indent.
2012-10-23 11:59:54 -06:00
Kevin Sawicki
ab8c22825c Support outdenting when indent is < 1 tab length 2012-10-23 09:57:39 -07:00
Nathan Sobo
518d88a4ab Fix spec breakage caused by a styling change 2012-10-23 10:46:38 -06:00
Corey Johnson & Nathan Sobo
fcbbe0a29b Do not use cached results for regexes that contain \G. 2012-10-22 11:04:20 -07:00
Corey Johnson & Nathan Sobo
9bf16063fc Un-F 2012-10-19 12:58:42 -06:00
Corey Johnson & Nathan Sobo
9303aaa8fd Rename root-view: event prefix to window: 2012-10-19 12:51:36 -06:00
Corey Johnson & Nathan Sobo
84b2cabeb3 Calling .abortKeyBinding on an event that wasn't triggered by the keymap is ok
Certain events call `abortKeyBinding` to opt out of handling certain keybindings. Snippets does this with tab for example. If it's not a situation where it's appropriate to go to the next tab stop, we let the next binding be triggered, which could insert a tab, for example. But when we trigger events from the event palette, there *is* no next binding. Having a no-op function helps in this situation.
2012-10-19 12:42:27 -06:00
Corey Johnson & Nathan Sobo
d420585b11 Display keybindings in EventPalette. Style a bit. 2012-10-19 12:02:00 -06:00
Corey Johnson & Nathan Sobo
de3bbce29f Only show events w/ descriptions in EventPalette
Also, auto-generate human readable event name in editor. This is a good example of how we could do this automatically for some kind of `onCommand`, `command`, `onInteractiveEvent` method that combines the event name, documentation string, and handler in one shot.
2012-10-19 11:24:40 -06:00
Nathan Sobo
2b8c946a65 Merge branch 'master' into event-palette
Conflicts:
	spec/extensions/fuzzy-finder-spec.coffee
	src/extensions/fuzzy-finder/fuzzy-finder.coffee
2012-10-18 16:33:44 -06:00
Corey Johnson & Nathan Sobo
93cbe2bb22 Create root-view:toggle-invisibles event 2012-10-18 14:44:21 -07:00
Corey Johnson & Nathan Sobo
a72d0399f7 Add Editor.setShowInvisibles and remove showInvisibles from EditSession 2012-10-18 14:10:36 -07:00
Corey Johnson & Nathan Sobo
b33bbbfc0d Handle invisible character rendering when building HTML for lines.
Not during creation of tokens.
2012-10-18 11:43:17 -07:00
Corey Johnson
53534e61cf Remove double comment 2012-10-18 11:33:19 -07:00
Corey Johnson
c9db576a1c Fix specs 2012-10-18 11:33:19 -07:00
Corey Johnson
22e009a999 Set invisible values for spaces and tabs when initial tokenization occurs.
Also break whitespace into its own token just like tabs.
2012-10-18 11:33:19 -07:00
Corey Johnson
4478bbca9a When project.showInvisibles is true; spaces, tabs and newlines are visible 2012-10-18 11:31:39 -07:00
Corey Johnson
e2a917fcf3 Change tabText to tabLength 2012-10-18 11:31:39 -07:00
Corey Johnson & Nathan Sobo
4987ea3e49 If a TextMate syntax/preference fails to parse, catch error and log warning 2012-10-17 13:53:55 -07:00
Corey Johnson
6171ea33e1 Add support for TextMate grammars with newlines in their regexes 2012-10-16 15:58:11 -07:00
Corey Johnson
de03cc82ed fs.traversePath(path) works if path is a symlink 2012-10-12 15:44:01 -07:00
Corey Johnson
5b92de76fc 💄 2012-10-12 15:44:00 -07:00
Kevin Sawicki
6551be0c85 Update the buffer being used when the editor path changes
Previously the status indicator would only work for the first
buffer open since only the buffer used when the extension was
initialized was subscribed to for change events.
2012-10-12 15:39:52 -07:00
Kevin Sawicki
0da869589e Use change event instead of buffer-change event
This will update the modified indicator after operations
are undone
2012-10-12 15:08:01 -07:00
Kevin Sawicki
19aa192c47 Return paths instead of deferred from project.getFilePaths
It was already being performed synchronously
2012-10-12 14:45:18 -07:00
Kevin Sawicki
38802ba287 Use javscript.tmbundle commit 2f95d9ae92
The commit after this one breaks syntax highlighting
for the lines after a single line comment
2012-10-12 11:34:44 -07:00