Permalink
Browse files

README: described hotkeys for next/prev errors; Fixed insert type com…

…mand
  • Loading branch information...
1 parent 23b6405 commit fb6e16ccebd78436b39924b9061f443891f2c0a8 @mvoidex mvoidex committed Apr 13, 2013
Showing with 17 additions and 20 deletions.
  1. +5 −0 Default.sublime-commands
  2. +6 −16 README.md
  3. +6 −4 haskell_type.py
View
@@ -104,5 +104,10 @@
{
"caption": "SublimeHaskell: Go to previous error",
"command": "sublime_haskell_previous_error"
+ },
+ {
+ "caption": "SublimeHaskell: Show error panel",
+ "command": "show_panel",
+ "args": { "panel": "output.haskell_error_checker" }
}
]
View
@@ -36,26 +36,16 @@ To use cabal-dev instead of cabal, set use_cabal_dev to true (or use command "Sw
Stylish-haskell can be used to stylish file or selected text.
-Use Ctrl-Shift-R to go to declaration and Ctrl-K-I to show symbol info with documentation. These command are also available through context menu with right-click.
+Use `Ctrl-Shift-R` to go to declaration and `Ctrl-K-I` to show symbol info with documentation. These command are also available through context menu with right-click.
Command 'SublimeHaskell: Browse module' is similar to ghci's browse command
-Keybindings
------------
-You can add key bindings for type inference to `Key Bindings - User`:
+To show inferred types use `Show type` (`ctrl-k ctrl-h ctrl-t`) command.
-```json
- {
- "command": "haskell_show_type",
- "context": "source.haskell",
- "keys": ["ctrl+k", "ctrl+h", "ctrl+t"]
- },
- {
- "command": "haskell_insert_type",
- "context": "source.haskell",
- "keys": ["ctrl+k", "ctrl+h", "ctrl+i"]
- }
-```
+To insert inferred type use `Insert type` (`ctrl-k ctrl-h ctrl-i`).
+
+You can jump between the errors and warnings with `Go to next error` (`alt-d, alt-e`) and `Go to previous error` (`shift-alt-d shift-alt-e`).
+To show hidden error output, use command `Show error panel` (`ctrl-alt-e`)
hdevtools as a Build System
---------------------------
View
@@ -188,7 +188,9 @@ def run(self, edit):
result = self.get_best_type(self.get_types())
if result:
r = result.region(self.view)
- line_begin = view.line(r).begin()
- indent_region = sublime.Region(line_begin, r.begin())
- signature = '{0}{1} :: {2}\n'.format(view.substr(indent_region), result.substr(self.view), result.typename)
- view.insert(edit, line_begin, signature)
+ name = self.view.substr(self.view.word(r.begin()))
+ line_begin = self.view.line(r).begin()
+ prefix = self.view.substr(sublime.Region(line_begin, r.begin()))
+ indent = re.search('(?P<indent>\s*)', prefix).group('indent')
+ signature = '{0}{1} :: {2}\n'.format(indent, name, result.typename)
+ self.view.insert(edit, line_begin, signature)

0 comments on commit fb6e16c

Please sign in to comment.