Group Abstract Group Abstract

Message Boards Message Boards

1
|
8K Views
|
10 Replies
|
8 Total Likes
View groups...
Share
Share this post:

Disable auto-formatting of code?

Posted 9 years ago
POSTED BY: waldir anonymous
10 Replies

You might also consider Workbench: http://www.wolfram.com/workbench

POSTED BY: Vitaliy Kaurov

Yes, 'code' behaves much better with respect to 'user experience'.

With respect to the response, it does not improve the situation much. Highlight/autocomplete/indent functionality still triggers unneccesary redrawing.

POSTED BY: waldir anonymous

I have a feeling this might be because it is done using software rendering. Anyhow, you can also disable syntax highlighting in the settings:

enter image description here

I've only used it locally and there it is instantaneously. Never had a problem with it...

POSTED BY: Sander Huisman

Ah, here it is!

Yep, I was afraid of the limits of software-sided font rasterisation. Still, after disabling function highlights, movement works fine and the response is much more 'regular'.

I guess this might be considered as solved. Thanks very much!

POSTED BY: waldir anonymous

Alternatively you could also write a .m file (regular text file) and run that directly on the kernel... Then you can use any editor you like...

good luck!

POSTED BY: Sander Huisman
POSTED BY: waldir anonymous

For such a short code it should be instantaneous actually. But maybe because you use it remotely makes it awkward. The cell style is by default "Input". Try changing it to "Code". Right-click on the bracket of any cell, choose style, and then "Code".

POSTED BY: Sander Huisman

Ubuntu linux, mathematica 11.0, Intel Core i5–6500 3.20GHz with 8 GiB RAM; Ran over X forwarding (ssh with -XYC).

Example notebook: anything. E.g.,

(*helper function*)
MyJoin[l_, pts_] := 
 If[OddQ[Length[pts]], Join[l, pts], Join[l, Reverse[pts]]]

(*the algorithm itself*)

calcCasteljau[pts_, pts2_, t_] := 
 Table[pts[[i]]*(1 - t) + pts2[[i]]*t, {i, 1, Length[pts]}]
rankedCasteljau[pts_, t_, acum_] := 
 If[Length[pts] == 1, MyJoin[acum, pts], 
  rankedCasteljau[calcCasteljau[Drop[pts, -1], Drop[pts, 1], t], t, 
   MyJoin[acum, pts]]]

(*overloads for the basic casteljau algorithm-*)

casteljau[pts_, t_] := rankedCasteljau[pts, t, {}]
casteljauLast[pts_, t_] := {rankedCasteljau[pts, t, {}][[-1]]}

(*drawing functions*)

showCasteljau2[pts_, ptsOrig_] := 
 Show[ListPlot[pts, PlotMarkers -> Automatic], ListLinePlot[pts], 
  ParametricPlot[casteljauLast[ptsOrig, t], {t, 0, 1}]]
showCasteljau[pts_, t_] := showCasteljau2[casteljau[pts, t], pts]


Manipulate[
 showCasteljau[{{0, 0}, {0, 1}, {1, 1}, {1, 0}, {2, 0}, {2, 1}}, 
  t], {t, 0, 1}]

Slower response caused by the forwarding is of course anticipated. The problem is that:

  • that the entire screen is reformatted and rerenderred (with significant and anyway annoying changes) per every key stroke, which of course causes a lag when working with an X forwarded window. I want just to turn the formatting off so that it runs as smoothly as any normal text editor.

  • I do not want mathematica to tell me where my new-lines should be (e.g., any copy paste reformats the code)

POSTED BY: waldir anonymous

Have you tried the "Code" cell style?

POSTED BY: Gianluca Gorni

OS, version, example notebook, computer specs?

POSTED BY: Sander Huisman
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard