Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds option to display results as blocks #280

Merged
merged 1 commit into from
Dec 1, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions lib/package/config.coffee
Original file line number Diff line number Diff line change
@@ -51,6 +51,14 @@ config =
description: "Limits the Console history's size."
default: 10000
order: 8
resultsDisplayMode:
type: 'string'
default: 'inline'
enum: [
{value:'inline', description:'Float results next to code'}
{value:'block', description:'Display results under code'}
]
order: 10

if process.platform != 'darwin'
config.terminal =
4 changes: 2 additions & 2 deletions lib/runtime/evaluation.coffee
Original file line number Diff line number Diff line change
@@ -23,12 +23,12 @@ module.exports =
[[start], [end]] = range
@ink.highlight editor, start, end
r = null
setTimeout (=> r ?= new @ink.Result editor, [start, end]), 0.1
setTimeout (=> r ?= new @ink.Result editor, [start, end], type: atom.config.get 'julia-client.resultsDisplayMode'), 0.1
evaluate({text, line: line+1, mod, path: edpath})
.then (result) =>
error = result.type == 'error'
view = if error then result.view else result
if not r? or r.isDestroyed then r = new @ink.Result editor, [start, end]
if not r? or r.isDestroyed then r = new @ink.Result editor, [start, end], type: atom.config.get 'julia-client.resultsDisplayMode'
registerLazy = (id) ->
r.onDidDestroy client.withCurrent -> clearLazy [id]
editor.onDidDestroy client.withCurrent -> clearLazy id