mirror of
https://github.com/paradoxxxzero/butterfly.git
synced 2026-05-26 07:08:08 +00:00
Better nbsp handling: visual nbsp + selection tools now paste space instead of nbsp if it was originally a space
This commit is contained in:
@@ -14,7 +14,7 @@
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
__version__ = '1.5.9'
|
||||
__version__ = '1.5.10'
|
||||
|
||||
|
||||
import os
|
||||
|
||||
@@ -38,3 +38,6 @@ $bg: #000 !default
|
||||
.blur .cursor.reverse-video
|
||||
background: none
|
||||
|
||||
.nbsp
|
||||
@extend .underline
|
||||
@extend .fg-color-1
|
||||
|
||||
@@ -135,7 +135,7 @@
|
||||
};
|
||||
|
||||
Selection.prototype.text = function() {
|
||||
return this.selection.toString();
|
||||
return this.selection.toString().replace(/\u00A0/g, ' ').replace(/\u2007/, ' ');
|
||||
};
|
||||
|
||||
Selection.prototype.up = function() {
|
||||
|
||||
4
butterfly/static/ext.min.js
vendored
4
butterfly/static/ext.min.js
vendored
File diff suppressed because one or more lines are too long
@@ -186,10 +186,10 @@ html, body {
|
||||
.bg-color-1.reverse-video {
|
||||
color: #cc0000 !important; }
|
||||
|
||||
.fg-color-1 {
|
||||
.fg-color-1, .nbsp {
|
||||
color: #cc0000;
|
||||
text-shadow: 0 0 6px rgba(204, 0, 0, 0.5); }
|
||||
.fg-color-1.reverse-video {
|
||||
.fg-color-1.reverse-video, .reverse-video.nbsp {
|
||||
background-color: #cc0000 !important; }
|
||||
|
||||
.bg-color-2 {
|
||||
@@ -3058,7 +3058,7 @@ html, body {
|
||||
.bold {
|
||||
font-weight: bold; }
|
||||
|
||||
.underline {
|
||||
.underline, .nbsp {
|
||||
text-decoration: underline; }
|
||||
|
||||
.blink {
|
||||
@@ -3073,3 +3073,4 @@ html, body {
|
||||
|
||||
.blur .cursor.reverse-video {
|
||||
background: none; }
|
||||
|
||||
|
||||
@@ -526,7 +526,9 @@
|
||||
out += ">";
|
||||
break;
|
||||
default:
|
||||
if (ch <= " ") {
|
||||
if (ch === " ") {
|
||||
out += '<span class="nbsp">\u2007</span>';
|
||||
} else if (ch <= " ") {
|
||||
out += " ";
|
||||
} else {
|
||||
if (("\uff00" < ch && ch < "\uffef")) {
|
||||
|
||||
4
butterfly/static/main.min.js
vendored
4
butterfly/static/main.min.js
vendored
File diff suppressed because one or more lines are too long
@@ -78,7 +78,7 @@ class Selection
|
||||
@clear()
|
||||
|
||||
text: ->
|
||||
@selection.toString()
|
||||
@selection.toString().replace(/\u00A0/g, ' ').replace(/\u2007/, ' ')
|
||||
|
||||
up: ->
|
||||
@go -1
|
||||
|
||||
@@ -453,7 +453,9 @@ class Terminal
|
||||
when ">"
|
||||
out += ">"
|
||||
else
|
||||
if ch <= " "
|
||||
if ch == " "
|
||||
out += '<span class="nbsp">\u2007</span>'
|
||||
else if ch <= " "
|
||||
out += " "
|
||||
else
|
||||
i++ if "\uff00" < ch < "\uffef"
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "butterfly",
|
||||
"version": "1.5.5",
|
||||
"version": "1.5.10",
|
||||
"description": "A sleek web based terminal emulator",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
|
||||
Reference in New Issue
Block a user