Code Monkey home page Code Monkey logo

v's People

Contributors

djmcmayhem avatar dougyfresh42 avatar kritixilithos 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

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

v's Issues

Characters in the 0x80-0x9F range are not correctly passed into the V instance

You can verify this by mapping one of those characters to something like:

iItworked!<esc>

and then trying to run a program with just this mapped character. Nothing will show up. This is a problem since 0x80-0x9F was going to be mapped to regex shortcuts, e.g. \zs, \ze, {-}, {1}, {2}, {3}, {4}..., .*, .+, etc. as well as maybe some character classes. (Even/Odd digits, Vowels/consonants, maybe some others)

Duplicate operator is borked.

For example, look at this program:

ysw|Äx

Explanation:

ysw|           "Surround this word in '|'
    Ä          "Duplicate this line
     x         "Delete a character

For some reason though, this deletes the character before duplicating the line. I'm guessing it's most likely a bug with the feedkeys function putting the paste command in the wrong place in the keypress queue. The same issue comes up if you put the duplicate command in a macro. For example, this program:

i¸ 1 X 8 + 1 = 9�8ñYp|Eäl�^Xf+�$äl�

Clearly prints all the "ones" after the macro is done executing.

Unexpected ¬ behavior

When I do 0¬{char}{char}, instead of doing nothing, it puts an (0x1B byte) in. Not sure why that happens...

Documentation!

There is no list of official commands. Currently the only place these are documented is in my brain. This would go well with a code-page.

V Corpus

Similar to this issue, I decided to run Lynn's method on V answers.

Query used. Code:

import csv
import collections

digraphs = collections.Counter()
trigraphs = collections.Counter()
quadgraphs = collections.Counter()

cp1252 = "ǝʒαβγδεζηθ\nвимнтΓΔΘιΣΩ≠∊∍∞₁₂₃₄₅₆ !\"#$%&'()*+,-./0123456789" + \
                                 ":;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrst" + \
                                 "uvwxyz{|}~Ƶ€Λ‚ƒ„…†‡ˆ‰Š‹ŒĆŽƶĀ‘’“”•–—˜™š›œćžŸā¡¢£¤¥¦§¨©ª«¬λ®¯°" + \
                                 "±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖ×ØÙÚÛÜÝÞßàáâãäåæçèéêëì" + \
                                 "íîïðñòóôõö÷øùúûüýþÿ"
with open("QueryResults(2).csv", newline="", encoding="utf-8") as f:
    for row in csv.reader(f):
        if row[0] == "Post Link":
            continue
        code = row[1]
        if "<pre><code>" not in code:
            continue

        # Extract the first bit of code
        vyxal = (
            code.partition("<pre><code>")[2]
            .partition("</code></pre>")[0]
            .strip()
        )
        vyxal = vyxal.replace("&quot;", '"')
        vyxal = vyxal.replace("&gt;", ">").replace("&lt;", "<")
        vyxal = vyxal.replace("&amp;", "&")

        for i in range(0, 256):
            vyxal = vyxal.replace("&#"+str(i)+";", cp1252[i])
        vyxal = vyxal.replace("<esc>", cp1252[0x1b])
        alpha = "abcdefghijklmnopqrstuvwxyz"
        for idx, i in enumerate(alpha):
            vyxal = vyxal.replace("<C-"+i+">", cp1252[idx+1])

        vyxal = vyxal.replace("<M-x>", "ø")

        if any(vyxal.count(c) >= 10 for c in vyxal):
            continue
        if len(vyxal) > 100:
            continue

        for line in vyxal.split("\n"):
            for (a, b) in zip(line, line[1:]):
                digraphs[a, b] += 1
            for (a, b, c) in zip(line, line[1:], line[2:]):
                trigraphs[a, b, c] += 1
            for (a, b, c, d) in zip(line, line[1:], line[2:], line[3:]):
                quadgraphs[a, b, c, d] += 1

with open("most-common.txt", "w", encoding="utf-8") as f:
    f.write("2-graphs:\n")
    for d, n in digraphs.most_common(30):
        f.write("%4d %s\n" % (n, "".join(d)))

    f.write("\n3-graphs:\n")
    for d, n in trigraphs.most_common(30):
        f.write("%4d %s\n" % (n, "".join(d)))

    f.write("\n4-graphs:\n")
    for d, n in quadgraphs.most_common(30):
        f.write("%4d %s\n" % (n, "".join(d)))

Results (displayed in the 05AB1E codepage):

2-graphs:
  24 Àñ
  24 ./
  21 Àé
  21 @"
  19 $x
  17 xx
  17  /
  17   
  15 /&
  15 dd
  15 «©
  14 Íî
  14 òÍ
  14 12
  13 2i
  13 lD
  13 Gp
  13 ll
  13 é 
  12 Θ"
  12 /d
  12 / 
  12 Yp
  11 r 
  11 lx
  11 e 
  11  ₂
  11 Ó.
  11 òd
  10 kl

3-graphs:
  11 ./&
  10 Ó./
   8 [ae
   8 aei
   8 eio
   8 iou
   8 "qp
   7 YGp
   7 /&ò
   7 lxx
   7 $xh
   7 D@"
   6 Í./
   6 xx>
   6 Ä$x
   6 qpx
   6 Àé 
   5 Àé*
   5 òͨ
   5 À­ñ
   5 ou]
   5 ¨ä«
   4 ©î±
   4 ¨[a
   4 ]«©
   4 «©¨
   4 «©/
   4 òÍî
   4 /  
   4 /12

4-graphs:
   8 [aei
   8 aeio
   8 eiou
   8 Ó./&
   6 ./&ò
   6 "qpx
   5 iou]
   4 ¨[ae
   4 òÄ$x
   4 Ä$xh
   4 ~"qp
   4 :se 
   4 2i2i
   4 ¨ä«©
   3 Í./&
   3 ¨.«©
   3 lxx>
   3 iouy
   3 ouy]
   3 uy]«
   3 À|lD
   3 Ñ~"q
   3 ./& 
   3 òhYp
   3 hYpX
   3 :sor
   3 éiD@
   3 iD@"
   3 ₂"qp
   3 gÓul

<M--> and <M-+> not working

Control:
5é*
Count of 5, prints 5 asterisks
https://tio.run/##K/v/3/TwSq3////rlgEA

With :
5<M-->é*
Count of 5, decrement the count by 1 to get 4, but it only prints 1 asterisk
https://tio.run/##K/v/39TGV1fX7vBKrf///@uWAQA

Same thing with <M-+>:
5<M-+>é*
Count of 5, increment the count by 1 to 6, but it only prints 1 asterisk
https://tio.run/##K/v/39TGV1fb7vBKrf///@uWAQA

I tried testing with the actual character rather than the verbose mode, but it seems that the given character for on the wiki is just a regular - character. I tried that, and an "–" (em dash), and I'm still not sure which is correct but both had the same effect anyways. I also tried « for <M-+>, no difference either. It seems that the command is using up the count so the next command can't use it. I don't think this is intended behavior, as it wouldn't be a very useful command.

Move away from neovim

Neovim is poorly supported on windows (not sure about mac). It would be nice to have it run on vim 8 instead of neovim for portability. This will require moving some logic into a vimscript "main function" of sorts, but I think that's OK. Doing that would probably also fix the timing bug

Arrow keys

In vim, using the arrow keys is one way to move around while in Insert-mode. Using them may sometimes save bytes, if you don't have to move too far and if you want to end up in the same mode as before (compare <Right> with <C-o>l, or <Right><Right><Right> with <C-o>3l)

Is there a way to incorporate arrow key presses in V-programs? I tried using <Right> with the -v flag, but that didn't work.

mysterious help pages

The following produces the lowercase alphabet in neovim, but the string character |linewise|. in V:

:h<_<CR>jjYZZp

I tested a different help page, which consistently produces *usr_01.txt* Nvim in both "languages":

:help tutor<CR>ggYZZp

Migrate python-commands to vimscript commands

Currently, commands are implemented in python. This is a big problem since python doesn't have full access to the state of vim when the command starts. The simple obvious solution is to replace all of the python commands with vimscript commands. That will allow the python code to be simplified, since we won't need to track things like mode, and count.

add ability to nest levels of ò and ñ

Hi, I'd really like to be able to make nested loops in V. Would it be possible to add this functionality sometime? so like ò{big loop ò{ loop for each big loop ò} still big loop ò} maybe add a "close loop" character for ò and ñ.

Timing bug

Because of the asynchronous nature of the neovim-python client, inputting keys while another key is still processing can cause some weird timing bugs (though not always). Currently, the solution is to force v.tio to run slower, which is hardly an idea solution.

Unprintable characters!

Right now, V heavily relies upon unprintable characters. For example, this program: http://v.tryitonline.net/#code=AQEBAQEBAQEBAQ&input=MTA

Nobody can tell what this code will do without running it.

This is OK since TIO handles them really well, and they're perfectly visible from in vim, but not everybody will write V code in vim. We should come up with a way to map certain printable unicode characters to the unprintable ones just for convenience so that other users can copy and paste commands from the docs, rather than being forced to write it in vim.

This will also make it easier to tell the flow of the program just by looking at it.

Running on Mac results freezes

System: OS X 10.11.1 (El Capitan)
**

I created an empty file named "test.V" and I ran it through the latest version of the interpreter:

$ python main.py test.V
^CTraceback (most recent call last):
  File "main.py", line 71, in <module>
    main()
  File "main.py", line 60, in main
    v_instance.clean_up()
  File "/Users/vihan/Downloads/V/v.py", line 109, in clean_up
    if self.get_mode() == "i":
  File "/Users/vihan/Downloads/V/v.py", line 77, in get_mode
    return self.nvim_instance.eval("mode(1)")
  File "/usr/local/lib/python2.7/site-packages/neovim/api/nvim.py", line 209, in eval
    return self.request('vim_eval', string, **kwargs)
  File "/usr/local/lib/python2.7/site-packages/neovim/api/nvim.py", line 129, in request
    res = self._session.request(name, *args, **kwargs)
  File "/usr/local/lib/python2.7/site-packages/neovim/msgpack_rpc/session.py", line 91, in request
    v = self._blocking_request(method, args)
  File "/usr/local/lib/python2.7/site-packages/neovim/msgpack_rpc/session.py", line 165, in _blocking_request
    self._enqueue_notification)
  File "/usr/local/lib/python2.7/site-packages/neovim/msgpack_rpc/async_session.py", line 65, in run
    self._msgpack_stream.run(self._on_message)
  File "/usr/local/lib/python2.7/site-packages/neovim/msgpack_rpc/msgpack_stream.py", line 43, in run
    self._event_loop.run(self._on_data)
  File "/usr/local/lib/python2.7/site-packages/neovim/msgpack_rpc/event_loop/base.py", line 134, in run
    raise err
KeyboardInterrupt: Received SIGINT

nothing actually even happened until I send SIGINT (^C)

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.