##// END OF EJS Templates
Fix #4777 and #7887...
Fix #4777 and #7887 The function in charge of actually converting cursor offset to CodeMirror line number and character number was actually crashing when the cursor was at the last character (loop until undefined, then access length of variable, which is undefined). This was hiding a bug in which when you would completer to a single completion pressing tab after as-you-type filtering, the completion would be completed twice. The logic that was supposed to detect whether or not all completions had a common prefix was actually faulty as the common prefix used to be a string but was then changed to an object. Hence the logic to check whether or not there was actually a common prefix was always true, even for empty string, leading to the deletion of the line (replace by '') in some cases.

File last commit:

r19841:217be004
r20538:ae7f6d6a
Show More
terminal.html
64 lines | 1.2 KiB | text/html | HtmlLexer
{% extends "page.html" %}
{% block title %}{{page_title}}{% endblock %}
{% block bodyclasses %}terminal-app {{super()}}{% endblock %}
{% block params %}
data-base-url="{{base_url}}"
data-ws-path="{{ws_path}}"
{% endblock %}
{% block stylesheet %}
{{super()}}
<link rel="stylesheet" href="{{ static_url("terminal/css/override.css") }}" type="text/css" />
{% endblock %}
{% block site %}
<div id="terminado-container" class="container"></div>
{% endblock %}
{% block script %}
<!-- Hack: this needs to be outside the display:none block, so we can measure
its size in JS in setting up the page. It is still invisible. Putting in
the script block gets it outside the initially undisplayed region. -->
<!-- test size: 25x80 -->
<div style='position:absolute; left:-1000em'>
<pre id="dummy-screen" style="border: solid 5px white;" class="terminal">0
1
2
3
4
5
6
7
8
9
0
1
2
3
4
5
6
7
8
9
0
1
2
3
<span id="dummy-screen-rows" style="">01234567890123456789012345678901234567890123456789012345678901234567890123456789</span>
</pre>
</div>
{{super()}}
<script src="{{ static_url("terminal/js/main.js") }}" type="text/javascript" charset="utf-8"></script>
{% endblock %}