[vim] fix w for non ascii chars
This commit is contained in:
parent
7db217dfe0
commit
c769031e78
1 changed files with 20 additions and 10 deletions
|
|
@ -66,23 +66,25 @@ define(function(require, exports, module) {
|
|||
var d = "";
|
||||
function format(p) {
|
||||
if (typeof p != "object")
|
||||
return p + ""
|
||||
return p + "";
|
||||
if ("line" in p) {
|
||||
return p.line + ":" + p.ch
|
||||
return p.line + ":" + p.ch;
|
||||
}
|
||||
if ("anchor" in p) {
|
||||
return format(p.anchor) + "->" + format(p.head)
|
||||
return format(p.anchor) + "->" + format(p.head);
|
||||
}
|
||||
if (Array.isArray(p))
|
||||
return "[" + p.map(function(x) {return format(x)})+"]"
|
||||
return JSON.stringify(p)
|
||||
return "[" + p.map(function(x) {
|
||||
return format(x);
|
||||
}) + "]";
|
||||
return JSON.stringify(p);
|
||||
}
|
||||
for (var i = 0; i < arguments.length; i++) {
|
||||
var p = arguments[i]
|
||||
var f = format(p)
|
||||
d+= f+" "
|
||||
var p = arguments[i];
|
||||
var f = format(p);
|
||||
d += f + " ";
|
||||
}
|
||||
console.log(d)
|
||||
console.log(d);
|
||||
}
|
||||
var Range = require("../range").Range;
|
||||
var EventEmitter = require("../lib/event_emitter").EventEmitter;
|
||||
|
|
@ -94,6 +96,7 @@ define(function(require, exports, module) {
|
|||
var useragent = require("../lib/useragent");
|
||||
var SearchHighlight = require("../search_highlight").SearchHighlight;
|
||||
var multiSelectCommands = require("../commands/multi_select_commands");
|
||||
var TextModeTokenRe = require("ace/mode/text").Mode.prototype.tokenRe;
|
||||
require("../multi_select");
|
||||
|
||||
var CodeMirror = function(ace) {
|
||||
|
|
@ -157,6 +160,11 @@ define(function(require, exports, module) {
|
|||
CodeMirror.signal = function(o, name, e) { return o._signal(name, e) };
|
||||
CodeMirror.on = event.addListener;
|
||||
CodeMirror.off = event.removeListener;
|
||||
CodeMirror.isWordChar = function(ch) {
|
||||
TextModeTokenRe.lastIndex = 0;
|
||||
return TextModeTokenRe.test(ch);
|
||||
};
|
||||
|
||||
(function() {
|
||||
oop.implement(CodeMirror.prototype, EventEmitter);
|
||||
|
||||
|
|
@ -1121,7 +1129,9 @@ dom.importCssString(".normal-mode .ace_cursor{\
|
|||
}
|
||||
|
||||
var numberRegex = /[\d]/;
|
||||
var wordRegexp = [(/\w/), (/[^\w\s]/)], bigWordRegexp = [(/\S/)];
|
||||
var wordRegexp = [{test: CodeMirror.isWordChar}, {test: function(ch) {
|
||||
return !CodeMirror.isWordChar(ch) && !/\s/.test(ch);
|
||||
}}], bigWordRegexp = [(/\S/)];
|
||||
function makeKeyRange(start, size) {
|
||||
var keys = [];
|
||||
for (var i = start; i < start + size; i++) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue