aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNicholas Keene <git@nicholaskeene.com>2017-02-14 22:30:07 -0600
committerNicholas Keene <git@nicholaskeene.com>2017-02-14 22:30:07 -0600
commitc05509895208c078401b610eddf85cbc0c5e5a25 (patch)
tree6c11fa0c8c5105c61039504331ffb6fa375e3212
parent835556da9111d91b71c545d6a273e843f07631ae (diff)
downloadfirmware-c05509895208c078401b610eddf85cbc0c5e5a25.tar.gz
firmware-c05509895208c078401b610eddf85cbc0c5e5a25.tar.bz2
firmware-c05509895208c078401b610eddf85cbc0c5e5a25.zip
The Ordinary Layout now has more symbols on the Symbols layer! So useful!
-rw-r--r--keyboards/ergodox/keymaps/ordinary/ordinary-symbol.pngbin101255 -> 89582 bytes
-rw-r--r--keyboards/ergodox/keymaps/ordinary/ordinary-symbol.txt22
2 files changed, 11 insertions, 11 deletions
diff --git a/keyboards/ergodox/keymaps/ordinary/ordinary-symbol.png b/keyboards/ergodox/keymaps/ordinary/ordinary-symbol.png
index dd9086329..8cd92cee1 100644
--- a/keyboards/ergodox/keymaps/ordinary/ordinary-symbol.png
+++ b/keyboards/ergodox/keymaps/ordinary/ordinary-symbol.png
Binary files differ
diff --git a/keyboards/ergodox/keymaps/ordinary/ordinary-symbol.txt b/keyboards/ergodox/keymaps/ordinary/ordinary-symbol.txt
index 001bf370d..f64503ecb 100644
--- a/keyboards/ergodox/keymaps/ordinary/ordinary-symbol.txt
+++ b/keyboards/ergodox/keymaps/ordinary/ordinary-symbol.txt
@@ -10,18 +10,18 @@
[{y:-0.875,x:2.5,c:"#bbddbb"},"$",{x:1},")",{x:8.5,c:"#89b087"},"4",{x:1},"6"],
[{y:-0.875,x:5.5,c:"#bbddbb"},"`",{x:6.5},"/"],
[{y:-0.875,c:"#000000",t:"#007d00",w:1.5},"Symbols\n\n\n\n\n\nShift",{c:"#bbddbb",t:"#000000"},"#",{x:14.5,c:"#89b087"},"*",{c:"#000000",t:"#007d00",w:1.5},"\n\nSymbols\n\n\n\n\nShift"],
-[{y:-0.625,x:6.5,c:"#ff8500",t:"#000000",fa:[0,0,0,1],h:1.5},"Tab >\n\n\nTab",{x:4.5,h:1.5},"< Tab\n\n\nShift Tab"],
-[{y:-0.75,x:3.5,c:"#bbddbb"},"[",{x:10.5,c:"#89b087"},"2"],
+[{y:-0.625,x:6.5,c:"#bbddbb",t:"#000000",a:6,h:1.5},"'",{x:4.5,h:1.5},"\""],
+[{y:-0.75,x:3.5,a:4},"[",{x:10.5,c:"#89b087"},"2"],
[{y:-0.875,x:2.5,c:"#bbddbb"},"^",{x:1},"]",{x:8.5,c:"#89b087"},"1",{x:1},"3"],
[{y:-0.875,x:5.5,c:"#bbddbb"},"~",{x:6.5},"\\"],
[{y:-0.875,c:"#c6c600",t:"#9e0000",w:1.5},"Capitals\n\n\n\n\n\nShift",{c:"#bbddbb",t:"#000000"},"%",{x:14.5,c:"#89b087"},"-",{c:"#c6c600",t:"#9e0000",w:1.5},"\n\nCapitals\n\n\n\n\nShift"],
-[{y:-0.375,x:3.5,c:"#dddd77",t:"#000000"},"Option\n\n\nLAlt",{x:10.5,c:"#89b087"},"."],
-[{y:-0.875,x:2.5,c:"#dddd77"},"Hyper",{x:1},"Cmd\n\n\nSuper",{x:8.5,c:"#89b087"},"0",{x:1},"="],
-[{y:-0.75,x:0.5,c:"#dddd77"},"Ctrl\n\n\nLCtrl","Meh",{x:14.5,c:"#89b087"},"+","Enter"],
-[{r:30,rx:6.5,ry:4.25,y:-1,x:1,c:"#ff8500"},"Left","Right"],
-[{h:2},"Space",{h:2},"Enter","Up"],
-[{x:2},"Down"],
-[{r:-30,rx:13,y:-1,x:-3},"Home","End"],
-[{x:-3},"Page\n\n\n\n\n\nUp",{h:2},"< Del\n\n\nBackspace",{h:2},"Del >\n\n\nDelete"],
-[{x:-3},"Page\n\n\n\n\n\nDown"]
+[{y:-0.375,x:3.5,c:"#bbddbb",t:"#000000"},"<",{x:10.5,c:"#89b087"},"."],
+[{y:-0.875,x:2.5,c:"#bbddbb"},"*",{x:1,a:5},">",{x:8.5,c:"#89b087",a:4},"0",{x:1},"="],
+[{y:-0.75,x:0.5,c:"#bbddbb"},";","&",{x:14.5,c:"#89b087"},"+","Enter"],
+[{r:30,rx:6.5,ry:4.25,y:-1,x:1,c:"#737373",a:7},"",""],
+[{c:"#bbddbb",h:2},"+",{h:2},"=",{c:"#737373"},""],
+[{x:2,c:"#bbddbb"},"!="],
+[{r:-30,rx:13,y:-1,x:-3,c:"#737373"},"",""],
+[{x:-3},"",{c:"#bbddbb",h:2},"_",{h:2},"-"],
+[{x:-3},"->"]
href='#n236'>236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530
--  Edition of a files_map buffer.
--  Copyright (C) 2018 Tristan Gingold
--
--  This program is free software: you can redistribute it and/or modify
--  it under the terms of the GNU General Public License as published by
--  the Free Software Foundation, either version 2 of the License, or
--  (at your option) any later version.
--
--  This program is distributed in the hope that it will be useful,
--  but WITHOUT ANY WARRANTY; without even the implied warranty of
--  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
--  GNU General Public License for more details.
--
--  You should have received a copy of the GNU General Public License
--  along with this program.  If not, see <gnu.org/licenses>.

with Logging; use Logging;

package body Files_Map.Editor is
   --  Count the length of newlines at position P in TEXT.
   --  Result can be:
   --    1 for (LF, CR)
   --    2 for (LF+CR or CR+LF),
   --    0 for non-newlines.
   function Is_Newline (Text : File_Buffer; P : Source_Ptr) return Natural is
   begin
      if Text (P) = ASCII.CR then
         if P < Text'Last and then Text (P + 1) = ASCII.LF then
            return 2;
         else
            return 1;
         end if;
      elsif Text (P) = ASCII.LF then
         if P < Text'Last and then Text (P + 1) = ASCII.CR then
            return 2;
         else
            return 1;
         end if;
      else
         return 0;
      end if;
   end Is_Newline;

   procedure Compute_Lines (File : Source_File_Entry)
   is
      pragma Assert (File <= Source_Files.Last);
      F : Source_File_Record renames Source_Files.Table (File);
      L : Positive;
      P : Source_Ptr;
      Nl : Natural;
   begin
      Lines_Tables.Init (F.Lines, Lines_Table_Init);

      L := 1;
      P := Source_Ptr_Org;
      Main_Loop: loop
         File_Add_Line_Number (File, L, P);
         exit Main_Loop when P = F.File_Length;

         loop
            Nl := Is_Newline (F.Source.all, P);
            if Nl = 0 then
               P := P + 1;
            else
               P := P + Source_Ptr (Nl);
               exit;
            end if;
            exit Main_Loop when P = F.File_Length;
         end loop;

         Skip_Gap (File, P);

         L := L + 1;
      end loop Main_Loop;
   end Compute_Lines;

   procedure Check_Buffer_Lines (File : Source_File_Entry)
   is
      pragma Assert (File <= Source_Files.Last);
      F : Source_File_Record renames Source_Files.Table (File);
      L : Positive;
      P : Source_Ptr;
      Nl : Natural;
   begin
      --  Check File_Length.
      P := F.File_Length;
      if P >= Get_Buffer_Length (File) then
         Log_Line ("invalid file length");
      end if;
      if F.Source (P) /= EOT or else F.Source (P + 1) /= EOT then
         Log_Line ("missing EOT at end of buffer");
      end if;

      L := 1;
      P := Source_Ptr_Org;
      Main_Loop: loop
         if F.Lines.Table (L) /= P then
            Log_Line ("offset mismatch for line" & Natural'Image (L));
         end if;

         exit Main_Loop when P = F.File_Length;

         --  Skip until eol.
         loop
            Nl := Is_Newline (F.Source.all, P);
            if Nl = 0 then
               P := P + 1;
            else
               P := P + Source_Ptr (Nl);
               exit;
            end if;
            exit Main_Loop when P = F.File_Length;
         end loop;

         Skip_Gap (File, P);

         L := L + 1;
      end loop Main_Loop;

      if Lines_Tables.Last (F.Lines) /= L then
         Log_Line ("incorrect number of lines");
      end if;

      if F.Lines.Table (F.Cache_Line) /= F.Cache_Pos then
         Log_Line ("incorrect position of cache line");
      end if;
   end Check_Buffer_Lines;

   --  Compute the number of character in FILE between [START_POS; END_POS)
   function Get_Range_Length (File : Source_File_Entry;
                              Start_Pos : Source_Ptr;
                              End_Pos : Source_Ptr) return Source_Ptr
   is
      pragma Assert (File <= Source_Files.Last);
      F : Source_File_Record renames Source_Files.Table (File);
      Res : Source_Ptr;
   begin
      pragma Assert (End_Pos >= Start_Pos);
      pragma Assert (End_Pos <= F.File_Length);
      Res := End_Pos - Start_Pos;

      --  Returns now if the gap is outside the range.
      if F.Gap_Last < Start_Pos or else F.Gap_Start >= End_Pos then
         return Res;
      end if;

      --  Check the gap is completly within the range.
      if F.Gap_Last > End_Pos or else F.Gap_Start <= Start_Pos then
         raise Internal_Error;
      end if;

      return Res - (F.Gap_Last - F.Gap_Start + 1);