Permalink
Browse files

-webkit-user-modify: read-write-plaintext-only instead of contentEdit…

…able=true
  • Loading branch information...
1 parent b62c186 commit ee447f3aad6af362c52506f310097844995f66ac @TiarkRompf committed Oct 8, 2010
Showing with 9 additions and 3 deletions.
  1. +6 −2 src/main/scala/ReplServlet.scala
  2. +3 −1 src/main/webapp/index.html
@@ -79,8 +79,12 @@ class ReplServlet extends WebSocketServlet {
if (ipos <= source.length) {
val tokens = source.substring(0,ipos).split("""[\ \,\;\(\)\{\}]""") // could tokenize on client
//println("try to complete: " + tokens.mkString(","))
- val cmpl = completion.topLevelFor(Parsed.dotted(tokens.last, ipos) withVerbosity 4) // (?)
- out.println("<completion>:"+ipos+"\n"+cmpl.mkString("\n"))
+ if (!tokens.isEmpty) {
+ val cmpl = completion.topLevelFor(Parsed.dotted(tokens.last, ipos) withVerbosity 4) // (?)
+ out.println("<completion>:"+ipos+"\n"+cmpl.mkString("\n"))
+ } else {
+ out.println("<completion>:"+ipos+"\n")
+ }
} else {
out.println("<completion>:"+ipos+"\n")
}
@@ -9,6 +9,8 @@
}
.input {
margin-left: 8ex;
+ -webkit-user-modify: read-write-plaintext-only;
+ -moz-user-modify: read-write-plaintext-only;
}
.output {
}
@@ -301,7 +303,7 @@
function newBox(after) {
var box = $('<div class="box">'+
- ' <div class="runIn"><span class="prompt">scala&gt</span><span class="buttons"><span class="remove">-</span>&nbsp;<span class="add">+</span></span></div><pre class="input" contenteditable="true">'+settings.inputDefault+'</pre>'+
+ ' <div class="runIn"><span class="prompt">scala&gt</span><span class="buttons"><span class="remove">-</span>&nbsp;<span class="add">+</span></span></div><pre class="input">'+settings.inputDefault+'</pre>'+
' <pre class="completions"></pre>'+
' <pre class="output"></pre>'+
'</div>')

0 comments on commit ee447f3

Please sign in to comment.