Commit graph

36 commits

Author SHA1 Message Date
Oliver Blanthorn
7a747312ee
Start work on history completions 2017-11-23 19:55:46 +00:00
Colin Caine
2611f4fe79 cmdline: clear input faster 2017-11-22 23:01:34 +00:00
Colin Caine
8a44732227 completions:
Done:
	Working completion for buffers
	Substitute values into command line
	Prepare for non-buffers completions
	Wrote too many classes and helper functions

Todo:
	Learn inferno and hopefully simplify
	If not, simplify the main functions so that people can actually
	build for it.
	Define an interface for tabbing through options
	Allow more than one CompletionSource per command
2017-11-22 21:43:29 +00:00
Colin Caine
8d771e578c completions 1 2017-11-22 21:30:37 +00:00
Koushien
f982233a49 completions: initial implementation
This commit squashes a load of work by @Koushien, a dozen hours from
@cmcaine and some CSS by @bovine3dom.

@cmcaine is writing this commit message, but the work was mostly by
Koushien so the author is set to them. Thanks Koushien!

The following issues need to be fixed:

 - The interface is over complicated (my fault)
 - commandline_frame is hard-coded to use BufferCompletionSource. This
   needs to be made more general
 - BufferCompletionSource should be generalised
 - completions.ts calls helper functions in commandline_frame. Should
   just use browser proxy. If that's too slow can define a
   completions_background.ts

After that's done, this should be fixed:

 - Completion hiding/unhiding is currently too messy.
2017-11-22 21:30:37 +00:00
Oliver Blanthorn
85d6eba2b5
Revert "Merge branch 'Koushien-completions'"
This reverts commit 0aa14bb754, reversing
changes made to eae9cd0dab.
2017-11-21 20:28:48 +00:00
Koushien
cf620959ec Do not merge: quick WIP
In case I get hit by a bus or something.
Reminder to myself to rebase next commit on
previous patch for some coherency.
2017-11-21 05:15:52 +00:00
Koushien
5bbb133c5c Begin transitioning completions refactor
Start laying groundwork for buffersall excmd
2017-11-21 05:15:52 +00:00
Koushien
f3a4ca0abb Get buffers on "tabclose" or "tabmove"
Firefox doing what it does on Escape in input
fields fires both the input and keydown listeners
leading to a race condition. Rudimentally protect
ourselves by checking completions directly since
it is always modified sequentially.
2017-11-21 05:15:52 +00:00
Koushien
a389d6dde3 Move buffers to general completion system.
User shouldn't notice any difference besides:
* removing "buffer " from cli clears buffers
* retyping "buffer " repopulates buffers
* text after "buffer " filters with smartcase.

We no longer directly set completion's innerHTML.
2017-11-21 05:15:52 +00:00
Colin Caine
be7b304212 cmdline: don't store history for :winopen -private
Component of #53.
2017-11-20 01:31:47 +00:00
Oliver Blanthorn
eb416699f0 excmd: Fix O/W/T 2017-11-09 21:22:02 +00:00
Oliver Blanthorn
15b6ec76cd
Add rudimentary tab completion from history to CLI 2017-11-09 12:44:57 +00:00
Colin Caine
e4cb3d241f exmode: Don't save exmode history when incognito 2017-11-09 08:19:28 +00:00
Colin Caine
21c06d9520 exmode: share history globally
On storage.local for now.
2017-11-09 08:04:05 +00:00
Oliver Blanthorn
11fadb437f
Add CLI history and ^c to cancel CLI
History is per tab and not persistent.
2017-11-05 14:48:22 +00:00
Colin Caine
77062932f7 review: minor bugfixes and changes to clipboard 2017-10-28 13:42:54 +01:00
Anran
09e5281a8d move clipboard to background 2017-10-28 19:20:31 +08:00
Colin Caine
446bd0be21 messaging: move more modules to new sys 2017-10-28 05:11:10 +01:00
Oliver Blanthorn
392bb5b287
Stop fillcmdline from appending a space to empty string 2017-10-24 17:38:52 +01:00
Oliver Blanthorn
31ca72cc55
Append space to excmds again 2017-10-19 21:00:20 +01:00
Colin Caine
8897d8929b excmds: Macro-ify excmds_background and content
excmds_background/content are now generated by python. New dependency,
python3!
2017-10-19 04:40:36 +01:00
Oliver Blanthorn
e78028b040
Initial attempt at multi-word commandline initiation 2017-10-15 23:07:08 +01:00
Koushien
dca6694c0e
Implement minimal :buffer
* prev tab ('#') isn't always the previously
selected tab, i.e., even if you remotely close
the previously selected tab, since we determine
based on time of last access, we always have a
previous tab as long as there is more than one
tab in the window.

* related, displayed prev tab could be wrong if
user unfocuses commandline, switches tabs via
other means and returns to the already opened
:buffer. Possible solution could be to share the
variable so it is only set when tabs are listed.

* Sometimes favicons initially fail to load but
reappear in the commandline when you switch to
the tab. Appears unrelated to whether the tab
is discarded (unloaded in memory).

* Unsuccessfully adding rules for <a> tags.
Beside incompetence, Firefox might be overriding?
2017-10-14 11:01:32 -07:00
Colin Caine
a2986a6e9d cmd: example dynamic function call 2017-10-12 04:43:56 +01:00
Koushien
765a1f749f
Merge remote-tracking branch 'origin/master' into buffer 2017-10-11 17:43:55 -07:00
Colin Caine
735c56a151 cmd: workaround firefox Esc issue 2017-10-09 23:55:24 +01:00
Koushien
82736c99ef
<ESC> in cmdline to null input and exit 2017-10-09 12:40:23 -07:00
Koushien
49d26dd33d
[WIP] Implement :buffer
Current issue: why is changecompletion writing to
the input field?
2017-10-09 12:09:23 -07:00
Koushien
633231d381
Append space to value changecommand fills
Quick hack.
2017-10-05 22:30:09 -07:00
Colin Caine
df3ca534ed src: fix commandline_frame/background messaging
The commandline iframe needs to be messaged with the tabs API, as if
it's a content script.
2017-10-06 04:16:02 +01:00
Oliver Blanthorn
07c3688f8d Bonus late night commit
All the mistakes are Colin's fault
- Generic listener
- Send messages to command line
- ^ doesn't work unless frame is opened in new tab
2017-10-06 03:40:17 +01:00
Oliver Blanthorn
61d24e918f
Ensure commandline hides even if command deactivates page 2017-10-05 21:38:16 +01:00
Colin Caine
50241c91d2 src: hide commandline after exec 2017-10-05 15:27:45 +01:00
Colin Caine
7b789350df src: consistently use message.type 2017-10-04 23:58:30 +01:00
Colin Caine
5964430fe1 Convert to es6 modules
Motivation:

 - Most test frameworks expect modules
 - I'm told they're the future

Changes:

 - Every typescript source file is now an es6 module
 - Build system is now webpack (tho rollup makes nicer outputs)
 - Outputs of buildsystem are one js file per entry point (background,
   content, commandline_frame)
 - These bundled js files are generated by traversing the dependency
   graph of each entry point
2017-10-02 01:17:32 +01:00
Renamed from src/commandline/commandline.ts (Browse further)