Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Possible regression in WeeChat 3.0 when using spell_suggest in input.items #1586

Closed
tofurky opened this issue Nov 13, 2020 · 1 comment
Closed
Assignees
Labels
bug Unexpected problem or unintended behavior
Milestone

Comments

@tofurky
Copy link

tofurky commented Nov 13, 2020

Bug summary

In WeeChat 3.0, if a misspelling occured in the previous line sent to a buffer, the text input field will continue to show suggestions for that misspelling in the now-empty input buffer.

Steps to reproduce

  • Set spell.check.enabled = on
  • Set input.items = "[input_prompt]+(away),[input_search],[input_paste],input_text,[spell_suggest]"
  • Send text with a detected misspelling to a buffer

Current behavior

Before sending text to a buffer, for example "weechat has a regression", the following is seen in the input field:

[@nick(ZiQw)] weechat has a regression [wee chat,wee-chat,Wichita]

After sending to the buffer, the following is seen in the input field:

[@nick(ZiQw)] [wee chat,wee-chat,Wichita]

Redrawing the window with Ctrl-L has no effect, nor does switching between buffers. Hitting space (and optionally, backspace) hides the suggestions.

Expected behavior

After sending the text to the buffer, the following should be seen, even if a misspelling was detected:

[@nick(ZiQw)]

Suggested solutions

Maybe 299f74b is related. I haven't bisected.

Additional information

2.9 was unaffected.

spell.conf:

[color]
misspelled = lightred
suggestion = lightblue
suggestion_delimiter_dict = cyan
suggestion_delimiter_word = cyan

[check]
commands = "ame,amsg,away,command,cycle,kick,kickban,me,msg,notice,part,query,quit,topic"
default_dict = "en"
during_search = off
enabled = on
real_time = off
suggestions = 3
word_min_length = 2

[dict]

[look]
suggestion_delimiter_dict = " / "
suggestion_delimiter_word = ","

[option]

Compiled using dpkg-buildpkg with the following in debian/rules:

        cmake .. \
                -DCMAKE_INSTALL_PREFIX:FILEPATH=/usr \
                -DLIBDIR=/usr/lib/${DEB_HOST_MULTIARCH} \
                -DENABLE_DOC:BOOL=ON \
                -DENABLE_MAN:BOOL=ON \
                -DCMAKE_BUILD_TYPE:STRING=RelWithDebInfo \
                -DCMAKE_C_FLAGS_RELWITHDEBINFO:STRING="$(CFLAGS) -D_FORTIFY_SOURCE=2" \
                -DCMAKE_MODULE_LINKER_FLAGS_RELWITHDEBINFO:STRING="$(LDFLAGS)" \
                -DCMAKE_SKIP_RPATH:BOOL=ON \
                -DCMAKE_VERBOSE_MAKEFILE:BOOL=ON \
                -DENABLE_RUBY:BOOL=OFF \
                -DENABLE_LUA:BOOL=OFF \
                -DENABLE_TCL:BOOL=OFF \
                -DENABLE_GUILE:BOOL=OFF \
                -DENABLE_JAVASCRIPT:BOOL=OFF \
                -DENABLE_PHP:BOOL=OFF
  • WeeChat version: 3.0
  • OS, distribution and version: Debian 10 amd64 (over SSH)
  • Terminal: mate-terminal 1.24.0 (on Ubuntu 20.04 amd64)
  • Terminal multiplexer (screen/tmux/…/none): tmux 2.8
@tofurky tofurky added the bug Unexpected problem or unintended behavior label Nov 13, 2020
@flashcode flashcode self-assigned this Nov 13, 2020
@flashcode flashcode added the in progress Someone is working on this issue label Nov 13, 2020
@tofurky
Copy link
Author

tofurky commented Nov 13, 2020

I can confirm that eb90a73 fixes this when applied onto 3.0. Thanks.

@flashcode flashcode added this to the 3.1 milestone Nov 13, 2020
@flashcode flashcode removed the in progress Someone is working on this issue label Nov 13, 2020
flashcode added a commit that referenced this issue Nov 20, 2020
… empty (issue #1586)

When the input is empty, length of string is zero: when sending zero to
function weechat_string_dyn_alloc, the function returns NULL and therefore we
return immediately instead of handling the empty input, which is a valid value.

The regression was introduced by the use of dynamic strings, commit:
299f74b

(cherry picked from commit eb90a73)
@flashcode flashcode modified the milestones: 3.1, 3.0.1 Jan 30, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Unexpected problem or unintended behavior
Projects
None yet
Development

No branches or pull requests

2 participants