Commit graph

77 commits

Author SHA1 Message Date
aycabta
72bfc52de6 Decrease indent by closing token correctly 2019-06-27 01:21:06 +09:00
aycabta
c4c47b792d Disable auto indent when move cursor up or down
This commit suppresses a strange behavior below:

  if true
    1[cursor]
  end

and press down key

  if true
  1
  end
2019-06-20 16:00:30 +09:00
aycabta
235e72f17e Implement auto indent for multiline 2019-06-18 20:58:18 +09:00
aycabta
2fb1564c02 Implement line_no correctly 2019-06-16 14:46:28 +09:00
aycabta
d0e5564140 Set allow_escape_code for prompt 2019-06-14 08:45:35 +09:00
aycabta
64310b2573 Add Reline.prompt_proc 2019-06-14 07:42:53 +09:00
aycabta
02880d1f4a Skip transpose-words if less than 2 word 2019-06-06 04:57:52 +09:00
aycabta
9a07915ae2 Add aliases for commands for changing text macro 2019-06-04 08:35:01 +09:00
aycabta
4b7213a85a Implement transpose-words 2019-06-04 07:23:36 +09:00
aycabta
d7c3eb570b Erase VI_OPERATORS
The operators are using @waiting_operator_proc in vi mode.
2019-06-03 17:24:49 +09:00
aycabta
5524de5ca0 Add aliases for commands for moving macro 2019-06-03 03:41:40 +09:00
aycabta
3428922437 The ed_move_to_beg is different from vi_first_print 2019-06-03 03:29:34 +09:00
Nobuyoshi Nakada
65fdb90325
Reline::LineEditor::ARGUMENTABLE is no longer used 2019-06-03 02:03:15 +09:00
Nobuyoshi Nakada
3457ce4486 Fix ArgumentError in aliased macro
Closes: https://github.com/ruby/ruby/pull/2221
2019-06-03 01:35:48 +09:00
aycabta
7b1c1b9492 Suppress error of macro not found 2019-06-02 05:07:13 +09:00
aycabta
34727475d0 Remove an unnecessary argument 2019-06-01 15:07:52 +09:00
Takashi Kokubun
cb40a21da0
Warn compile_error only when input is finished
Let's say we are in progress to write `"foo"`:

```
irb> "fo
```

at this moment, nothing is wrong.
It would be just a normal way to write `"foo"`.

Prior to this commit, the `fo` part was warned because of
5b64d7ac6e. But I think warning such a
normal input is not valuable for users.

However, we'd like to warn `:@1` or `@@1` which is also a syntax error.
Then this commit switches the syntax highlight based on whether the
input text is finished or not. When it's not finished yet, it does not
warn compile_error.
2019-05-31 06:54:00 +09:00
aycabta
8f83fe3b02 Finish with ^D only when input is completely empty in vi insert mode 2019-05-31 05:53:02 +09:00
aycabta
279c8e14d4 Use rebuilt buffer data to rerender all 2019-05-30 20:54:28 +09:00
aycabta
74a0e3ec23 Use start_with? for escaped quote too 2019-05-30 20:06:59 +09:00
aycabta
ecd0f1d966 Use negative lookahead and start_with? 2019-05-30 18:29:26 +09:00
aycabta
fcca39fa73 Fix strange vertical cursor moving when adding a newline at bottom 2019-05-30 18:21:09 +09:00
aycabta
5a229b0a88 Calculate vertical position correctly when rerendering all lines 2019-05-30 15:19:30 +09:00
aycabta
90014dddec Fix broken rendering when the last line is auto-wrapped 2019-05-30 15:04:37 +09:00
aycabta
eae953ba9f Rerender following lines when line number increased 2019-05-30 14:19:58 +09:00
aycabta
1cf9f79342 Clear remaining lines when line number decreased 2019-05-30 14:04:28 +09:00
aycabta
cb520e7623 Fix the auto-wrap behabior that was too buggy 2019-05-30 12:29:38 +09:00
aycabta
57b4df07bc Use Reline.completer_quote_characters to complete 2019-05-28 08:38:55 +09:00
aycabta
7447c7b651 Join next line if deletes newline at end of line 2019-05-28 01:52:04 +09:00
aycabta
69c7ad1723 Exit only when blank input 2019-05-28 01:51:01 +09:00
aycabta
9a68aba79f Support OSC and treat \1 \2 correctly 2019-05-28 00:48:02 +09:00
aycabta
70166b3ca3 Revert "Support OSC and treat \1 \2 correctly"
This reverts commit 77bfebebc4.
2019-05-28 00:21:24 +09:00
aycabta
77bfebebc4 Support OSC and treat \1 \2 correctly 2019-05-28 00:17:52 +09:00
Nobuyoshi Nakada
4c277364a5
CSI allows empty digit which equals 0 2019-05-27 11:47:09 +09:00
aycabta
1d301acbe8 Fix rendering bug of ^D 2019-05-27 10:09:21 +09:00
aycabta
9c136f3dea Move to next of last line by ^D 2019-05-27 08:39:39 +09:00
aycabta
4e2c7783e3 Check blank history 2019-05-27 08:13:48 +09:00
aycabta
2805c55aa3 Move to next of last line by ^C 2019-05-27 07:35:35 +09:00
aycabta
c49796c930 Reline should move to next line after finished in Readline mode 2019-05-27 07:00:06 +09:00
aycabta
2c91c5b329 Move to the other line when press <- at head or -> at tail 2019-05-27 06:04:42 +09:00
aycabta
716ba4a127 Implement J to join lines in vi command mode 2019-05-27 05:45:08 +09:00
aycabta
64dc21830a Remove \1 and \2 that escape CSI before render 2019-05-27 05:01:18 +09:00
aycabta
ec75901120 Fix completion menu state calculation 2019-05-26 01:32:29 +09:00
aycabta
d9c41f2dec Use Reline.completer_word_break_characters to complete 2019-05-26 00:00:19 +09:00
Takashi Kokubun
061c781a09
Drop method obsoleted by b83119be9e
We might need to do the same thing in IRB::Color now, but I'm not doing
that as I assume ANSI escape sequence does not come from a user input
though Reline.
2019-05-25 00:38:19 -07:00
Takashi Kokubun
b83119be9e
Incremental syntax highlight for IRB source lines
Closes: https://github.com/ruby/ruby/pull/2202
2019-05-24 23:54:52 -07:00
aycabta
ff43b22627 Enter key always means evaluate in Reline#readmultiline 2019-05-25 02:13:14 +09:00
aycabta
637ee7ee38 Fix C-v C-j 2019-05-25 01:13:02 +09:00
aycabta
eb4e774711 Support Meta key in Reline 2019-05-24 23:38:40 +09:00
aycabta
bb29ed6e33 C-v C-j means an newline insertion 2019-05-23 08:33:20 +09:00