├── .gitignore ├── .vscode ├── launch.json ├── settings.json └── tasks.json ├── .vscodeignore ├── LICENSE ├── README.md ├── Screen Shot 2018-05-07 at 11.41.35 PM.png ├── dist ├── index.js └── index.map ├── icon.png ├── index.js ├── package-lock.json └── package.json /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | .DS_Store 3 | .cache -------------------------------------------------------------------------------- /.vscode/launch.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": "0.2.0", 3 | "configurations": [ 4 | { 5 | "name": "Launch Extension", 6 | "type": "extensionHost", 7 | "request": "launch", 8 | "runtimeExecutable": "${execPath}", 9 | "args": ["--extensionDevelopmentPath=${workspaceRoot}" ], 10 | "stopOnEntry": false, 11 | "sourceMaps": true, 12 | "outFiles": [ "${workspaceRoot}/out/**/*.js" ], 13 | "preLaunchTask": "npm: watch" 14 | } 15 | ] 16 | } -------------------------------------------------------------------------------- /.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "favorites.sortDirection": "ASC", 3 | "favorites.groupsFirst": true 4 | } -------------------------------------------------------------------------------- /.vscode/tasks.json: -------------------------------------------------------------------------------- 1 | // See https://go.microsoft.com/fwlink/?LinkId=733558 2 | // for the documentation about the tasks.json format 3 | { 4 | "version": "2.0.0", 5 | "tasks": [ 6 | { 7 | "type": "npm", 8 | "script": "watch", 9 | "problemMatcher": "$tsc-watch", 10 | "isBackground": true, 11 | "presentation": { 12 | "reveal": "never" 13 | }, 14 | "group": { 15 | "kind": "build", 16 | "isDefault": true 17 | } 18 | } 19 | ] 20 | } -------------------------------------------------------------------------------- /.vscodeignore: -------------------------------------------------------------------------------- 1 | .vscode/** 2 | typings/** 3 | **/*.ts 4 | **/*.map 5 | .gitignore 6 | tsconfig.json 7 | vsc-extension-quickstart.md 8 | node_modules 9 | .cache 10 | node_modules/ 11 | .cache/ -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2022 Jeff Hykin 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # What is this? 2 | This shows newline (technically end-of-line) characters, similar to Atom or Notepad++. There's also the option to show some line endings with an error-color if you want to avoid a particular kind of line ending. 3 | 4 | # How do I use it? 5 | Just install it, open a file, and make sure you have the `renderWhitespace` setting enabled in VS Code (toggle it with the "Toggle Render Whitespace" command in the command pallet). If you don't want spaces to be displayed, use the "Toggle (Show/Hide) Line Endings" command instead of "Toggle Render Whitespace". (You'll also want to add `"code-eol.toggleWithWhiteSpace": false,` to your settings file encase you later decide to enable `renderWhitespace`) 6 | 7 | # Its not working! (Even after toggling) 8 | Some themes have a transparent (or 99% transparent) whitespace color, so the endings might be colored... they're just colored invisble. You can manually override that theme-color by putting this in your settings: 9 | ``` 10 | "workbench.colorCustomizations": { 11 | "editorWhitespace.foreground": "#d1d41b" // whatever hex color you want 12 | }, 13 | ``` 14 | You can also manually override this extension by adding this to your settings 15 | ``` 16 | "code-eol.style": { 17 | "color" : "#d1d41b", // whatever hex color you want 18 | "opacity" : 1.0 19 | }, 20 | ``` 21 | If its still not working, then please let me know by creating new issue on GitHub here: https://github.com/jeff-hykin/code-eol 22 | 23 | # What can I customize? (Settings) 24 | You can customize the color, opacity, which character is used for each kind of end-of-line, and a few other things.
25 | Settings Example: 26 | ``` 27 | "code-eol.style": { 28 | "color" : "#2a3f47", 29 | "opacity" : 1.0 30 | // there are more settings that can go in here 31 | // see "ThemableDecorationAttachmentRenderOptions" on https://goo.gl/SYzyg8 32 | }, 33 | "code-eol.toggleWithWhiteSpace": true, 34 | // "code-eol.validLineEnding": "LF" , // (optional) this makes "CRLF" endings render as error-color 35 | // "code-eol.validLineEnding": "CRLF", // (optional) this makes "LF" endings render as error-color 36 | "code-eol.newlineCharacter":"¬", 37 | "code-eol.returnCharacter" :"⇠", 38 | "code-eol.crlfCharacter" :"↵", 39 | "code-eol.newlineCharacterStyle" : { 40 | "color": "#2a3f47", 41 | "opacity": 0.9 42 | }, 43 | "code-eol.returnCharacterStyle" : { 44 | "color": "#2a3f47", 45 | "opacity": 0.9 46 | }, 47 | "code-eol.crlfCharacterStyle" : { 48 | "color": "#2a3f47", 49 | "opacity": 0.9 50 | }, 51 | // some other symbols you might want to use: 52 | // ¤ 53 | // ↓ 54 | // ← 55 | // ↙ 56 | // ⇣ 57 | // ⇠ 58 | // ⇓ 59 | // ⇐ 60 | // ▼ 61 | // ◀ 62 | // ␤ 63 | // ¶ 64 | // ↲ 65 | // ↩ 66 | // ↴ 67 | // ⬎ 68 | // ⇂ 69 | // see more at https://unicode-table.com/en/sets/arrows-symbols/ 70 | ``` 71 | 72 | 73 | # Can I toggle line endings with a keybinding? 74 | Yes! By default the line endings are toggled along with the "show whitespace" setting. There is also a command (with no default keybinding) called "Toggle (Show/Hide) Line Endings" that you can use from the command pallet, and you can add a keybinding that maps to it. That command will manually toggle line endings independently of the show whitespace setting. 75 | 76 | # You programmed this yourself? 77 | Nope, the only reason this exists is because its updated/improved fork of https://github.com/sohamkamani/code-eol 78 | The majority of the credit should go to them, I added all the customizations, but I couldn't have done the core myself. 79 | 80 | # What does this fork improve? 81 | This fork: 82 | 1. Fixes the character bounce issue when typing at the end of a line 83 | 2. Lets you customize color and character choice 84 | 3. Improves performance 85 | 4. Adds more comments/documentation 86 | 5. Adds toggle command for turning visible line endings on/off 87 | 6. Uses the default colors of your theme 88 | 89 | # What if there is a problem with the extension? 90 | Then post a bug/feature request!
91 | (to do that just create an issue on github: https://github.com/jeff-hykin/code-eol)
92 | The opacity setting, character-specific styles, and the toggle command were created because people on GitHub asked.
93 | NOTE: It might take me awhile to repond on GitHub (I only maintain this in my free time), but I will respond. 94 | -------------------------------------------------------------------------------- /Screen Shot 2018-05-07 at 11.41.35 PM.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jeff-hykin/code-eol/a7ea2fe92237f1b19000dd0a45dd61227ffa64ce/Screen Shot 2018-05-07 at 11.41.35 PM.png -------------------------------------------------------------------------------- /dist/index.js: -------------------------------------------------------------------------------- 1 | process.env.HMR_PORT=53263;process.env.HMR_HOSTNAME="localhost";// modules are defined as an array 2 | // [ module function, map of requires ] 3 | // 4 | // map of requires is short require name -> numeric require 5 | // 6 | // anything defined in a previous bundle is accessed via the 7 | // orig method which is the require for previous bundles 8 | 9 | // eslint-disable-next-line no-global-assign 10 | parcelRequire = (function (modules, cache, entry, globalName) { 11 | // Save the require from previous bundle to this closure if any 12 | var previousRequire = typeof parcelRequire === 'function' && parcelRequire; 13 | var nodeRequire = typeof require === 'function' && require; 14 | 15 | function newRequire(name, jumped) { 16 | if (!cache[name]) { 17 | if (!modules[name]) { 18 | // if we cannot find the module within our internal map or 19 | // cache jump to the current global require ie. the last bundle 20 | // that was added to the page. 21 | var currentRequire = typeof parcelRequire === 'function' && parcelRequire; 22 | if (!jumped && currentRequire) { 23 | return currentRequire(name, true); 24 | } 25 | 26 | // If there are other bundles on this page the require from the 27 | // previous one is saved to 'previousRequire'. Repeat this as 28 | // many times as there are bundles until the module is found or 29 | // we exhaust the require chain. 30 | if (previousRequire) { 31 | return previousRequire(name, true); 32 | } 33 | 34 | // Try the node require function if it exists. 35 | if (nodeRequire && typeof name === 'string') { 36 | return nodeRequire(name); 37 | } 38 | 39 | var err = new Error('Cannot find module \'' + name + '\''); 40 | err.code = 'MODULE_NOT_FOUND'; 41 | throw err; 42 | } 43 | 44 | localRequire.resolve = resolve; 45 | localRequire.cache = {}; 46 | 47 | var module = cache[name] = new newRequire.Module(name); 48 | 49 | modules[name][0].call(module.exports, localRequire, module, module.exports, this); 50 | } 51 | 52 | return cache[name].exports; 53 | 54 | function localRequire(x){ 55 | return newRequire(localRequire.resolve(x)); 56 | } 57 | 58 | function resolve(x){ 59 | return modules[name][1][x] || x; 60 | } 61 | } 62 | 63 | function Module(moduleName) { 64 | this.id = moduleName; 65 | this.bundle = newRequire; 66 | this.exports = {}; 67 | } 68 | 69 | newRequire.isParcelRequire = true; 70 | newRequire.Module = Module; 71 | newRequire.modules = modules; 72 | newRequire.cache = cache; 73 | newRequire.parent = previousRequire; 74 | newRequire.register = function (id, exports) { 75 | modules[id] = [function (require, module) { 76 | module.exports = exports; 77 | }, {}]; 78 | }; 79 | 80 | for (var i = 0; i < entry.length; i++) { 81 | newRequire(entry[i]); 82 | } 83 | 84 | if (entry.length) { 85 | // Expose entry point to Node, AMD or browser globals 86 | // Based on https://github.com/ForbesLindesay/umd/blob/master/template.js 87 | var mainExports = newRequire(entry[entry.length - 1]); 88 | 89 | // CommonJS 90 | if (typeof exports === "object" && typeof module !== "undefined") { 91 | module.exports = mainExports; 92 | 93 | // RequireJS 94 | } else if (typeof define === "function" && define.amd) { 95 | define(function () { 96 | return mainExports; 97 | }); 98 | 99 | //