ronisbr / TerminalPager.jl

Pure Julia implementation of the command less
MIT License
116 stars 8 forks source link

Change freeze corner case errors #9

Closed bkamins closed 3 years ago

bkamins commented 3 years ago

steps:

  1. press f
  2. press Enter
  3. press Enter

Result:

Freeze columns: ERROR: MethodError: no method matching isless(::Nothing, ::Int64)
Closest candidates are:
  isless(::Any, ::Missing) at missing.jl:88
  isless(::Missing, ::Any) at missing.jl:87
  isless(::AbstractFloat, ::Real) at operators.jl:169

you need to handle nothing in the input when the user just presses enter (maybe it should be just something(your_var, 0) so that Enter resets freeze to 0?)

ronisbr commented 3 years ago

Ooops :) Thanks @bkamins, it should be fixed now.

I used the same behavior of Vim, hitting just enter will keep the current value.