From 7a61c80eeecd06646782f46be56e97c62ca9069d Mon Sep 17 00:00:00 2001 From: Eli Fatsi Date: Fri, 15 Feb 2019 12:34:49 -0700 Subject: [PATCH 1/2] Add setting for still and hidden cursor --- .gitignore | 4 ++++ README.md | 1 + lib/zen.coffee | 16 ++++++++++++++++ styles/zen.less | 20 +++++++++++++++----- 4 files changed, 36 insertions(+), 5 deletions(-) diff --git a/.gitignore b/.gitignore index 219ac56..006a538 100644 --- a/.gitignore +++ b/.gitignore @@ -39,3 +39,7 @@ Thumbs.db # Node installed packages # ########################### node_modules/* + +# Package lock # +########################### +package-lock.json diff --git a/README.md b/README.md index d2282b9..79d9644 100644 --- a/README.md +++ b/README.md @@ -12,6 +12,7 @@ Settings: - Tabs can all be hidden, or all except the active tab - Optional soft wrap - Keep the [word count](https://atom.io/packages/wordcount) visible +- Cursor style. Can be configured to be a light/opaque non-blinking cursor, or hidden entirely. Note that settings are not available until the package has been activated, due to [a shortcoming in core](https://github.com/atom/settings-view/issues/356). Also, if you change themes, you might need to reload Atom for the colors to be applied correctly to all packages including Zen. diff --git a/lib/zen.coffee b/lib/zen.coffee index ae2c42c..afa7d37 100644 --- a/lib/zen.coffee +++ b/lib/zen.coffee @@ -48,6 +48,16 @@ module.exports = 'Right' ] order: 8 + cursorStyle: + description: 'Change the cursor behavior.' + type: 'string' + default: 'Default' + enum: [ + 'Default', + 'Still', + 'Hidden' + ] + order: 9 activate: (state) -> atom.commands.add 'atom-workspace', 'zen:toggle', => @toggle() @@ -87,6 +97,12 @@ module.exports = when 'Hidden' body.setAttribute 'data-zen-word-count', 'hidden' + switch atom.config.get 'Zen.cursorStyle' + when 'Still' + body.setAttribute 'data-zen-cursor', 'still' + when 'Hidden' + body.setAttribute 'data-zen-cursor', 'hidden' + body.setAttribute 'data-zen-gutter', atom.config.get 'Zen.gutter' # Enter Mode diff --git a/styles/zen.less b/styles/zen.less index e67c9e5..3276f5d 100644 --- a/styles/zen.less +++ b/styles/zen.less @@ -33,13 +33,12 @@ .editor--private { .vertical-scrollbar { opacity: 0; - transition: opacity .2s .1s; + transition: opacity 0.2s 0.1s; } &:hover .vertical-scrollbar { opacity: 1; } } - &[data-zen-word-count="visible"] { .status-bar .word-count { @@ -59,9 +58,9 @@ } &[data-zen-gutter="false"] { - .gutter { - display: none; - } + .gutter { + display: none; + } } &[data-zen-tabs="multiple"], @@ -81,4 +80,15 @@ } } } + + &[data-zen-cursor="still"] { + atom-text-editor .cursor { + opacity: 0.3 !important; + } + } + &[data-zen-cursor="hidden"] { + atom-text-editor .cursor { + opacity: 0 !important; + } + } } From 6ff271030994beac755b70758ce2222b232ed57a Mon Sep 17 00:00:00 2001 From: Eli Fatsi Date: Fri, 15 Feb 2019 13:05:57 -0700 Subject: [PATCH 2/2] Hide parenthesis highlighting --- styles/zen.less | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/styles/zen.less b/styles/zen.less index 3276f5d..78cc4b4 100644 --- a/styles/zen.less +++ b/styles/zen.less @@ -40,6 +40,10 @@ } } + .highlights { + display: none; + } + &[data-zen-word-count="visible"] { .status-bar .word-count { position: fixed;