Giter Site home page Giter Site logo

mogenslund / liquid Goto Github PK

View Code? Open in Web Editor NEW
959.0 959.0 42.0 1.36 MB

Clojure Text Editor, for editing clojure code and markdown. Written entirely in Clojure with inspiration from Emacs and Vim.

License: Eclipse Public License 1.0

Clojure 99.18% Dockerfile 0.12% HTML 0.70%
clojure extensibility ide liquid text-editor

liquid's People

Contributors

acgollapalli avatar benjamin-asdf avatar gmercer avatar harryvederci avatar jgracin avatar jrheard avatar mogenslund avatar pieceofduke avatar souenzzo avatar vctr-dev avatar xificurc avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

liquid's Issues

Keybindings.

Hello again. Managed to fire up your creation, already feeling the potential. Whoa.
The thing is, I use Colemak keyboard layout, so I want to redefine ALL the keys right away.
So I had to dive into the source code to see where those are defined. And those are hardcoded all over the different files.
Wouldn't it be better to extract them to edn config files?..

Japanese Strings don't get colored correctly

japanese_characters_dont_get_displayed_correctly

As shown in the attached screenshot, strings containing Japanese characters don't get displayed/colored correctly. I switched the color to yellow temporarily but the content between the quotes remains black, only a single character gets colored correctly if the caret is placed upon it.

Mogens' initial thoughts on Slack were:

mogenslund: "If I see correctly, the japanese characters occupy two columns. Since I in some cases clear the rest of the line in the terminal, to clean up the calculation gets wrong with these characters. I am pretty sure its is a view thing and that it is handled correctly in the buffer behind the view. [...] I guess handling these characters will be somewhat similar to handling the tab character.

Typeahead app opens only in the first main window

If I "split below", then C-space, the typeahead opens in the new window, but the action is done only in the previous window, leaving the typeahead open in the new window.

The typeahead should open non-prompt buffers in whichever window the typeahead is used in.

keybinding to swap main and eval window back and forth

Right now, error messages and output show up in the smaller left-side window, and they format pretty poorly (as they expect more like a 50 column window).

Would it be possible to have a shortcut key that swaps the content of the main and eval window back and forth? That would make quick inspection of the eval window's content easier.

I think ideally, the main window wouldnt be word-wrapped into the eval windows' column width, but rather keep its main window column width formatting (makes for mental easier referencing if your code doesn't suddenly look all different due to wrapping), and truncating what is visible in the eval window.

But thanks for making liquid. Using LightTable right now, but interested in this one :-).

Evaluate ('e') with bracket in string

This is a good example of why maybe you should use a parser in general!

In the following example if I press 'e' at -> it fails to evaluate the expression because of the bracket in the string.

(require '(clojure [zip :as zip]))
(->
 (nth (iterate zip/next (zip/vector-zip (core/parser "(1 2 3)"))) 8)
 (zip/replace "#(")
 zip/root
)

Documentation request

Didn't manage to start using this on Windows.
Got lein installed via chocolatey.
Could you please provide a manual for leiningen users?..

Improve findfilemode to be more flexible

The dk.salza.liq.modes.findfilemode should be more flexible in the following senses:

Callback

The mode should be able to take a callback function, which will operate on the found file or folder, so it can be used in a variety of situations, including:

  1. To open a file in the editor
  2. To insert the path as text
  3. To evaluate the file

Selection

If there are any choices in the typeahead the first one should be selected as default (At the moment of writing this, none is selected until "next-res" command executed C-k.)

Choosing file

The rules below for choosing a file should be implemented.

There are 4 cases:

  1. Choosing a new file
  2. Choosing existing file
  3. Choosing existing folder
  4. Navigate to folder

On enter press

  1. If a file is choosen in the typehead, the path to that should be the result.
  2. If a folder is choosen in the typeahead the path to that should be the result.
  3. If there are no typeahead results asume the search is a new file. Use that as result.

On M-enter (3611)

The typed search content is the result (To create a new file although there is non empty typeahead results.)

On C-k

If a folder is choosen, use C-k to navigate to that folder

Put this on clojars?

I really like the idea of this product!

Thought it would be nice if I can provide the coordinates of the jar in my profile.clj so that it is available when I lein repl.

goto-definition not working 100%

Expected Behavior

Using the goto-definition feature via gD on any symbol (in a clojure file) should take you to the definition of that symbol.

Actual Behavior

It works for some (most?) of the liquid internal parts, but not at all for other projects.

Steps to Reproduce the Problem

  1. Please try going to the definition of ensure-buffer-fun in line 74 of editor.cljc (works)
  2. Now please try going to the definition of highlight in line 274 of editor.cljc (doesn't work)
  3. Please try this with any other Clojure project, for example this one. E.g. jumping to the definition of target-planets in line 148 of ex04_api_design.clj will not work.

Specifications

  • Version: V2.1.1 (master)
  • Platform: macOS Big Sur 11.6 & void Linux 5.14.10

Details

I did not add the sample project to the dependencies of any configuration file. I'd like this feature to work in the project I'm working on without much additional configuration.

I only have a Leiningen and clj alias in place to start liquid using either the project's profile.clj or deps.edn file.

In case I was using it the wrong way please advise ๐Ÿ™‡๐Ÿป

Readability when working on files residing in a very deep directory structure

Liquid displays the filename (with the complete absolute path) of the buffer in the lower left corner. At the right side of the filename information like row and column numbers as well as the current mode (INSERT, VISUAL, etc.) gets displayed. This is basically all fine, but if you work on a larger project which has a really (I mean really) deep directory structure and your monitor is only something like Full-HD and/or you want the liquid window displayed alongside something else, you will neither be able to see the complete filename, nor any of the other information described above anymore.

When switching buffers, it can also happen quickly that two lines will be used for one buffer entry.

All of this is not much of a show-stopper and might be a rare case, but maybe there is a way to improve the readability of really long paths/filenames? Something like only displaying the top and last directory together with the filename, so e.g. instead of
displaying

"/home/daisybytes/my/very/very/deeply/structured/terrible-project/sucks.txt"

maybe

"/home/.../terrible-project/sucks.txt"
"my/.../terrible-project/sucks.txt"

or something completely different could be displayed to shorten this down.

A very quick and dirty "solution" could also be to just switch around the information in the status line and show the file/path information on the right and the other things on the left. Then you might still run into the situation that the filename is too long, but at least the other things are still readable ๐Ÿ˜‰

Code formatting?

It isn't clear to me how code formatting should be addressed within liquid. Is this something the use needs to add using one of the may clojure code formatting libraries and if so, is there a recommended library?

Going into prompt then typeahead

I ran some code using 'e', which then produced a long error message. Then I used C-space to go to the prompt buffer to look at the start of the message. But then when I press C-space to go back to the main window, the prompt is taken over by the typeahead.

Maybe I'm missing something?

After exiting liquid my bash becomes unusable

I just tried 0.4 typed some stuff and then typed C-q to exit liquid. Afterwards I cannot use my bash anymore. No keytypes are recognized and it looks like this:

liq

After trying some more I figured out I can type and commands will be evaluated, I just can not see what I typed.

I am using: GNU bash, Version 4.3.46(1)-release (x86_64-pc-linux-gnu) in mate.

Can't assume a "block" cursor

Hi there - A lot of people (like me!) have their terminal configured to use an in-between cursor rather than a block/box cursor:

Screenshot 2020-11-21 at 11 11 39

Screenshot 2020-11-21 at 11 23 56

In Liquid, when moving around, and when typing, there is an additional block that flashes, which is distracting.

I think it's because Liquid's own code draws a "fake" block cursor?
https://github.com/mogenslund/liquid/blob/master/src/liq/tty_output.cljc#L97
https://github.com/mogenslund/liquid/blob/master/src/liq/tty_output.cljc#L117

How about making it possible to optionally disable that?

Split window same buffer; view position

A relatively common thing I do is split a window to look at one part of a buffer, while editing another.

In Liquid I think the window view position is stored in the buffer, and so when I edit in either window both windows share the same view.

Would be good to have a view point for each window.

Evaluate vs evaluate raw keybindings

Right now c p f evaluates the current file as it is. It should be replaced by an evaluation of the code in the current buffer with input captured, just like c p p, but with all the content as input.
To evaluate the file in raw form the keybinding c p F should be made available.

Please teach me )

Hello mogenslund )
I tried to read into your code, and it's too much to grokk at once.
I have an idea to watch how the code evolved from the start, but didn't manage to come up with an effective way to do that.
I ask your advice on this one. As well as a general advice on how to gain deeper understanding of your project's inner workings.
Thanks in advance,
larval clojurian.

Improve goto definition

The function

liq.modes.clojure-mode/goto-definition

should be improved. Right now it uses

(java.lang.ClassLoader/getSystemClassLoader)

to get a list of classpaths, which does not cover all cases.

Looking to (orchard.java.classpath/classpath) might be an option. Maybe using orchard directly. To not conflict with the no-dependency philosophy an option could be to have a default function defined through a keyword in the state, which can be replaced with any other classlouder function.

Improve UX of liq.modes.typeahead-mode in relative mode

In relative mode the typeahead-mode show the buffer near the cursor in the calling buffer.
It can be difficult to see the boundry. Maybe use some kind of backgroundcolor?
Also pressing tab should be disabled. It makes no sense in typeahead-mode.

Going into other mode

(In Terminology, and using code not in this repository but shared by gists with @mogenslund .)

The setup is that I have both my parser mode assigned to "]", and also your simpler mode assigned to the "[" key.

I go into my mode and press "s", which takes to the next :string, then I exit using tab. Then I hold down the down arrow. Then after about a second of scrolling through code, it goes into your mode.

I think somehow the down arrow is still (like in Kitty) polluting something, and feeding into the input... but I could be totally wrong.

More weird insert errors

As in #17 I was doing some editing in Liquid, this time in Terminology, and a spurious partial escape sequence was inserted into the text while I was moving the cursor.

I don't know how to recreate this this time, but it shows that it's probably not just a terminal bug.

Slow exit on exceptions

Hi!

In view-handlers and input-handlers, processing loops are run within "futures". However, exceptions within futures are not caught anywhere and they cause silent failures. What's more, they cause the editor to quit but with a 60 second delay due to the known shutdown delay of the internal ExecutorService. If one doesn't know what's going on, this appears as if the editor has frozen.

I was thinking of adding an exception handler around the bodies within "future" calls which would do the following

(catch Exception e
        (logging/log (with-out-str (stacktrace/print-cause-trace e)))
        (editor/force-quit))

I'd probably wrap it in a macro (e.g. exit-on-exception).

What do you think? I can prepare a pull request, if you like.

"File open app" in split windows then C-g

I split the window vertically then the top one horizontally, in the top right window I press C-f then C-g.

The file browser remains open and the focus moves to the bottom window.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.