Sublime Forum

Two Sublime Text X Issues

#1

I’ve found the following:

Editing Windows.sublime-keymap file won’t work, Sublime complains it got an unexpected character. I’ve noticed too that Sublime X uses Linux line ends for that file on Windows. Is that required now?

Graphical issue (see att.):

The current line’s gutter number background isn’t filled when the line’s selected. Instead, the number’s drawn inside a darker rectangle.

0 Likes

#2

The sublime-keymap files need to be strict JSON - the likely error is that you have a trailing comma at the end of a list, e.g., [1, 2, 3,], which isn’t allowed. I make this mistake all the time when editing them: I’d gladly remove this restriction, but then Python’s JSON parsing module wouldn’t accept the files, so it may not be the best long term trade-off (As an aside, I just realised I presently allow comments in JSON files, but shouldn’t - I’ll change this).

I’ll improve the error reporting of invalid JSON files for the next release: currently a nice message about which line and column the syntax error is on is generated, and then discarded, because the console isn’t up at that point to capture it.

I’ll also fix the graphical error for the next version.

0 Likes

#3

I think I got confused there. Sublime reports "got unwanted character: " in the console when I press CTRL + K or any other CTRL + key without an associated key binding. This seems to be unrelated to keymap files. Python’s console ignores this particular control character.

Then I’ve noticed the following about keymap files:

  • They must be reloaded in order to work upon changing. I’ve successfully remapped keys in the default Windows keymap file, but only after restarting Sublime.

  • Sublime won’t pick up any other Windows.sublime-keymap files I create under Packages\User. sublime.options().get(“keymap”) doesn’t provide any info, because app options don’t seem to be implemented yet, but I suppose the default keymap file name under Windows should be Windows.sublime-keymap and not Default.sublime-keymap? I’ve tried both anyway and neither of them worked for me.

And re. JSON, I’m fine with it being so strict. I laughed quite a bit when seeing Crockford’s video about the discovery of JSON. :smiley:

Cheers

0 Likes