Commit Graph

52 Commits

Author SHA1 Message Date
toastal f4014abea8 Use `.some` to short circuit & native `.includes` (#2697)
`Array.prototype.some` short-circuits when a value is true which is better for performance and makes the intention more clear. Native `String.prototype.includes` is easier to read.

Now reading it as English, "if some argument includes 'verbose'"...
2019-01-03 18:24:09 +02:00
Manuel Hornung aecf5c6de0
WebGL Renderer Ligatures (#2560)
* Tokenize rendered cells based on style and whitespace
* Manually evaluate system font files to determine character sequences to render together
* Render ligatures as one single token in the WebGL Atlas
* Use font weight setting in the WebGL Renderer
* Prefill atlas with the visible ASCII characters for optimization
* Simplify lookup of rendered glyph information
* Code style adjustments and refactorings for readability
2018-09-24 05:02:07 -07:00
Paul Roberts e482ae8584 Fix for #2414 - truncated copy/paste (#2515)
This is a fix for some of the issues raised in #2414. One thing to note - there was some question as to whether win32yank works for everyone. I did find a possible workaround for that, if it's still an issue:

```
const textToPaste = clipboard.readText()
const sanitizedTextLines = replaceAll(textToPaste, { "'": "''" })
await neovimInstance.command("let @+='" + sanitizedTextLines + "'")
```

I don't have a windows box to test this on, so perhaps we can add this code to `NeovimEditorCommands. pasteContents` later if needed.
2018-08-27 20:39:32 +01:00
Ryan C b901ecdda0
Markdown Syntax Highlights (#2332)
* Basic code highlights.

* Check if the given language is valid, use auto highlight if not.

* Fix check.

* Set baseUrl as well.

Unrelated to code blocks, but fixes #1653 and is a single line change in the options I've added.

* Bump marked types package number.

* Move style sheet to only markdown preview.

* Swap theme to option.

* Fix review comment from previous PR.

* Fix nohighlights.

* Update tests for Markdown preview.

* Fix lint error.

* Add config option for syntax highlights.
2018-07-26 10:45:08 +01:00
Akin ecbd4af16c
Feature/add git commit functionality (#2441)
As part of fleshing out the VCS this pr adds the ability to commit a file using the git sidebar.

Additions:
* Menu command toggle vcs visibility
* Recent Commits Section: commits made whilst in oni (later might be preferable to get a git log rather than commits from oni)

* Commiting: see below

![vcs_commit](https://user-images.githubusercontent.com/22454918/43024011-bd3e27ac-8c64-11e8-8d2e-944047d7ed8d.gif)
2018-07-24 16:43:41 +01:00
keforbes 4ce7b50e49 remove 'File Explorer Split' menu item (#2423) 2018-07-21 22:02:57 +01:00
Cedric Bosdonnat e199186218 Display an icon on non-win32 machines (#2363)
On Linux platforms, the icon needs to be a PNG file. On MacOS too
according to this page:

https://developer.apple.com/design/human-interface-guidelines/macos/icons-and-images/app-icon/
2018-07-08 08:02:14 -07:00
Ryan C d218301de3
Reduce app folder size. (#2392)
* Try removing some unneeded folders from the build.

* Delete random new file.

* Update ignore list further.

* Swap to explicitly listing required files/folders.
2018-07-04 12:39:37 +01:00
Paul Roberts 5b5753ebb4 Workaround for devtools keyboard shortcuts not working on OSX (#2390) 2018-07-03 23:01:42 -07:00
Bryan Phelps cf1e75bb13
Fix regression where windows isn't shown on initial launch (#2380) 2018-07-01 15:08:32 -07:00
Ryan C 8919a86b16
Sort out CLI for Oni (#2372)
* Very first version of new CLI.

* Hook up calling on Windows.

* Try for Mac and Linux.

Need to test on Mac.

* Fix mac path.

* Small changes to CLI script.

* Fix bin pointing to CLI.

* Clarify changes in cli_args.

* Update Registry key check.

* Update Windows installer to get around path issues.

* Update Mac add to PATH command.

* Fix logic error.
2018-07-01 12:36:05 +01:00
Bryan Phelps 4615f90b6e
Electron: Use 'makeSingleInstance' API (#2377)
* Use 'makeSingleInstance' API instead of home-grown strategy

* Format with prettier

* Fix compilation error
2018-06-30 15:14:45 -07:00
Paul Roberts 17d6dcaf37 Fix error when using Open With option in OSX finder (#2366)
* Fix error when using Open With option in OSX finder

* Remove unnecessary async keyword
2018-06-30 01:30:54 +01:00
Bryan Phelps 7b15dce05c
Security - Add Content Security Policy (#2288)
* Add CSP

* Add content security policy

* Revert commented block

* Experiment with loading the configuration in a vm context

* Fix lint issues

* Fix build issue
2018-06-23 15:05:26 -07:00
Ryan C 7c09bcf76c
Markdown changes (#2282)
* Fix a few small Markdown preview issues.

* Close markdown preview on exit.

* Update marked version.

* Add config option for auto scroll.

* Keep focus on initial split.

* Fix toggle function.

Before the fix was only applied to close.

* Hook up clicking a link to open the Oni browser if activated.

Fixes #2021.

* Fix lint error.

* Update for changed API.

* Update tests.

* Bump package number.

* Update lock file.

* Syntax change.
2018-06-19 17:15:10 +01:00
Yohan Lee cd87a1f201 Feature/ Add keyboard shortcut to edit oni config (#2280)
Issue #2276
This change allows pressing `CMD+,` (Mac) to open oni config file.  Keystroke is `CTRL+,` on Windows and Linux platforms. 
<img width="495" alt="screen shot 2018-06-02 at 5 13 32 pm" src="https://user-images.githubusercontent.com/9834975/40880969-321c9434-6689-11e8-83bf-dc9bc98de48d.png">
![open config](https://user-images.githubusercontent.com/9834975/40880978-5de4bb96-6689-11e8-9bf5-51b2b4433b45.gif)
2018-06-03 11:19:44 +01:00
Akin 7a924cf553
add menu command to open new window (#2034) 2018-04-04 22:57:34 +01:00
Tom Watson 13efab0090 Add accelerator to Exit menu entry (#2001)
Currently you can quit Oni with Command+Q, but only if a window is
currently open. If you close all windows, e.g. by `:q`ing all tabs, the
app is left running but Command+Q will no longer quit the app, and you
have to press the Oni->Exit menu item.

Adding this accelerator here allows the app to be closed via the the
standard shortcut regardless of whether there are currently any windows
open.
2018-04-01 22:45:19 +01:00
Ryan C 06778395ed
Fix drag and drop. (#1882)
* Initial change to fix drag and drop.

* Refactor to use the existing openFile method that takes user config into account.

Removed old _openFiles method since it wasn't needed anymore.
Removed un-used VimL function too.
2018-03-22 20:30:45 +00:00
Bryan Phelps 580a30e117
Automation: Update 'stop' logic to retry (#1865)
* Add debug loggin to electron builder

* Move environment variable to shell script

* Remove setting environment variables in travis.yml

* Update exporting of DEBUG variable

* Additional logging and stop logic

* Remove 'window' from setTimeout, since window isn't around in a node environment

* Revert changes to travis-build
2018-03-20 13:17:45 -07:00
Bryan Phelps ab8253a47c
Add additional logging for main process, to debug issues with it closing on OSX (#1849) 2018-03-19 07:54:19 -07:00
Ryan C 54105e0253
Cross Oni Movement (#1747)
* First messy attempt at moving around Oni windows.

* Make slightly smarter.

* Tidy up.

* Fixed passing of direction.

Also check that there are valid windows to swap to, both initially and after filtering.

* Tidy up by moving to new file.

* Ignore minimized windows.

Not sure if this should be the default or not.
Is possible we could hook up a config option and pass that over the IPC to here to make it configurable.

* Add to OniEditor for now.

* Remove temp commands.

* Fix lint issues.

* Remove main window from main.ts

Added function to get current active window, and renamed main window to currentWindow.

* Extend the logic of window swapping to check the main axis first.

I.e. always move to the closest window on the right.

* Fix lint issues.

* Setup main unit tests.

* Change code to make it more easily unit-testable.

* Add first set of tests.

* Add further tests.

* Tidy up tests.

* Remove from OniEditor.

* Wire up in index.tsx.
2018-03-16 15:30:03 +00:00
Bryan Phelps b36fec6a5a
Refactor menu-item-click to use command (#1787) 2018-03-13 12:17:20 -07:00
Fernando Montoya 18963f49c4 Fix GitHub brand typo (#1784) 2018-03-13 09:25:40 -07:00
Bryan Phelps 3935c18694
Fix inverted conditional (#1725) 2018-03-07 07:35:54 -08:00
Bryan Phelps 6b193c69b0
Automation: Improve process closing logic on OSX (#1689)
* Fix process closing logic on OSX

* Don't kill node...

* Kill chromedriver processes too

* Set up automation to ignore single instance mode

* Disable single instance mode in automation

* Tweaks to improve logging / closing

* Additional logging for stop method

* Don't gate on single instance for OSX tests

* Fix lint issues

* Don't change process stop behavior
2018-03-02 11:09:22 -08:00
Matt a532ebdc05 [ISSUE-246]: Add --help option to command-line oni (#1509)
* [ISSUE-246]: Add --help option to command-line oni

* Moved flag-check to main.ts before electron process begins
2018-02-12 16:21:45 -08:00
Bryan Phelps ada88bb12a
Fix regression in react/redux devtools (#1467)
* Gate isDevelopment on webpack build environment variable, too

* Update electron-devtools-installer
2018-02-07 09:56:54 -08:00
Bryan Phelps a5b4ab3fc1
Fix workspace open regressions (#1393) 2018-01-30 09:52:55 -08:00
Bryan Phelps bc86337e50
Run prettier over markdown / json files (#1395) 2018-01-29 19:56:24 -08:00
Bryan Phelps 30c186aec1
Run prettier on all files in repo (#1362)
* Run prettier on all files in the repo

* Temporarily remove pre-push hook

* Start tweaking settings to get lint passing

* Fix some tslint errors

* Fix lint issues

* Disable align rule, since prettier takes care of that for us

* Add prepush rule back

* Fix test lint error
2018-01-25 15:13:53 -08:00
Akin 6e2ba2ae7a Bugfix/open new file after close (#1246)
* return main window and create one if unavailable

* hide window on "close" so object not destroyed

* add accelarator options

* explicitly pass in focused window to menu clicks

* create fn ensure window always exists

* use browser window for oni command

* create ref to main window to use on activate

* Fix incorrect conditional for windows.length

* fix unintentional command rename

* re-add old conditional with better ordering

* remove hiding functionality

* Fix rename bugs remove traces of quitting state

* add delayed event sending

* add event on oni.started listened for in main

* send delayed event to main process

* create dryer wrapper fn

* switch to using once method for ipcMain

* revert changes to oni.sh

* finish reverting oni.sh changes
2018-01-16 15:07:44 -08:00
Akin b552a3f60d Feature/add file associations (#1245)
* add filetype associations for os recognition

* fix json errors

* fix moar json errors

* add fileopen command

* refine file open functionality
include check to see if valid path can be created
if so open with valid path

* [WIP] add handler for responding to open-file

* add fileprotocol for electron

* add conditional to file protocol

* remove conditional add safer logs

* add is package to associations
remove args from activate create window

* fix typo and pass correct path to event handler

* Add environment check

* add json to filetypes

* remove logs

* replace mistakenly removed logs

* revert change start editor to minimise footprint

* add browserWindow variable

* add create window call

* add createwindow and open-file event

* remove false assignment
2018-01-09 18:45:43 -08:00
Akin 88f26513b6 Feature/hide app shortcut on macOS (#1241)
* add hide app command and bind to m-h

* use app.hide api

* fix import use remote.app

* add menu commands and show on activate

* Remove hide option from dock as it already exists
2018-01-08 14:03:42 -08:00
Bryan Phelps 7a6dd355d0
Integrated Browser - 1: Add browser-layer plugin (#1214)
* Add oni-layer-browser project

* Hook up open url command

* Get working end-to-end

* Add build/lint steps
2018-01-02 11:55:21 -08:00
Bryan Phelps ebcb067859
Refactoring: Remove unused cross-browser-ipc request (#1206)
* Remove unused cross-browser-ipc request

* Remove unused webcontents
2018-01-02 09:44:14 -08:00
Bryan Phelps f7ebfcb5f6
Fix regression in opening files from command line (#1182) 2017-12-22 15:37:09 -08:00
Bryan Phelps 566c178929
Flip the width/height to match the previous behavior (#1168) 2017-12-20 13:32:04 -08:00
Akin 30a3f9b223 Add save window state functionality (#1160)
* Add save window state functionality

* add better error handling if no bounds

* ensure there is a default window state

* add further checks to ensure window.bounds

* ongoing tweaks in attempt to trace pack error

* remove defaults add logging

* fix mistaken if clause to catch falsy args

* remove logging and excessive conditionals

* add is maximised so can restart as maximized

* finalise functionality to save is maximised state
2017-12-20 07:53:44 -08:00
Bryan Phelps 179c20a39b
Automation - OSX: Fix false positive (#1153)
* Add 'set -e' flag to bash to tell it to bail if there is a non-zero exit code for any command

* Revert if inversion

* Remove extra new line

* Add timestamps, and bump uptimeout

* Remove unused stability tests

* Remove extra parentheses

* Ignore arguments passed from Spectron

* Add warning that arguments are being cleared

* Add a wait for startup to complete

* Fix start call

* Temporarily deactivate NoInstalledNeovim test to unblock CI

* Fix lint issue
2017-12-19 16:20:09 -08:00
Bryan Phelps c2db957822
Fix #1009 - Persist background color (#1117)
* Add electron-settings

* Update background color

* Persist background color when it changes

* Clean up lint issues

* Move electron-settings out of development dependency

* Use main process for electron-settings instance

* Fix build issues
2017-12-18 13:09:47 -08:00
Akin 0059fb3c74 Add react dev tools and hook up redux dev tools (#1142)
* add react dev tools

* less asyncification in a misguided..
attempt to debug if that causing the lack of cool tools

* upgrade electron-devtools-installer
add func to init tools async

* hookup redux store

* fix lint errors
2017-12-18 07:42:49 -08:00
Akin 40e54a60eb Add new window option (#1111)
* add new window menu option [WIP]

* Add dock menu building function

add option to create new window to top menu bar
2017-12-12 16:05:46 -08:00
Bryan Phelps f1247f8d45
Fix #63: Synchronize titlebar color on OSX (#1034)
* Create component + state management for window title, use frameless window on OSX

* Create connected component to store, hook up title

* Add 'title' colors and update 'onedark.json

* Only show window title on Mac

* Fix lint issues

* Derive the titlebar / background color from the theme color
2017-11-29 10:41:35 -08:00
Bryan Phelps c15d0940f6
Fix #860 - Add about entry and stub out auto-update (#872)
* Add AutoUpdate + Metadata stubs

* Show about message

* Log update available / not available

* Clean up about dialog

* Fix lint issues
2017-11-06 14:28:07 -08:00
Bryan Phelps f5f2be00d3 [WIP] Fix #541 - Font rendering improvements (#753)
* Some tweaks to improve font rendering

* Add 'redrawAll' method

* Add alpha condition based on whether there is a background image

* Maintain functionality for transparent background

* Refactoring to decouple the CanvasRenderer from needing to know about resize, or the delta tracking of cells

* Clean up lint issues

* Remove unused code in CanvasRenderer

* Remove extraneous comment
2017-10-10 16:23:12 -07:00
Bryan Phelps 700884b92e Fix #396, #542 - IME and Dead Key support (#716)
* Refactor Keyboard to take in an element

* Extract body of keyboard handler to separate method

* Factor out keyboard to <NeovimInput />

* Refactor keyboard input to separate component

* More input updates

* Initial work to add IME/dead key handling to keyboard input

* Handle composing case

* TEST COMMIT

* Revert test commit

* Some cleanup / refactoring

* Fix first round of lint issues

* Disable IME when not in insert mode

* Fix remaining lint issues

* Refactor logic so that RootComponent gets first pass at handling keyboard input

* Start cleaning up logic in NeovimInput

* Add FocusManager

* Remove 'capture' concept from input manager

* Fix mouse regression by setting pointer-events: none

* Fix exception due to null key

* Factor KeyboardInput to separate file

* Fix up props

* Clean up and consolidate logic in KeyboardInput; fix lint erros

* Fix composition issue on OSX

* Specify lineheight for cursor, to center highlighted text
2017-09-27 19:06:27 -07:00
Amadeus Folego 194147057a Refactor handling of arguments to child process (#728)
Use the `LOCAL_ONI` environment variable instead of checking the
platform and file name of the electron executable.
2017-09-27 18:40:00 -07:00
extr0py 4d17cea644 Only log to console if --verbose is specified (#706) 2017-09-13 07:07:13 -07:00
extr0py 38bc6debbd FIX #636: OSX - Shell script to open oni from command line (#691)
* Hook up shell script with add path

* Resolve symlink path

* Continue fixes for shell integration

* Update oni.sh

* Add execute permission to oni.sh

* Use

* Fix directory resolution when running from script

* Remove accidentally introduced whitespace

* Fix lint issues in main
2017-09-10 12:10:59 -07:00